Saltar al contendio prinicipal

Company

Advertencia

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 /companies

Endpoint URL

https://www.cotalker.com/api/v1/companies

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
populateFills 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.stringOptionalSyntax 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

ParameterDescriptionTypeRequiredNotes
idThe ObjectId of the company that is to be returned.ObjectId<COTCompany>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

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

ParameterDescriptionTypeRequiredNotes
idThe ObjectId of the company that is to be modified.ObjectId<COTCompany>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 the job title.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 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"
}