Saltar al contendio prinicipal

Channels

Advertencia

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

Overview

Channels are workspaces where users can get task information, change task states, submit surveys, summon bots, chat with other users, and share files.

Channels exist within either regular or workflow groups.

additional resources

These are just some of the most basic API requests. For a complete list of endpoints, consult our API documentation on Swagger.

Get Channels

Returns all channels within the company.

GET /channels

Endpoint URL

https://www.cotalker.com/api/v2/channels

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
searchReturns channels that match the keywords in the search field array.stringOptional
limitLimits the amount of channels returned in the response.numberOptionalBy default, the limit is set to 10.
pageMakes the response display data from the indicated page number.numberOptionalBest used in combination with the "limit" parameter.
countAdds the counter field with the total amount of channels within the company.booleanOptional
orderByOrders the channels by ascendeing or descending order according to their modifiedAt field.stringOptionalOptions: asc, desc
sortBySorts channels in the response according to the chosen field: nameCode, modifiedAt, or createdAt.stringOptionalDetails about the Channel Data Model
groupReturns all channels found within the indicated group.ObjectId<COTGroup>
isActiveReturns channels according to their isActive status.stringOptionalOptions are: all, true, false
userReturns channels in which the indicated user and the current user are found in.ObjectId<COTUser>Optional
userIsAdminReturns channels in which the indicated user is found in the groupOwnerIdsbooleanOptionalMust be used in conjunction with the user query parameter.
directChannelsReturns channels according to their isDirect field which indicates whether a channel represents direct messages between two users or not.stringOptionalOptions are: all, true, false.
modifiedReturns channels with the indicated modification date in the modifiedAt field.ISODateOptionalYYYY-MM-DDTHH:mm:ss.SSSZ
modified_gtReturns channels modified after the indicated date and time.ISODateOptionalYYYY-MM-DDTHH:mm:ss.SSSZ
modified_gteReturns channels with a value in the modifiedAt field equal to or greater than the indicated date and time.ISODateOptionalYYYY-MM-DDTHH:mm:ss.SSSZ
createdReturns channels with the indicated creation date in the createdAt field.ISODateOptionalYYYY-MM-DDTHH:mm:ss.SSSZ
created_gtReturns channels created after the indicated date and time.ISODateOptionalYYYY-MM-DDTHH:mm:ss.SSSZ
created_gteReturns channels with a value in the createdAt field equal to or greater than the indicated date and time.ISODateOptionalYYYY-MM-DDTHH:mm:ss.SSSZ
created_ltReturns channels created before the indicated date and time.ISODateOptionalYYYY-MM-DDTHH:mm:ss.SSSZ
created_lteReturns channels with a value in the createdAt field equal to or less than the indicated date and time.ISODateOptionalYYYY-MM-DDTHH:mm:ss.SSSZ
debugAdds the debug field with error notifications.stringOptionalOption: true

Request Samples

This default request gets all the channels in the company.

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

Response Sample

Responses follow the COTChannel data model.


Get a Channel by Id

Returns the channel indicated by the Id.

GET /channels/{id}

Endpoint URL

https://www.cotalker.com/api/v2/channels/{id}

Path Parameters

ParameterDescriptionTypeRequiredNotes
idThe ObjectId of the channel that is to be returned.ObjectId<COTChannel>Required

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
debugAdds the debug field with error notifications.stringOptionalOption: true

Request Sample

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

Response Sample

The response follows the COTChannel data model.


Create a New Channel

Creates a new channel within the company.

POST /channels

Endpoint URL

https://www.cotalker.com/api/v2/channels

Headers

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

Query Parameters

ParameterDescriptionTypeRequiredNotes
debugAdds the debug field with error notifications.stringOptionalOption: true

Request Body

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

ElementDescriptionTypeRequiredNotes
nameDisplayThe channel name users will see on the platform.stringRequired
nameCodeThe channel's unique identification name.stringRequiredMaximum 60 characters; only lowercase letters, numbers, and underscores allowed; must be unique.

Request Sample

Channel created with the minimum required fields:

curl --location --request POST 'https://www.cotalker.com/api/v2/channels' \
--header 'Admin: true' \
--header 'Authorization: Bearer $ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"nameDisplay": "Maintenance",
"nameCode": "maintenance_channel",
"group": "619b8b9f026233d770d7ef0a"
}'

Response Sample

Go to COTChannel for a complete description of the response.

{
"_id": "619b8cf2107bbec0876cddf2",
"settings": {
"write": "all"
},
"videoCall": {
"start": {
"any": false,
"permissions": []
},
"isActive": false,
"duration": [],
"publishVideo": [],
"publishAudio": []
},
"propertyIds": [],
"userIds": [],
"groupOwnerIds": [],
"isPrivate": true,
"isDirect": false,
"isActive": true,
"pinned": [],
"bots": [],
"search": [
"maintenance",
"channel",
"maintenancechannel"
],
"nameDisplay": "Maintenance",
"nameCode": "maintenance_channel",
"group": "619b8b9f026233d770d7ef0a",
"company": "6136968b580aaf2b0e49d844",
"createdAt": "2021-11-22T11:52:26.975Z",
"modifiedAt": "2021-11-22T11:52:26.977Z",
}

Update a Channel

Updates or edits an existing channel's information.

PATCH /channels/{id}

Endpoint URL

https://www.cotalker.com/api/v2/channels/{id}

Path Parameters

ParameterDescriptionTypeRequiredNotes
idThe ObjectId of the channel that is to be modified.ObjectId<COTChannel>Required

Headers

HeaderDescriptionRequiredValues
AuthorizationSends your access token to make an API request.
Click here to see how to obtain an access token.
RequiredBearer $ACCESS_TOKEN
AdminGrants administrative access to modify a channel.Requiredtrue
Content-TypeSets the body's format.Requiredapplication/json

Query Parameters

ParameterDescriptionTypeRequiredNotes
debugAdds the debug field with error notifications.stringOptionalOption: true

Request Body

Only the fields that are being updated or added are required to be put into the body. For a complete schema description, please go to the COTChannel data model.

Request Sample

Updating a channel's display name:

curl --location --request PATCH 'https://www.cotalker.com/api/v2/channels/619b8cf2107bbec0876cddf2?debug=true' \
--header 'Admin: true' \
--header 'Authorization: Bearer $ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"nameDisplay": "Maintenance Report"
}'

Response Sample

Go to COTChannel for a complete description of the response.

{
"_id": "619b8cf2107bbec0876cddf2",
"settings": {
"write": "all"
},
"videoCall": {
"start": {
"any": false,
"permissions": []
},
"isActive": false,
"duration": [],
"publishVideo": [],
"publishAudio": []
},
"propertyIds": [],
"userIds": [],
"groupOwnerIds": [],
"isPrivate": true,
"isDirect": false,
"isActive": true,
"pinned": [],
"bots": [],
"search": [
"maintenance",
"channel",
"maintenancechannel"
],
"nameDisplay": "Maintenance Report",
"nameCode": "maintenance_channel",
"group": "619b8b9f026233d770d7ef0a",
"company": "6136968b580aaf2b0e49d844",
"createdAt": "2021-11-22T11:52:26.975Z",
"modifiedAt": "2021-11-22T11:52:26.977Z",
}