Use Case: Assembling a Document Using a Supplied Answer Set
Use this workflow when you need to generate documents using answer data you already have. This is ideal for batch processing scenarios where user input is not required.
Overview
To assemble a document using a supplied answer set., you send HotDocs Answer XML when creating a work item.
- Validate the Answer XML against the HotDocs answer Set schema before sending.
- All REST operations require a valid access token.
- Document assembly occurs only after the work item version is completed.
API Call Sequence
Step 1 - Create a work item
Create a work item and include the validated HotDocs Answer XML in the request. The work items acts as the container for your template, answer data and assembled documents.
Endpoint: POST WorkItems
Purpose: Create a work item and supply the answer set.
See: Creating a work item
Step 2 - Create and assemble a new work item version
Start an assembly session by creating a new version of the work item. Each version represents a distinct instance of document assembly.
Endpoint: POST /WorkItems/{workItemId}/Versions/{VersionId}/CreateAndAssemble
Purpose: Carry out the assembly process for the work item.
See: Creating and assembling a new work item version
Step 3 - Download assembled documents
Query the API for the assembled documents and download them by handling the response stream.
Endpoint: GET /WorkItems/{workItemId}/Versions/{versionId}/Documents
Purpose: Retrieve the assembled documents.
See: Downloading assembled documents