Get Interview File

The GetInterviewFile method enables the host application to retrieve a specified file from a HotDocs Package File stored in CloudWeb Services.

In this Topic Hide

Using Get Interview File

Interview Files

Interview File GET

Example (C#)

Using Get Interview File

Use the GetInterviewFile method when you need additional files for the interview. When the interview requires the file:

  1. The interview triggers a callback to an endpoint in the host application.
  2. The endpoint in the host application uses GetInteviewFile to retrieve the requested file from the Template Package in Cloud Services.
  3. The host application returns the file.

You must define the endpoint URLs for the Interview File callbacks in the Get Interview call.

Interview Files

Typically, you use the GetInterviewFile method to retrieve the files in the table below.

File Type Example File Name Description Interview Setting in Get Interview
Interview Definition file ExampleTemplate.docx.js A JavaScript file used when rendering the interview. This file defines the interview layout and content. InterviewDefUrl
Image Files (optional) DialogImage.png Any image used by Image-type Dialog Elements in the interview. Images used by Dialog Elements are stored in the HotDocs Package File containing the Template. TempInterviewUrl

For more information on the files required by the interview, see Displaying HotDocs Interviews.

Interview File GET

HTTP Request

GET http://{machineName}:{portNumber}/HDSWebAPI/api/hdcs/interviewfile/{subscriberID}/{packageID}?filename={filename}

Parameters

Name Location Required Description

machineName

Path

Yes

The name of the server on which the Web Service is installed.

portNumber

Path

Yes

The port through which the Web Service is accessible.

subscriberID Path Yes

Set this value to 0.

packageID Path Yes An ID identifying the package containing the template about which you are requesting information. This is set when uploading the package file. If you are using the HotDocs Hub to store templates, see Get a Package ID from HotDocs Hub.
filename Query string Yes

The name of the file to retrieve from the package file. For example, ExampleTemplate1.docx.js.

RetrieveFromHub

Query string

No

Note: this parameter may require additional Web Services configuration. See Retrieve Templates from HotDocs Hub for more information.

Enables you to retrieve a HotDocs template from the HotDocs Hub instead of a template stored in the Web Services cache.

Select from the following options (case-insensitive):

  • No (default value) – do not connect to HotDocs Hub; use the Package ID in request path (see above) to get the template from the Web Services cache
  • ByTemplateId – use the Package ID in request path as the ID of the template to retrieve. Web Services checks the HotDocs Hub for the latest version of the template and:
    • If the Web Services cache has the latest version of the template, the template is retrieved from the cache.
    • If the Web Services cache does not have the latest version of the template, the latest version of the template is retrieved from the HotDocs Hub. The Web Services cache is updated with the template retrieved from the HotDocs Hub.
  • ByVersionId – use the Package ID in request path as the ID of the specific template Version to retrieve. Web Services checks the HotDocs Hub for the specific version of the template and:
    • If the Web Services cache has the same version of the template as the Hub, the template is retrieved from the cache.
    • If the Web Services cache does not have the same version of the template as the hub, the specific version of the template is retrieved from the HotDocs Hub. The Web Services cache is updated with the template retrieved from the HotDocs Hub.

Example URL

http://machine-name:80/HDSWebApi/api/hdcs/interviewfile/0/ed40775b-5e7d-4a51-b4d1-32bf9d6e9e29?filename=example.docx.js

Response

If successful, this method returns a Stream containing the requested file.

Example Request

GET http://machine-name/HDSWEBAPI/api/hdcs/interviewfile/0/ed40775b-5e7d-4a51-b4d1-32bf9d6e9e29?filename=ExampleTemplate.docx.js HTTP/1.1 Keep-Alive: false Host: machine-name Connection: Keep-Alive





Example (C#)

Walkthrough

For a full walkthrough of retrieving an Interview File from a template package in Web Services, see the Web Services Example 5: Get Interview File article in the HotDocs Integrations documentation.

Code

For a full code example of retrieving an Interview File from a template package in Web Services, see the WebServiceExample5InterviewFile project in the HotDocs Integration Examples.