Saltar al contendio prinicipal

Tasks (v2)

Advertencia

Esta página aún no se encuentra traducida al español.

Version 2
  • Version 2 endpoints provide a more comprehensive path structure than version 1.
  • Some task-related API requests should still be done using version 1 endpoints: /v1/tasks.

Overview

A task is the representation of an asset and its state. In other words, a task is created within a workflow group and can follow a workflow process, passing from one state to another.

A Task group contains the tasks that are processed through a specific workflow group. The terms task groups and workflow groups are sometimes used synonymously. Users can access task groups through either the task or group view.

additional resources

Get Task Groups

Lists the task groups in the company.

GET /tasks-groups/

Endpoint URL

https://www.cotalker.com/api/v2/task-groups

Headers

HeaderDescriptionRequiredValues
AuthorizationSends your access token to make an API request.
Click here to see how to obtain an access token.
RequiredBearer $ACCESS_TOKEN

Query Parameters

ParameterDescriptionTypeRequiredNotes
countAdds the counter field which returns the total amount of task groups.booleanOptional
createdAtReturns task groups created on the specified date and time.ISODateOptional
createdAt_gteReturns task groups created on or after the specified date and time.ISODateOptional
createdAt_lteReturns task groups created on or before the specified date and time.ISODateOptional
createdAt_gtReturns task groups created after the specified date and time.ISODateOptional
createdAt_ltReturns task groups created before the specified date and time.ISODateOptional
groupIdsReturns task groups according to the COTGroup they are associated with.ObjectId<COTGroup>Optional
idsReturns task group with the specified ObjectIdCOTTaskGroupOptional
isActiveReturns task groups that are active according to their isActive field.stringOptionalall, true, false
limitLimits the amount of task groups that are returned in the response.numberOptionalBy default, the limit is set to 10.
modifiedAtReturns tasks groups modified on the indicated date.ISODateOptional
modifiedAt_gteReturns task groups modified on or after the specified date and time.ISODateOptional
modifiedAt_lteReturns task groups modified on or before the specified date and time.ISODateOptional
modifiedAt_gtReturns task groups modified after the specified date and time.ISODateOptional
modifiedAt_ltReturns task groups modified befoire the specified date and time.ISODateOptional
orderByOrders task groups by ascending or descending order according to the value of the sortBy field.stringOptionalOptions: asc, desc
pageMakes the response display data from the indicated page number.numberOptional
sortBySorts tasks groups by the indicated value.stringOptionalOptions:
createdAt, modifiedAt, collectionName

Request Sample

curl --location --request GET 'https://www.cotalker.com/api/v2/task-groups' \
--header 'Authorization: Bearer $ACCESS_TOKEN'

Response Sample

Responses follow the COTTaskGroup data model.


Get Task Group by Id

Returns the inidicated task group.

GET /task-groups/{taskGroupId}

Endpoint URL

https://www.cotalker.com/api/v2/task-groups/{taskGroupId}

Path Parameters

ParameterDescriptionTypeRequiredNotes
taskGroupIdThe ObjectId of the task group that is to be returned.ObjectId<COTTaskGroup>Required

Headers

HeaderDescriptionRequiredValues
AdminGives administrative access to the endpoint.Requiredtrue
AuthorizationSends your access token to make an API request.
Click here to see how to obtain an access token.
RequiredBearer $ACCESS_TOKEN

Request Sample

curl --location --request GET 'https://www.cotalker.com/api/v2/task-groups/62bf5e03654e96017e00e46a' \
--header 'Admin: true' \
--header 'Authorization: Bearer $ACCESS_TOKEN'

Response Sample

The response follows the COTTaskGroup data model.


Create New Task Group

Create a new task group.

POST /task-groups

Endpoint URL

https://www.cotalker.com/api/v2/task-groups

Headers

HeaderDescriptionRequiredValues
AdminGives administrative access to the endpoint.Requiredtrue
AuthorizationSends your access token to make an API request.
Click here to see how to obtain an access token.
RequiredBearer $ACCESS_TOKEN
Content-TypeIndicates the body's format.Requiredapplication/json

Request Body

Only required fields are listed below. For a complete schema description, please go to the COTTaskGroup data model. Unrequired fields that are not submitted are either filled in automatically or left blank.

ElementDescriptionTypeRequiredNotes
groupIndicates the workflow group associated with the task group.ObjectId<COTGroup>RequiredThe group must be exclusively assigned to the task group.

Request Sample

curl --location --request POST 'https://www.cotalker.com/api/v2/task-groups' \
--header 'Admin: true' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $ACCESS_TOKEN' \
--data-raw '{
"group": "61ae5eb11f130a35a73e2e06"
}'

Response Sample

Go to COTTaskGroup for a complete description of the response.

{
"isActive": true,
"readonly": false,
"taskEditorPermissions": [],
"taskFollowerPermissions": [],
"writePermissions": [],
"readPermissions": [],
"flowType": "free",
"hideClosedAfterDays": 30,
"defaultView": "list",
"levelConfig": [
20,
20,
10
],
"availableViews": [
"list"
],
"_id": "61ae5f2ebb6c6f1869625b90",
"group": "61ae5eb11f130a35a73e2e06",
"company": "613eafd572343ecb53cc8ccc",
"createdAt": "2021-12-06T19:03:39.932Z",
"taskPropertyPermissions": [],
"collectionName": "task_manager",
"modifiedAt": "2021-12-06T19:03:39.943Z",
"__v": 0
}

Get Tasks within a Task Group

Returns tasks the user can view within the specified task group.

GET /task-groups/{taskGroupId}/tasks

Endpoint URL

https://www.cotalker.com/api/v2/task-groups/{taskGroupId}/tasks

Path Parameters

ParameterDescriptionTypeRequiredNotes
taskGroupIdThe ObjectId of the task group that is to be searched through.ObjectId<COTTaskGroup>Required

Headers

HeaderDescriptionRequiredValues
AdminGrants a wider range of available tasks.Optionaltrue
AuthorizationSends your access token to make an API request.
Click here to see how to obtain an access token.
RequiredBearer $ACCESS_TOKEN

Query Parameters

ParameterDescriptionTypeRequiredNotes
countWhen activated, returns the count field with the number of tasks returned by the request.booleanOptional
createdAtReturns tasks created on the indicated date.ISODateOptional
createdAt_gteReturns tasks created on or after the indicated date.ISODateOptional
createdAt_lteReturns tasks created on or before the indicated date.ISODateOptional
createdAt_gtReturns tasks created after the indicated date.ISODateOptional
createdAt_ltReturns tasks created before the indicated date.ISODateOptional
isActiveReturns either active or deactivated tasks.booleanOptionalIn the COTTask data model, the isActive field indicates the task's active status.
limitLimits the number of _tasks__ that are returned per response page.numberOptionalBy default, the limit is set to 10.
modifiedAtReturns tasks modified on the indicated date.ISODateOptional
modifiedAt_gteReturns tasks modified on or after the indicated date.ISODateOptional
modifiedAt_lteReturns tasks modified on or before the indicated date.ISODateOptional
modifiedAt_gtReturns tasks modified after the indicated date.ISODateOptional
modifiedAt_ltReturns tasks modified before the indicated date.ISODateOptional
orderByReturns results in ascending or descending order.stringOptionalOptions: asc or desc.
pageDisplays data from the indicated page number.numberOptionalBest used in combination with the "limit" parameter.
sortBySorts results by indicated attribute.OptionalOnly name attribute currently available.

Request Sample

curl --location --request GET 'https://www.cotalker.com/api/v2/tasks/61a8b233685ed3562e7cfdeb/task' \
--header 'Authorization: Bearer $ACCESS_TOKEN'

Response Sample

The response follows the COTTask data model.


Get Tasks by Relations

Returns tasks related by the indicated parameters.

GET /task-groups/{taskGroupId}/tasks/relations

Endpoint URL

https://www.cotalker.com/api/v2/task-groups/{taskGroupId}/tasks/relations

Path Parameters

ParameterDescriptionTypeRequiredNotes
taskGroupIdThe ObjectId of the task group that is to be searched through.ObjectId<COTTaskGroup>Required

Headers

HeaderDescriptionRequiredValues
AdminGives administrative access to the endpoint.Requiredtrue
AuthorizationSends your access token to make an API request.
Click here to see how to obtain an access token.
RequiredBearer $ACCESS_TOKEN

Query Parameters

ParameterDescriptionTypeRequiredNotes
assigneeReturns tasks assigned to the specified user.ObjectId<COTUser>Optional
countWhen activated, returns the count field with the number of tasks returned by the request.booleanOptional
isActiveReturns either active or deactivated tasks.booleanOptionalIn the COTTask data model, the isActive field indicates the task's active status.
limitLimits the number of _tasks__ that are returned per response page.numberOptionalBy default, the limit is set to 10.
orderByReturns results in ascending or descending order.stringOptionalOptions: asc or desc.
pageDisplays data from the indicated page number.numberOptionalBest used in combination with the "limit" parameter.
propertyReturns tasks associated with the indicated property (element).ObjectId,<COTProperty>Optional
sortBySorts results by indicated attribute.OptionalOnly name attribute currently available.

Request Sample

curl --location --request GET 'https://www.cotalker.com/api/v2/task-groups/61a8b233685ed3562e7cfdeb/tasks/relations' \
--header 'Admin: true' \
--header 'Authorization: Bearer $ACCESS_TOKEN'

Response Sample

The response follows the COTTask data model.