Chat API account ID
In order to start working with the Chat API, we need to get the credentials from the Kommo account. In this part we will obtain the Kommo chat service ID for both the account and the user.
For the account
To work with the chat service, you need to acquire a unique account ID. It is different from the client ID.
It can be obtained in two ways:
- Using the request to the Kommo API
- From the front-end with the JS script
API request
You can get the chats id using our API
Method URL
GET /api/v4/account
Authorization type
OAuth 2.0 with Access Token. Review our Step-by-step Example.
Example of the request
GET https://subdomain.kommo.com/api/v4/account?with=amojo_id
GET parameter
Parameter | Value | Description |
---|---|---|
with | amojo_id | Requesting information about chat id |
Example of the response
{
"id": 30285908,
"name": "Test account",
"amojo_id": "52fd2a28-d2eb-4bd8-b862-b57934927b38",
}
Javascript
You can get the chat id for the account while developing the UI/UX part of your integration by typing
APP.constant('account').amojo_id
For the user
To import message history or add sent messages in a third-party application, you may need information about Kommo account users.
Or rather, their IDs in the Chat API since they differ from the ID used in other Kommo API methods.
It can be obtained in two ways:
- Using the request to the Kommo API
- From the front-end with the JS script
API request
You can get the chats id using our API
Method URL
GET https://subdomain.kommo.com/api/v4/users
Authorization type
OAuth 2.0 with Access Token. Review our Step-by-step Example.
Example of the request
GET https://subdomain.kommo.com/api/v4/users?with=amojo_id
GET parameter
Parameter | Value | Description |
---|---|---|
with | amojo_id | Requesting information about chat id |
Example of the response
{
"id": 8375357,
"name": "Lama",
"amojo_id": "b0bc49f0-ec21-4463-965f-1fe1d4cd5b89"
}
Javascript
You can get the chat id for the user while developing the UI/UX part of your integration by typing
APP.constant('user').amojo_id
Now it’s time to connect the chat channel!