Get Component Info

The GetComponentInfo method allows host applications to read basic metadata about a HotDocs template from the template's Component File. This metadata includes:

  • Variable names and types
  • Dialog names
  • Grouping of variables in dialogs
  • Any data source mappings defined in the template

A host application may want to retrieve Component Info to:

  • Map between your application's own data fields and the variables used in a HotDocs template.
  • Discover which variables are part of a specific dialog. For example, to display a dynamic popup from which the user could select custom data to be added to the dialog.

Component Info GET

HTTP Request

GET https://{subscribedEndpoint}/hdcs/componentinfo/{subscriberID}/{packageID}/{templatename=null}

Parameters

Name Location Required Description
subscribedEndpoint Path Yes

The endpoint to which the caller is subscribed. This is either:

  • USAcloud.hotdocs.ws
  • EUeurope.hotdocs.ws
subscriberID Path Yes

The caller's Cloud Services subscriber ID

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.
templatename Path No The file name of the specific template about which you are requesting information. This can be omitted to request information about whichever is the primary template in the package.
date HTTP header or query string Yes The date and time (in UTC) of the request, formatted according to RFC 1123. This date can be included either as a parameter on the query string or in an "x-hd-date" (custom) HTTP header.
signature HTTP header Yes The base64-encoded HMAC calculated using the parameters of this request. Note: the HMAC must be included in an "Authorization" HTTP header. See HMAC calculation for Component Info.
includeDialogs Query string Yes  Include Template dialog metadata in the result. Either True or False:
  • True – returns XML listing dialogs used in the Template, including variables used in the dialogs and any mapping of dialog variables to external data sources
  • False (default value) – returns XML listing variables used in the Template, including their names and types
billingRef Query string No Enables you to specify information to include in usage logs for this call. For example, you can use a string to uniquely identify the end user that initiated the request and/or the context in which they made the call. When you later review usage logs, you can see which end users initiated each request. This information can enable you to audit or pass costs on to those end users.

RetrieveFromHub

Query string

No

Enables you to retrieve a HotDocs template from the HotDocs Hub instead of a template stored in the Cloud 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 Cloud Services cache
  • ByTemplateId – use the Package ID in request path as the ID of the template to retrieve. Cloud Services checks the HotDocs Hub for the latest version of the template and:
    • If the Cloud Services cache has the latest version of the template, the template is retrieved from the cache.
    • If the Cloud Services cache does not have the latest version of the template, the latest version of the template is retrieved from the HotDocs Hub. The Cloud 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. Cloud Services checks the HotDocs Hub for the specific version of the template and:
    • If the Cloud Services cache has the same version of the template as the Hub, the template is retrieved from the cache.
    • If the Cloud 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 Cloud Services cache is updated with the template retrieved from the HotDocs Hub.

Example URL

https://cloud.hotdocs.ws/hdcs/componentinfo/examplesubscriber/ed40775b-5e7d-4a51-b4d1-32bf9d6e9e29?includeDialogs=True&billingRef=exampleBillingRef

Response

If successful, this method returns an XML document in the response body that encapsulates the requested component information.

Request Headers

When making a Get Component Information request to Cloud Services, the request must include the following headers.

Name

Data Type

Data

Description Example (C#)
x-hd-date DateTime value 2015-01-31T08:55:19Z A Date and Time for the request. This is the same value as the date/time used when calculating the HMAC. request.Headers.Add("x-hd-date", timestamp.ToString("yyyy-MM-ddTHH:mm:ssZ"));
Authorization String Calculated HMAC The HMAC used to sign the request. request.Headers.TryAddWithoutValidation("Authorization", hmac);

Example Request


  
GET https://cloud.hotdocs.ws/hdcs/componentinfo/examplesubscriber/ed40775b-5e7d-4a51-b4d1-32bf9d6e9e29?includeDialogs=False HTTP/1.1
x-hd-date: 2015-07-13T10:21:40Z
Authorization: 7wSpwmWQFaqctzE29+3vz8W4JBc=
Host: cloud.hotdocs.ws
Connection: Keep-Alive

HMAC Calculation for Component Info

For calls to Assemble a document, the HMAC is calculated from the following list of parameters:

Name

Type

Example Data

Description

signingKey

String

example-signing-key

The Signing Key assigned to your Cloud Services account. You can find your Signing Key by logging in to the Cloud Services Portal.

date

DateTime

2015-01-31T08:55:19Z

Date and time, using the format "yyyy-MM-ddTHH:mm:ssZ". For example, a datetime of 31/05/2015 08:55:19 is formatted as 2015-01-31T08:55:19Z.

subscriberID

String

ExampleCompany

Subscriber ID named used to connect to Cloud Services. This was provided when you signed up to Cloud Services.

packageID

String

ed40775b-5e7d-4a51-b4d1-32bf9d6e9e29

The name of the HotDocs Package File (.hdpkg) uploaded to Cloud Services.

templateName

String

""

A string value. The name of the template in the package file that is to be assembled. If there is only one template in the package, an empty string is used.

sendPackage

Boolean

False

A boolean value. For assembling a document in Cloud Services, this is always False.

billingRef

String

ExampleCustomer, Template Upload

Enables you to specify information to include in usage logs for this call. For example, you can use a string to uniquely identify the end user that initiated the request and/or the context in which they made the call. When you later review usage logs, you can see which end users initiated each request. This information can enable you to audit or pass costs on to those end users.

includeDialogs

Boolean

True

Determines if Dialog information is included with the response.

  • True – dialog information is included.
  • False – dialog information is omitted.

Example (C#)

Walkthrough

For a full walkthrough of retrieving component file information from a template in Cloud Services, see the Cloud Services Example 4: Get Component Info article in the HotDocs Integrations documentation.

Code

For a full code example of retrieving Component File information from a template in Cloud Services, see the CloudServicesAPIExample4ComponentInfo project in the HotDocs Integration Examples.