get https://amojo.kommo.com/v2/origin/custom//chats//history
The method allows you to get a list of messages in a specific chat.
Please be aware that you won't be able to execute this step described above directly in the API Reference section due to tool limitations: it is not possible to calculate required headers and send a request simultaneously.
Headers & Authorization type
Parameter | Data type | Description |
---|---|---|
Date | string | Date and time when the request was generated. The signature will be valid for 15 minutes from this Date. The date should be in the format “Thu, 01 Jan 2023 12:00:00 +0000” (RFC2822) |
Content-type | string | Request data type. Currently, only application/json is supported. |
Content-MD5 | string | For the request body, it is necessary to calculate the MD5 hash and indicate it in the header in lowercase. At the same time, it is important to keep in mind that the request body is calculated as a stream of bytes without considering the end of JSON markup, and if there are \n or spaces at the end, they will also be taken into account. For GET requests, MD5 must also be calculated. Even if nothing is passed in the request body, MD5 will be obtained from an empty string. |
X-Signature | string | Signature of the request as a string. It is formed from the name of the method (GET/POST) in uppercase, with the values of the headers concatenated by \n . Header values come in a specific order. If there is no header, an empty string is specified instead. Next, add the requested path from the URL without the protocol and domain (without GET parameters) to the line. The resulting string is calculated using HMAC-SHA1, and as a secret, we use the channel secret obtained during registration. The resulting hash in lowercase is indicated in the X-Signature header. |
🛸
Calculate headers for Chats API requests
Open Recipe
Data type header when the request is successful/in case of an error
Content-Type: application/json
Response parameters
Parameter | Data type | Description |
---|---|---|
timestamp | int | Timestamp when the message was sent |
msec_timestamp | int | Timestamp when the message was sent in milliseconds |
sender[id] | string | Sender ID of the message in the Chats API |
sender[name] | string | Sender name of the message in the Chats API |
sender[client_id] | string | Message sender ID on the integration side |
sender[avatar] | string | Sender’s avatar, if it was passed during creation |
sender[phone] | string | Sender’s phone number, if it was given during creation |
sender[email] | string | Sender, if it was sent during creation |
receiver[id] | string | Recipient ID of the message in the Chats API |
receiver[name] | string | Recipient name of the message in the Chats API |
receiver[client_id] | string | Message recipient ID on the integration side |
receiver[avatar] | string | Link to the recipient’s avatar, if it was passed during creation |
receiver[phone] | string | Recipient’s phone number, if it was given during creation |
receiver[email] | string | Email of the recipient, if it was sent during creation |
message[id] | string | Chat ID on the Chat API side |
message[client_id] | string | Chat ID on the integration side |
message[type] | string | Message type |
message[text] | string | Message text |
message[media] | string | Link to the media file |
message[thumbnail] | string | Link to media thumbnail |
message[file_name] | string | The name of the file from the “media” field. |
message[file_size] | string | The size of the file from the “media” field |
message[media_group_id] | string | ID of the media group. If the user sends a single message with multiple attachments, we will split the message into several, but the media files will be combined into one group. |