Skip to navigation

Task API

View as Markdown

Developing with the CLM API is only available for CLM customers with a production account. To purchase a plan to gain access to the CLM API, contact Docusign Sales.

The CLM Task API exposes Docusign CLM services as tasks that can be executed and monitored programmatically. It offers methods for generating documents, manipulating documents, advanced search, and other long-running document operations. JSON is the supported format for requests and responses.

Task API operations are based on a task object. However, the properties associated with the task object vary depending on the operation you are invoking. In general, you only need to include a subset of task properties to invoke a Task API method. See the API reference for details.

Using the Task API

Tasks are asynchronous, and are invoked and monitored in the following way:

  1. To initiate a task operation, a POST request is made to a task endpoint. The request passes in a task object containing the subset of properties that the specific endpoint requires.

  2. All POST requests to initiate a task will return a result object. The structure of the result object varies based on the task being invoked, but all result objects have some commonalities:

  3. An Href property that contains a URI that uniquely identifies the task invocation. You can make a GET request to this URI to check the status of the task and retrieve the results. For a longer-running task, you can periodically poll GET requests to this URI to check the current status and get the results of the task.

  4. A Status property that indicates the state or result of the operation. Statuses for most tasks include: Processing, Success, and Failure. Some tasks may also have specialized statuses. See the API reference for more information.

  5. Result properties that vary based on the task.

  6. Some tasks allow you to cancel the operation. To cancel a task operation, make a DELETE request to the task URI.

Note: Although the Docusign CLM Advanced Workflow engine is a long-running series of tasks, it is not exposed via the Task API. The engine’s workflows, work items, and queues are considered objects and are exposed in the Object API.

Document search tasks

Example search request for “Contract” in the document name

Headers: Accept: 'application/json'

URI: https://apina11.springcm.com/v2/documentsearchtasks

Method: POST

JSON:

{
"Title":"Contract"
}

Example search response for “Contract” in the document name

{
"Status": "Success",
"Result": {
"Items": [
{
"Name": "Company ABC Contract.pdf",
"CreatedDate": "2015-04-21T15:54:28.653Z",
"CreatedBy": "klitwin@springcm.com",
"UpdatedDate": "2015-05-03T17:59:35.41Z",
"UpdatedBy": "klitwin@springcm.com",
"Description": "",
"ParentFolder": {
"Href": "https://apina11.springcm.com/v2/folders/7506bd38-xxxx-xxxx-xxxx-001cc448da6a"
},
"HistoryItems": {
"Href": "https://apina11.springcm.com/v2/documents/e0db92b0-xxxx-xxxx-xxxx-3863bb335c14/historyitems"
},
"AccessLevel": {
"See": true,
"Read": true,
"Write": true,
"Move": true,
"Create": true,
"SetAccess": true
},
"PageCount": 1,
"Lock": {
"Href": "https://apina11.springcm.com/v2/documents/e0db92b0-xxxx-xxxx-xxxx-3863bb335c14/lock"
},
"PreviewUrl": "https://na11.springcm.com/atlas/documents/preview.aspx?aid=6410&lduid=e0db92b0-xxxx-xxxx-xxxx-3863bb335c14",
"Versions": {
"Href": "https://apina11.springcm.com/v2/documents/e0db92b0-xxxx-xxxx-xxxx-3863bb335c14/versions"
},
"ShareLinks": {
"Href": "https://apina11.springcm.com/v2/documents/e0db92b0-xxxx-xxxx-xxxx-3863bb335c14/sharelinks"
},
"DocumentProcessTrackingActivities": {
"Href": "https://apina11.springcm.com/v2/documents/e0db92b0-xxxx-xxxx-xxxx-3863bb335c14/documentprocesstrackingactivities"
},
"DocumentReminders": {
"Href": "https://apina11.springcm.com/v2/documents/e0db92b0-xxxx-xxxx-xxxx-3863bb335c14/documentreminders"
},
"DownloadDocumentHref": "https://apidownloadna11.springcm.com/v2/documents/e0db92b0-xxxx-xxxx-xxxx-3863bb335c14",
"Href": "https://apina11.springcm.com/v2/documents/e0db92b0-xxxx-xxxx-xxxx-3863bb335c14"
},
{
"Name": "Company XYZ Contract.pdf",
"CreatedDate": "2010-12-07T15:47:27.23Z",
"CreatedBy": "example@springcm.com",
"UpdatedDate": "2010-12-07T15:47:27.23Z",
"UpdatedBy": "example@springcm.com",
"Description": "",
"ParentFolder": {
"Href": "https://apina11.springcm.com/v2/folders/aea58e35-xxxx-xxxx-xxxx-001cc448e3c7"
},
"HistoryItems": {
"Href": "https://apina11.springcm.com/v2/documents/c512034a-xxxx-xxxx-xxxx-001cc448e3c7/historyitems"
},
"AccessLevel": {
"See": true,
"Read": true,
"Write": true,
"Move": true,
"Create": true,
"SetAccess": true
},
"PageCount": 3,
"Lock": {
"Href": "https://apina11.springcm.com/v2/documents/c512034a-xxxx-xxxx-xxx-001cc448e3c7/lock"
},
"PreviewUrl": "https://na11.springcm.com/atlas/documents/preview.aspx?aid=6410&lduid=c512034a-xxxx-xxxx-xxxx-001cc448e3c7",
"Versions": {
"Href": "https://apina11.springcm.com/v2/documents/c512034a-xxxx-xxxx-xxxx-001cc448e3c7/versions"
},
"ShareLinks": {
"Href": "https://apina11.springcm.com/v2/documents/c512034a-xxxx-xxxx-xxxx-001cc448e3c7/sharelinks"
},
"DocumentProcessTrackingActivities": {
"Href": "https://apina11.springcm.com/v2/documents/c512034a-xxxx-xxxx-xxxx-001cc448e3c7/documentprocesstrackingactivities"
},
"DocumentReminders": {
"Href": "https://apina11.springcm.com/v2/documents/c512034a-xxxx-xxxx-xxxx-001cc448e3c7/documentreminders"
},
"DownloadDocumentHref": "https://apidownloadna11.springcm.com/v2/documents/c512034a-xxxx-xxxx-xxxx-001cc448e3c7",
"Href": "https://apina11.springcm.com/v2/documents/c512034a-xxxx-xxxx-xxxx-001cc448e3c7"
}
],
"Href": "https://apina11.springcm.com/v2/documentsearchtasks/1fe928eb-xxxx-xxxx-xxxx-fe2e229c77a6/Result",
"Offset": 0,
"Limit": 20,
"First": "https://apina11.springcm.com/v2/documentsearchtasks/1fe928eb-xxxx-xxxx-xxxx-fe2e229c77a6/Result",
"Last": "https://apina11.springcm.com/v2/documentsearchtasks/1fe928eb-xxxx-xxxx-xxxx-fe2e229c77a6/Result",
"Total": 2
},
"Href": "https://apina11.springcm.com/v2/documentsearchtasks/1fe928eb-xxxx-xxxx-xxxx-fe2e229c77a6"
}

Copy document tasks

Example request for Initiate Copy

Headers: Accept: 'application/json'

URI: https://apina11.springcm.com/v2/copytasks

Method: POST

JSON:

{
"DocumentsToCopy": [
{
"Href": "https://apina11.springcm.com/v2/documents/e0db92b0-xxxx-xxxx-xxxx-3863bb335c14"
}
],
"DestinationFolder": {
"Href": "https://apina11.springcm.com/v2/folders/16caaf38-xxxx-xxxx-xxxx-001cc448da6a"
}
}

Example response for Initiate Copy

{
"Status": "Processing",
"Href": "https://apina11.springcm.com/v2/copytasks/95a91709-4a73-xxxx-xxxx-11e18fd81b19"
}

Example request for Check Status

Headers: Accept: 'application/json'

URI: https://apina11.springcm.com/v2/copytasks/95a91709-xxxx-xxxx-xxxx-11e18fd81b19

Method: GET

Example response for Check Status

{
"DocumentResults": [
{
"Href": "https://apina11.springcm.com/v2/documents/b11b6fc3-xxxx-xxxx-xxxx-3863bb335c14"
}
],
"FolderResults": [],
"FailedDocuments": [],
"FailedFolders": [],
"Status": "Success",
"Href": "https://apina11.springcm.com/v2/copytasks/95a91709-xxxx-xxxx-xxxx-11e18fd81b19"
}

Document generation tasks

Many task operations create a new document. For these tasks, you can handle the resulting document in one of the following ways:

  • To save the document in CLM, specify a DestinationFolder in your request object.
  • Alternatively, some tasks allow you to create a temporary file that you can download, without saving it in CLM. To do this, omit the DestinationFolder. To determine which tasks allow you to create this temporary file, see the API reference.

The following examples of document generation tasks demonstrate the first option, in which you specify a DestinationFolder to save the resulting document in CLM.

Merging PDFs: Example request to Initiate Merge

Headers: Accept: 'application/json'

URI: https://apina11.springcm.com/v2/documentmergetasks

Method: POST

JSON:

{
"DocumentsToMerge": [
{
"Href": "https://apiqana11.springcm.com/v2/documents/ac0de547-xxxx-xxxx-xxxx-3863bb335c14"
},
{
"Href": "https://apiqana11.springcm.com/v2/documents/b11b6fc3-xxxx-xxxx-xxxx-3863bb335c14"
}
],
"DeleteOriginals": true,
"DestinationFolder": {
"Href": "https://apiqana11.springcm.com/v2/folders/16caaf38-xxxx-xxxx-xxxx-001cc448da6a"
},
"DestinationDocumentName": "Final Contract.pdf"
}

Merging PDFs: Example response to Initiate Merge request

{
"Status": "Processing",
"Href": "https://apina11.springcm.com/v2/documentmergetasks/e4b9ddcf-xxxx-xxxx-xxxx-687fa2c2f6f1"
}

Merge Document Tasks - Check Status - Sample Request

Headers: Accept: 'application/json'

URI: https://apina11.springcm.com/v2/documentmergetasks/e4b9ddcf-xxxx-xxxx-xxxx-687fa2c2f6f1

Method: GET

Merge Document Tasks - Check Status - Sample Response

{
"ResultDocument": {
"Name": "Final Contract.pdf",
"CreatedDate": "2015-05-03T23:00:34.003Z",
"CreatedBy": "klitwin@springcm.com",
"UpdatedDate": "2015-05-03T23:00:34.003Z",
"UpdatedBy": "klitwin@springcm.com",
"Description": "",
"ParentFolder": {
"Href": "https://apina11.springcm.com/v2/folders/16caaf38-xxxx-xxxx-xxxx-001cc448da6a"
},
"HistoryItems": {
"Href": "https://apina11.springcm.com/v2/documents/88ffac33-xxxx-xxxx-xxxx-3863bb335c14/historyitems"
},
"AccessLevel": {
"See": true,
"Read": true,
"Write": true,
"Move": true,
"Create": true,
"SetAccess": true
},
"PageCount": 2,
"Lock": {
"Href": "https://apina11.springcm.com/v2/documents/88ffac33-xxxx-xxxx-xxxx-3863bb335c14/lock"
},
"PreviewUrl": "https://na11.springcm.com/atlas/documents/preview.aspx?aid=6410&lduid=88ffac33-xxxx-xxxx-xxxx-3863bb335c14",
"Versions": {
"Href": "https://apina11.springcm.com/v2/documents/88ffac33-xxxx-xxxx-xxxx-3863bb335c14/versions"
},
"ShareLinks": {
"Href": "https://apina11.springcm.com/v2/documents/88ffac33-xxxx-xxxx-xxxx-3863bb335c14/sharelinks"
},
"DocumentProcessTrackingActivities": {
"Href": "https://apina11.springcm.com/v2/documents/88ffac33-xxxx-xxxx-xxxx-3863bb335c14/documentprocesstrackingactivities"
},
"DocumentReminders": {
"Href": "https://apina11.springcm.com/v2/documents/88ffac33-xxxx-xxxx-xxxx-3863bb335c14/documentreminders"
},
"DownloadDocumentHref": "https://apidownloadna11.springcm.com/v2/documents/88ffac33-xxxx-xxxx-xxxx-3863bb335c14",
"Href": "https://apina11.springcm.com/v2/documents/88ffac33-xxxx-xxxx-xxxx-3863bb335c14"
},
"Status": "Success",
"Href": "https://apina11.springcm.com/v2/documentmergetasks/e4b9ddcf-xxxx-xxxx-xxxx-687fa2c2f6f1"
}

Next steps

See the API reference for a list of tasks and the methods you can use with them.