Get Variable Data for a Template Package Version

API Version: v2.0
Method: GET
Endpoint: /TemplatePackages/{templatePackageId}/Versions/{versionId}/VariableData

The Get Variable Data for a Template Package Version function retrieves the variable data manifest for a specific version of a template package. For example, you can use this endpoint to inspect the variables used in a version of a template package before populating it with data.

This endpoint is read-only and should not be used to modify or submit variable data.

Prerequisites

Before making a 'get variable data' request, you must have an access token to sign the request. You can retrieve an access token using one of the following flows:

Additionally, you must have a template created in version 1.78 of HotDocs Author or later.

Overview

Use this endpoint to retrieve the variable data manifest associated with a specific version of a template package. The manifest includes metadata such as variable names, types, default values and whether they are required. This can be useful for:

  • validating data types before populating templates.
  • mapping external data sources to HotDocs templates.
  • automating data integration workflows.
     

Validating the HotDocs Answer Set XML

When sending HotDocs answer set XML in a create work item request, you must first validate the answer set against the HotDocs answer Set schema.

Authentication

See Authentication for more information about authenticating requests to the Advance API.

API Documentation

You can view the latest reference documentation for the Advance API at https://yourorganization.com/HdaApi/rest/documentation/index.html, where yourorganization.com is the domain under which your Advance deployment is located.

Request

Request URL

GET https://{tenancymoniker}.{domain}/HdaApi/rest/v2.0/TemplatePackages/{templatePackageId}/Versions/{versionId}/VariableData

Headers

Key Required Description Example value
Authorization Yes The Authorization header for the request. Uses the access token retrieved (see Prerequisites section above for more information). Bearer [access token]

Parameters

Name Type Location Required Description
tenancymoniker String URL Yes The tenancy moniker for the tenancy in which you want to create the new work item.
templatePackageId Guid URL Yes The ID of the template package.
versionId Guid URL Yes The ID of the specific version of the template package.

Examples

Example Request URL

https://yourtenancy.yourorganization.com/HdaApi/rest/v2.0/TemplatePackages/{templatePackageId}/Versions/{versionId}/VariableData

Example Response
{
  "manifestVersion": 1,
  "title": "Example Template",
  "fileName": "ExampleTemplate.docx",
  "templateId": "12345678-1234-1234-1234-123456789012",
  "description": "This is an example template.",
  "templateType": "docx",
  "productName": "Author",
  "productVersion": "1.94.0.0",
  "variables": [
    {
      "name": "TextVariable1",
      "type": "textVarType"
    },
    {
      "name": "NumberVariable1",
      "type": "numberVarType"
    },
    {
      "name": "DateVariable1",
      "type": "dateVarType"
    },
    {
      "name": "TrueFalseVariable1",
      "type": "trueFalseVarType"
    
    }
  ]
}

See also:

  • Template Variable Metadata Overview