Saving and Closing a Work Item Version
The save and close work item version API method enables you to save the current state of an in-progress work item version and delete the Core Assembly session.
Prerequisites
Before making a 'save and close work item version' request, you must have an access token to sign the request. You can retrieve an access token using one of the following flows:
- Getting an access token using the Resource Owner flow
- Getting an access token using the Implicit flow
Additionally, you must have the following items:
-
A work item with an in-progress assembly session (see Creating a New Work Item Version)
Overview
Implementing the save and close work item version feature is usually only required when you are displaying an interview to your end users.
The 'save and close work item version' API method is a command method. The API client invoking this method must have either a command or a root scope.
This method is useful when you want to enable a user to save the current state of their interview, so they can return to it at a later time.
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
PUT https://{tenancymoniker}.{domain}/HdaApi/rest/v2.0/WorkItems/{workItemId}/Versions/{versionId}/SaveAndClose
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. |
domain | String | URL | Yes | Your domain. For example, yourorganization.com. |
workItemId | Guid | URL | Yes | The Guid for an existing work item. |
versionId | Guid | URL | Yes | The Guid for a work item version associated with the work item. |
callbackUrl | String | Body | No | The URL to which a notification is sent when the work item finishes completing. |
callbackSecret | String | Body | No | A secret value used to authenticate the callback request. |
Examples
Example Request URL
https://yourtenancy.yourorganization.com/HdaApi/rest/v2.0/WorkItems/2d9f3d10-6fdb-494f-9929-955515c6f114/Versions/{7c5c9d8e-9e7d-4d4d-9d9d-7b7c8e6f5a3f}/SaveAndClose
Example Request JSON
{
callbackUrl: "string",
callbackSecret: "string"
}
Example Response
Status: 202 Accepted