When using HotDocs Advance, the typical goal of end users is to produce a completed, customized document. You use Assembly sessions to manage the process of gathering user data and producing assembled documents for a work item.
In this Topic Hide
There are three main work-flows for using assembly sessions:
Generally, you will use this workflow when:
If you already have a full set of answer data and want to assemble documents immediately, see the Batch processing workflow instead.
The steps below outline how you should use the API to create a work item, display an interview, assemble, and download documents.
Step | Name | Description | REST API Method | 'How-to' Topic |
1 | Create a work item | Creates a new work item in Advance. Once a work item is created, you can create an assembly session for that work item. | PUT /WorkItems/{id} | Creating a work item |
2 | Begin the assembly session |
Creates a new assembly session for a specific work item. This request provides you with the data required to display an interview in the browser and interact with the assembly session. | PUT /WorkItems/{id}/Versions/{versionId} | Beginning an assembly session |
3 | Display the interview |
The interview is displayed to your end user, in your own web
application. This requires you to pass the following data to a
page in your application:
This data is needed by the HotDocs Core Services JavaScript API to display the interview. |
N/A | Displaying an interview |
4 | User clicks Finish button in interview | When the user decides they have entered all the necessary information into the interview, they click the Finish button. This posts the answer data from the interview to the endpoint you specified when configuring the interview. | N/A | N/A |
5 | Complete the assembly session | Call the Complete endpoint to assemble the completed documents and finish the assembly session. Advance creates a new work item version. | PUT /WorkItems/{id}/Versions/active/CompleteSession | Completing an assembly session |
6 | Download the documents | Optional: you can download
the documents produced by the completed assembly session. This
requires two API requests:
|
and GET /WorkItems/{id}/Documents/{documentId}/Content |
This workflow assembles documents without displaying an interview. Generally, you will use this workflow when:
The steps below outline how you should use the API to create a work item, assemble, and download documents.
Step | Name | Description | REST API Method | 'How-to' Topic |
1 | Create a work item | Creates a new work item in Advance. You must supply answer XML in the request; Advance will use these answers when assembling the new documents. To assemble documents immediately, ensure that your request is correctly configured for the following parameters:
|
PUT /WorkItems/{id} | Creating a work item |
2 | Download the documents | Optional: you can download
the documents produced by the completed assembly session. This
requires two API requests:
|
and GET /WorkItems/{id}/Documents/{documentId}/Content |
This workflow assembles a new set of documents for an existing work item, without displaying an interview. Generally, you will use this workflow when:
The steps below outline how you should use the API to supply answer data, assemble, and download documents.
Step | Name | Description | REST API Method | 'How-to' Topic |
1 | Assemble documents for a work item |
Assembles documents for an existing work item. You must supply answer XML in the request; Advance will use these answers when assembling the new documents. |
PUT /WorkItems/{id}/AssemblySessions | |
2 | Download the documents | Optional: you can download
the documents produced by the completed assembly session. This
requires two API requests:
|
and GET /WorkItems/{id}/Documents/{documentId}/Content |
Once you create the assembly session, there are also endpoints you can use to save or delete the in-progress assembly session:
Name | Description | REST API Method | 'How-to' Topic |
Save the assembly session | Save the state of the currently active assembly session, including the answers entered by the user into the interview. This endpoint is typically used when a user leaves the interview page and wants to return to the interview later. If you want the user to save an in-progress session, in your application you will typically include a 'Save and Exit' button on the interview page that calls this API method. | PUT /WorkItems/{id}/Versions/active/SaveSession | Saving an In-progress Assembly Session |
Delete the assembly session | Permanently delete the currently active assembly session. | DELETE /WorkItems/{id}/Versions/active |
If you have saved an assembly session, you can resume the session by making a request to the begin assembly session endpoint, using same versionId as you used to begin the initial assembly session.
See Beginning an assembly session: Resuming an Assembly Session for more information.