Skip to content

Tasklist APIs

Introduction

Tasklist API is a REST API and provides searching, getting, and changing Tasklist data. Requests and responses are in JSON notation.

API documentation as Swagger

A detailed API description is also available as Swagger UI. Refer here to get the reference of Swagger UI.


Host URL for Optima Gateway environments will be as given below:

Environment {host-url}
Dev optima-dev.optumrx.com
Stage optima-stage.optumrx.com
Prod optima-prod.optumrx.com

Endpoints

Search Tasks

This API is used to list the tasks that satisfy search request parameters.

POST - https://{host-url}/gateway/tasklist/tasks/search

Note

Do not pass empty JSON Request Body. pageSize is required field to pass in the body => "pageSize": 10.

Request Body:

{
  "state": "string",
  "assigned": true,
  "assignee": "string",
  "taskDefinitionId": "string",
  "candidateGroup": "string",
  "candidateUser": "string",
  "processDefinitionKey": "string",
  "pageSize": 0,
  "processInstanceKey": "string",
  "followUpDate": {
    "from": "string",
    "to": "string"
  },
  "dueDate": {
    "from": "string",
    "to": "string"
  },
  "sort": [
    {
      "field": "string",
      "order": "string"
    }
  ],
  "searchAfter": [
    "string"
  ],
  "searchAfterOrEqual": [
    "string"
  ],
  "searchBefore": [
    "string"
  ],
  "searchBeforeOrEqual": [
    "string"
  ]
}

Note

Only one of [searchAfter, searchAfterOrEqual, searchBefore, searchBeforeOrEqual] search options must be present at once in the request.

Note

Sample example to apply filter in search request body which returns tasks with only CREATED state => "state": "CREATED".

Response:

[
  {
    "id": "string",
    "name": "string",
    "taskDefinitionId": "string",
    "processName": "string",
    "creationDate": "string",
    "completionDate": "string",
    "assignee": "string",
    "taskState": "string",
    "sortValues": [
      "string"
    ],
    "isFirst": true,
    "formKey": "string",
    "processDefinitionKey": "string",
    "processInstanceKey": "string",
    "dueDate": "string",
    "followUpDate": "string",
    "candidateGroups": [
      "string"
    ],
    "candidateUsers": [
      "string"
    ]
  }
]

Get a Task

This API is used to retrieve the details of a specific task by taskId.

GET - https://{host-url}/gateway/tasklist/tasks/{taskId}

Provide the taskId in the query, which you received from the Search Tasks API Response of Tasklist Module.

Response:

{
  "id": "string",
  "name": "string",
  "taskDefinitionId": "string",
  "processName": "string",
  "creationDate": "string",
  "completionDate": "string",
  "assignee": "string",
  "taskState": "string",
  "formKey": "string",
  "processDefinitionKey": "string",
  "processInstanceKey": "string",
  "dueDate": "string",
  "followUpDate": "string",
  "candidateGroups": [
    "string"
  ],
  "candidateUsers": [
    "string"
  ]
}

Assign/Claim a Task

This API is used to assign or claim a specific task by taskId to assignee.

PATCH - https://{host-url}/gateway/tasklist/tasks/{taskId}/assign

Provide the taskId in the query, which you received from the Search Tasks or Get Task API Response of Tasklist Module.

Request Body:

{
  "assignee": "string",
  "allowOverrideAssignment": true
}

Response:

{
  "id": "string",
  "name": "string",
  "taskDefinitionId": "string",
  "processName": "string",
  "creationDate": "string",
  "completionDate": "string",
  "assignee": "string",
  "taskState": "string",
  "formKey": "string",
  "processDefinitionKey": "string",
  "processInstanceKey": "string",
  "dueDate": "string",
  "followUpDate": "string",
  "candidateGroups": [
    "string"
  ],
  "candidateUsers": [
    "string"
  ]
}

Unassign/Unclaim a Task

This API is used to unassign or unclaim a specific task by taskId.

PATCH - https://{host-url}/gateway/tasklist/tasks/{taskId}/unassign

Provide the taskId in the query, which you received from the Search Tasks or Get Task API Response of Tasklist Module.

Response:

{
  "id": "string",
  "name": "string",
  "taskDefinitionId": "string",
  "processName": "string",
  "creationDate": "string",
  "completionDate": "string",
  "assignee": "string",
  "taskState": "string",
  "formKey": "string",
  "processDefinitionKey": "string",
  "processInstanceKey": "string",
  "dueDate": "string",
  "followUpDate": "string",
  "candidateGroups": [
    "string"
  ],
  "candidateUsers": [
    "string"
  ]
}

Complete a Task

This API is used to complete a specific task by taskId, along-with optional variables.

PATCH - https://{host-url}/gateway/tasklist/tasks/{taskId}/complete

Provide the taskId in the query, which you received from the Search Tasks or Get Task API Response of Tasklist Module.

Request Body:

{
  "variables": [
    {
      "name": "string",
      "value": "string"
    }
  ]
}

Example Request Body with various data types of values such as String, Number or JSON:

{
  "variables": [
    {
      "name": "FULL_NAME",
      "value": {
        "FIRST_NAME": "first_name",
        "LAST_NAME": "last_name"
      }
    },
    {
      "name": "GENDER",
      "value": "\"Male\""
    },
    {
      "name": "AGE",
      "value": 20
    }
  ]
}

Response:

{
  "id": "string",
  "name": "string",
  "taskDefinitionId": "string",
  "processName": "string",
  "creationDate": "string",
  "completionDate": "string",
  "assignee": "string",
  "taskState": "string",
  "formKey": "string",
  "processDefinitionKey": "string",
  "processInstanceKey": "string",
  "dueDate": "string",
  "followUpDate": "string",
  "candidateGroups": [
    "string"
  ],
  "candidateUsers": [
    "string"
  ]
}

Search Variables of a Task

This API is used to list all or some of the variables of a specific task by taskId.

POST - https://{host-url}/gateway/tasklist/tasks/{taskId}/variables/search

Provide the taskId in the query, which you received from the Search Tasks or Get Task API Response of Tasklist Module.

Request Body:

{
  "variableNames": [
    "string"
  ]
}

Example Request Body where all the variables are required:

{
  "variableNames": []
}

Example Request Body where only varA and varB are required:

{
  "variableNames": ["varA", "varB"]
}

Response:

[
  {
    "id": "string",
    "name": "string",
    "value": "string",
    "isValueTruncated": true,
    "previewValue": "string"
  }
]

Get Variable Details

This API is used to get details of a specific variable by variableId.

GET - https://{host-url}/gateway/tasklist/variables/{variableId}

Provide the variableId in the query, which you received from the Search Task Variables API Response of Tasklist Module.

Response:

{
  "id": "string",
  "name": "string",
  "value": "string",
  "isValueTruncated": true,
  "previewValue": "string"
}

Get Form Details

This API is used to get details of a specific form by formId and processDefinitionKey.

GET - https://{host-url}/gateway/tasklist/forms/{formId}?processDefinitionKey={processDefinitionKey}

Provide the formId and processDefinitionKey in the query parameter, which you received from the Search Tasks or Get Task API Response of Tasklist Module.

Response:

{
  "id": "string",
  "processDefinitionKey": "string",
  "schema": "string"
}