CompleteTask API

Marks a workflow task as completed. If a comment string is provided it is saved to the task before the status change. After the task is marked complete, the workflow engine automatically evaluates whether the step is finished and advances the workflow to the next step if all tasks in the current step are done.

All task requirements (e.g. Approval, Sign, ISOReview) configured on the task definition must be satisfied before the task can be completed. Use TestTaskCompletion to check readiness without changing status.

Endpoint

/srv.asmx/CompleteTask

Methods

Parameters

Parameter Type Required Description
authenticationTicket string Yes Authentication ticket obtained from AuthenticateUser.
taskId integer Yes The ID of the task to complete. Task IDs are returned by getTasks and GetTask.
comments string No Optional completion comment from the assignee. Pass an empty string if no comment is needed. The first 255 characters are stored in the database; the full text is also stored in the document warehouse.

Response

Success Response

<root success="true" />

Error Response

<root success="false" error="[901] Session expired or Invalid ticket" />

Required Permissions

The calling user must be the task assignee. Only the assigned user can complete a task. Supervisors and administrators cannot complete tasks on behalf of the assignee through this API (use ReassignTask to transfer ownership first).

Example

GET Request

GET /srv.asmx/CompleteTask
    ?authenticationTicket=3f7a1b2c-4d5e-6f7a-8b9c-0d1e2f3a4b5c
    &taskId=8821
    &comments=Document+reviewed+and+approved.
HTTP/1.1
Host: yourserver

POST Request

POST /srv.asmx/CompleteTask HTTP/1.1
Host: yourserver
Content-Type: application/x-www-form-urlencoded

authenticationTicket=3f7a1b2c-4d5e-6f7a-8b9c-0d1e2f3a4b5c&taskId=8821&comments=Document+reviewed+and+approved.

Success Response

<root success="true" />

Notes

Error Codes

Error Description
[900] Authentication failed — invalid credentials.
[901] Session expired or invalid authentication ticket.
Task not found No task with the given taskId exists or the user does not have access to it.
Access denied The calling user is not the task assignee.
Task not started The task is in NotStarted status — it must be started (InProgress) before it can be completed.
Task already completed The task has already been marked as completed.
Task dropped The task has been dropped and can no longer be completed.
Task reassigned The task has been reassigned to another user and can no longer be completed by the original assignee.
Requirements not met One or more task requirements (e.g. Approval, Sign, ISOReview) have not been fulfilled.
Document offline The document associated with the task is in Offline/archived state.