Company
Esta página aún no se encuentra traducida al español.
Overview
A company, as an object, encompasses and unites all the data, activity, and users in an organization's Cotalker Platform. Through the /companies
endpoint, you can configure the company's basic configurations.
Users only have access to the company they are associated with.
Get a Company
Returns the data of the company the user is associated with.
GET /companiesEndpoint URL
https://www.cotalker.com/api/v1/companies
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 |
---|---|---|---|---|
populate | Fills the indicated fields containing ObjectIds with the data model they represent, e.g., the admin field would be filled with the COTUser it represents. This query parameter accepts a comma-separated field string. | string | Optional | Syntax example: GET /companies?populate=admin, help, conversationGroup |
Request Sample
curl --location --request GET 'https://www.cotalker.com/api/v1/companies' \
--header 'Authorization: Bearer $ACCESS_TOKEN'
Response Sample
The response follows the COTCompany data model.
Get a Company by Id
Returns the company indicated by the Id.
GET /companies/{id}Endpoint URL
https://www.cotalker.com/api/v1/companies/{id}
Path Parameters
Parameter | Description | Type | Required | Notes |
---|---|---|---|---|
id | The ObjectId of the company that is to be returned. | ObjectId<COTCompany> | Required |
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 |
Request Sample
curl --location --request GET 'https://www.cotalker.com/api/v1/companies/61976ce4a1f102deb014a0c3' \
--header 'Authorization: Bearer $ACCESS_TOKEN'
Response Sample
The response follows the COTCompany data model.
Update a Company
Updates or edits an existing company's settings.
PATCH /companies/{id}Endpoint URL
https://www.cotalker.com/api/v1/companies/{id}
Path Parameters
Parameter | Description | Type | Required | Notes |
---|---|---|---|---|
id | The ObjectId of the company that is to be modified. | ObjectId<COTCompany> | Required |
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 |
Admin | Grants administrative access to modify the job title. | Required | true |
Content-Type | Sets the body's format. | Required | application/json |
Query Parameters
Parameter | Description | Type | Required | Notes |
---|---|---|---|---|
debug | Adds the debug field with error notifications. | string | Optional | Option: 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 COTCompany data model.
Request Sample
curl --location --request PATCH 'https://staging.cotalker.com/api/v1/companies/600ac7d8df5461626aac89c0' \
--header 'Authorization: Bearer $ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"defaultCountry": "US",
"defaultLanguage": "en"
}'
Response Sample
Go to COTCompany for a complete description of the response.
{
"__v" : 14,
"_id" : "6136968b580aaf2b0e49d844",
"admin" : [
"6136969432d0379f7490cdf3"
],
"appContacts" : true,
"contactMode" : "default",
"conversationGroup": "6197b98d6b60e7b6db7a61cf",
"createdAt" : "2018-10-19T15:06:35.726Z",
"defaultCountry" : "US",
"defaultLanguage" : "en",
"displayName" : "ACME",
"emailDomains" : [
"company.com"
],
"help" : "6136969de063469044d87926",
"hideSummary": false,
"isActive" : true,
"legalName" : "ACME INC.",
"legalIdentifierCode": "EIN",
"legalIdentifier": "123-45-6789",
"modifiedAt" : "2021-08-20T19:35:11.648Z",
"offline" : {
"isActive" : false,
"maxSyncTimeMs" : 0
},
"permissions" : {
"receiveNotifications" : true,
"readLocation" : true,
"showTos" : {
"value" : true
}
},
"subdomain" : "acme",
"system" : "613696a4a43cf12cb25c7de5"
}