post https://amojo.kommo.com/v2/origin/custom///delivery_status
The method allows you to update the delivery status of a specific message.
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. |
You should write the body in your request exactly the same as written when calculating the headers.
Message status
Status | When status should be used | Enum status value |
---|---|---|
Sent | The message was sent from Kommo | - |
Delivered | The message was delivered to destination | 1 |
Read | Message was read by recipient | 2 |
Error | Message was not delivered | -1 |
Error codes
Error code | When should the code be sent? |
---|---|
901 | The user has deleted the message |
902 | Integration disabled on channel side |
903 | Internal server error |
904 | Unable to create a conversation (For example, the user is not registered in WhatsApp) |
905 | Any other error (you must send the error text) |
Data type header when the request is successful/in case of an error
Content-Type: application/json
Examples of request body
Change message delivery status to Read
{
"msgid": "XXXXXX-2aa3-464c-b6e4-4386d0f8f3ca",
"delivery_status": 2
}
Change message delivery status to Error
{
"msgid": "3419eef6-2aa3-464c-b6e4-4386d0f8f3ca",
"delivery_status": -1,
"error_code": 905,
"error": "An unknown error occurred"
}