Resume Session
The ResumeSession method resumes a HotDocs Embedded interview/assembly session from a saved interview state string ("Interview Snapshot"). The method returns the 32-character session ID. This session ID is used in conjunction with the Embedded JavaScript API to create and initialize an IFRAME in the web browser containing the requested interview.
Using Resume Session
Resuming a previous Embedded Interview session requires an Interview Snapshot. This is a string containing data about the state of the interview. The Interview Snapshot string is sent to Cloud Services in the sessionState parameter of the request query string.
Saving an Interview Snapshot
The GetSnapshot Embedded JavaScript API method is used to save an Interview Snapshot.
ResumeSession POST
HTTP Request
POST https://{subscribedEndpoint}/embed/resumesession/{subscriberID}/{packageID}
Parameters
Name |
Location |
Required | Description |
subscribedEndpoint | path |
Yes |
The endpoint to which the caller is subscribed. This is either:
|
subscriberID | path | Yes | The caller's Cloud Services subscriber ID |
packageID | path | Yes | A version-specific ID identifying the template package for which you are requesting an interview/assembly session. |
sessionState | request body | Yes | The session state string that was returned when a snapshot of the session was saved. |
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 or query string | 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 Resume Session for more information. |
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):
|
Example URL
https://cloud.hotdocs.ws/embed/resumesession/examplesubscriber/353c1217-09a6-42db-b84e-385ead9c87b0?date=05/25/2015 9:30:15 PM&signature=zTj3jjP+E01JTH6JpV4FCRDu+bQ=
Response
If successful, this method returns a 32-character Session ID. The Session ID is used with CreateInterviewFrame JavaScript function to create the Interview.
Request Headers
When making a Resume Session 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 should be 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 |
The calculated HMAC |
The HMAC used to sign the request. |
request.Headers.TryAddWithoutValidation("Authorization", hmac); |
HMAC Calculation for Resume Session
For calls to resume a session, 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 |
example-subscriber-id |
Subscriber ID named used to connect to Cloud Services. This was provided when you signed up to Cloud Services. |
snapshot |
string |
|
The state string saved from a previous interview. |
additional settings |
string |
|
Any optional settings that were included in the query string of the request (see above). |
Example (C#)
Walkthrough
For a full walkthrough of using ResumeSession to resume an interview/assembly session, see Cloud Services Embedded Example 2: Resume an Interview.
Code
For a full example of using the REST API to generate an interview/assembly session, see the CloudServicesEmbeddedAPIExample project in the HotDocs Integration Examples.