Task API
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.
As the name implies the Task API exposes Docusign CLM services as tasks that can be executed and monitored programmatically. The Task API includes methods for document generation, document manipulation, advanced search and other long running document operations.
Using the Task API
Tasks are asynchronous and are invoked and monitored in the following way:
-
A POST request is made passing a Task object to the corresponding Task endpoint to initiate a task operation. There is a specific task object that corresponds to each task operation endpoint and the properties of the task objects will vary significantly depending on the operation being invoked. Generally, only a subset of the properties of a Task are required to invoke the operation.
-
A result object is returned for any Task initiation POST request. The result objects will vary based on the Task being invoked, however result objects have some commonalities:
-
An Href property that contains a URI that will uniquely identify the task invocation. A GET request can be made to this URI to get the status of the task operation and retrieve the results. For a longer running task, GETs to this URI can be periodically polled to get the current status and results of the task operation.
-
The Status parameter that indicates the state or result of the operation. Statuses for most tasks include: Processing, Success, and Failure. Some tasks may have specialized statuses, see the Task API documentation for more information.
-
Result properties that will vary based on the task.
-
Some tasks will allow the operation to be canceled. This is done via a DELETE request to the task URI.
Note: Although Docusign CLM’s 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 as opposed to the Task API.
Document search tasks
The examples to the right show an example request and response for an operation to find documents whose name contains “Contract”.
Copy document tasks
The examples to the right show sample requests and responses for initiating and checking the status of a copy document operation.
Document generation tasks
Many of the task operations will result in a new document being created. For these tasks, there are two options for how the resulting document is handled.
The examples to the right show sample requests and responses for initiating and checking the status of a merge document operation.