Tasks (v2)
Esta página aún no se encuentra traducida al español.
- 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.
- These are just some of the most basic API requests. For a complete list of endpoints, consult our API documentation on Swagger.
Get Task Groups
Lists the task groups in the company.
GET /tasks-groups/Endpoint URL
https://www.cotalker.com/api/v2/task-groups
Headers
Header | Description | Required | Values |
---|---|---|---|
Authorization | Sends your access token to make an API request. Click here to see how to obtain an access token. | Required | Bearer $ACCESS_TOKEN |
Query Parameters
Parameter | Description | Type | Required | Notes |
---|---|---|---|---|
count | Adds the counter field which returns the total amount of task groups. | boolean | Optional | |
createdAt | Returns task groups created on the specified date and time. | ISODate | Optional | |
createdAt_gte | Returns task groups created on or after the specified date and time. | ISODate | Optional | |
createdAt_lte | Returns task groups created on or before the specified date and time. | ISODate | Optional | |
createdAt_gt | Returns task groups created after the specified date and time. | ISODate | Optional | |
createdAt_lt | Returns task groups created before the specified date and time. | ISODate | Optional | |
groupIds | Returns task groups according to the COTGroup they are associated with. | ObjectId<COTGroup> | Optional | |
ids | Returns task group with the specified ObjectId | COTTaskGroup | Optional | |
isActive | Returns task groups that are active according to their isActive field. | string | Optional | all , true , false |
limit | Limits the amount of task groups that are returned in the response. | number | Optional | By default, the limit is set to 10. |
modifiedAt | Returns tasks groups modified on the indicated date. | ISODate | Optional | |
modifiedAt_gte | Returns task groups modified on or after the specified date and time. | ISODate | Optional | |
modifiedAt_lte | Returns task groups modified on or before the specified date and time. | ISODate | Optional | |
modifiedAt_gt | Returns task groups modified after the specified date and time. | ISODate | Optional | |
modifiedAt_lt | Returns task groups modified befoire the specified date and time. | ISODate | Optional | |
orderBy | Orders task groups by ascending or descending order according to the value of the sortBy field. | string | Optional | Options: asc , desc |
page | Makes the response display data from the indicated page number. | number | Optional | |
sortBy | Sorts tasks groups by the indicated value. | string | Optional | Options: 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
Parameter | Description | Type | Required | Notes |
---|---|---|---|---|
taskGroupId | The ObjectId of the task group that is to be returned. | ObjectId<COTTaskGroup> | Required |
Headers
Header | Description | Required | Values |
---|---|---|---|
Admin | Gives administrative access to the endpoint. | Required | true |
Authorization | Sends your access token to make an API request. Click here to see how to obtain an access token. | Required | Bearer $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-groupsEndpoint URL
https://www.cotalker.com/api/v2/task-groups
Headers
Header | Description | Required | Values |
---|---|---|---|
Admin | Gives administrative access to the endpoint. | Required | true |
Authorization | Sends your access token to make an API request. Click here to see how to obtain an access token. | Required | Bearer $ACCESS_TOKEN |
Content-Type | Indicates the body's format. | Required | application/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.
Element | Description | Type | Required | Notes |
---|---|---|---|---|
group | Indicates the workflow group associated with the task group. | ObjectId<COTGroup> | Required | The 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}/tasksEndpoint URL
https://www.cotalker.com/api/v2/task-groups/{taskGroupId}/tasks
Path Parameters
Parameter | Description | Type | Required | Notes |
---|---|---|---|---|
taskGroupId | The ObjectId of the task group that is to be searched through. | ObjectId<COTTaskGroup> | Required |
Headers
Header | Description | Required | Values |
---|---|---|---|
Admin | Grants a wider range of available tasks. | Optional | true |
Authorization | Sends your access token to make an API request. Click here to see how to obtain an access token. | Required | Bearer $ACCESS_TOKEN |
Query Parameters
Parameter | Description | Type | Required | Notes |
---|---|---|---|---|
count | When activated, returns the count field with the number of tasks returned by the request. | boolean | Optional | |
createdAt | Returns tasks created on the indicated date. | ISODate | Optional | |
createdAt_gte | Returns tasks created on or after the indicated date. | ISODate | Optional | |
createdAt_lte | Returns tasks created on or before the indicated date. | ISODate | Optional | |
createdAt_gt | Returns tasks created after the indicated date. | ISODate | Optional | |
createdAt_lt | Returns tasks created before the indicated date. | ISODate | Optional | |
isActive | Returns either active or deactivated tasks. | boolean | Optional | In the COTTask data model, the isActive field indicates the task's active status. |
limit | Limits the number of _tasks__ that are returned per response page. | number | Optional | By default, the limit is set to 10. |
modifiedAt | Returns tasks modified on the indicated date. | ISODate | Optional | |
modifiedAt_gte | Returns tasks modified on or after the indicated date. | ISODate | Optional | |
modifiedAt_lte | Returns tasks modified on or before the indicated date. | ISODate | Optional | |
modifiedAt_gt | Returns tasks modified after the indicated date. | ISODate | Optional | |
modifiedAt_lt | Returns tasks modified before the indicated date. | ISODate | Optional | |
orderBy | Returns results in ascending or descending order. | string | Optional | Options: asc or desc . |
page | Displays data from the indicated page number. | number | Optional | Best used in combination with the "limit" parameter. |
sortBy | Sorts results by indicated attribute. | Optional | Only 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/relationsEndpoint URL
https://www.cotalker.com/api/v2/task-groups/{taskGroupId}/tasks/relations
Path Parameters
Parameter | Description | Type | Required | Notes |
---|---|---|---|---|
taskGroupId | The ObjectId of the task group that is to be searched through. | ObjectId<COTTaskGroup> | Required |
Headers
Header | Description | Required | Values |
---|---|---|---|
Admin | Gives administrative access to the endpoint. | Required | true |
Authorization | Sends your access token to make an API request. Click here to see how to obtain an access token. | Required | Bearer $ACCESS_TOKEN |
Query Parameters
Parameter | Description | Type | Required | Notes |
---|---|---|---|---|
assignee | Returns tasks assigned to the specified user. | ObjectId<COTUser> | Optional | |
count | When activated, returns the count field with the number of tasks returned by the request. | boolean | Optional | |
isActive | Returns either active or deactivated tasks. | boolean | Optional | In the COTTask data model, the isActive field indicates the task's active status. |
limit | Limits the number of _tasks__ that are returned per response page. | number | Optional | By default, the limit is set to 10. |
orderBy | Returns results in ascending or descending order. | string | Optional | Options: asc or desc . |
page | Displays data from the indicated page number. | number | Optional | Best used in combination with the "limit" parameter. |
property | Returns tasks associated with the indicated property (element). | ObjectId,<COTProperty> | Optional | |
sortBy | Sorts results by indicated attribute. | Optional | Only 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.