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:

A host application may want to retrieve Component Info to:

In this Topic Hide

Component Info GET

Example (C#)

Component Info GET

HTTP Request

GET http://{machineName}:{portNumber}/HDSWebAPI/api/hdcs/componentinfo/{subscriberID}/{packageID}/{templatename=null}

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.
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.
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 – returns XML listing variables used in the Template, including their names and types

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://localhost:80/HDSWEBAPI/api/hdcs/componentinfo/0/ed40775b-5e7d-4a51-b4d1-32bf9d6e9e29?includeDialogs=True

Response

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

Example Request

GET http://machine-name/HDSWEBAPI/api/hdcs/componentinfo/0/ed40775b-5e7d-4a51-b4d1-32bf9d6e9e29?includeDialogs=True HTTP/1.1
Keep-Alive: false
Host: machine-name
Connection: Keep-Alive

Example (C#)

Walkthrough

For a full walkthrough of retrieving component file information from a template in Web Services, see the Web 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 Web Services, see the WebServiceExample4ComponentInfo project in the HotDocs Integration Examples.