The callback functions described in this article are only intended for SME.
Notifications about Changing Message Delivery Status
This method allows you to make a callback request that will send notification to your server about changing status of the message. The server address for callback requests can be defined in your profile in edna dashboard.
Request Endpoint
A POST request is made to the URL you specified during registration or in your personal account in the profile section. Only the HTTPS protocol must be used.
Request Format
The request body contains a JSON object with data about the message delivery (similar to the response body of the imOutMessage
request).
{ "imOutMessageId":"test-001", "dlvStatus":"read", "dlvStatusAt":"2020-01-10T19:03:52.355+0300", "dlvError": null, "rate":null, "reserveSms":null }
Request Parameters
Parameter | Type | Description |
imOutMessageId | string | Message ID |
dlvStatus | string | Message delivery status, refer to the Available status codes article for more details. |
dlvStatusAt | string | Time of recent status update. The time format is YYYY-MM-DDTHH:mm:ss.SSS+TZ (for example, 2020-01-29T13:05:07.000+0300), where date and time values are separated with “T”. “07.000” is for seconds and milliseconds. |
dlvError | string (optional) | Message delivery error, refer to the Available status codes article for more details. |
rate | string | Cost of a fallback SMS message delivery (if it was sent). |
reserveSms | string | Delivery status of the fallback SMS |
Response Format
A successful response contains only the 200 status code.
Transmitting Messages Sent by User to Client server
This method allows sending an incoming user message to the client server. The client’s Callback URL must be registered in the personal account in edna dashboard and must start with HTTPS. The callback function should be used if HSM messages with chat-buttons are sent. In this case, the request body will contain the button’s payload code. This is the code of the button that the user clicked/tapped in the messenger. The code is specified when creating the HSM template.
Request endpoint
A POST request is made to the URL you specified during registration or in your personal account in the profile section. Only the HTTPS protocol must be used.
Request format
The request body contains a JSON object with an incoming message (similar to the request body of the imOutMessageDlvStatusCallback
request).
{ "id": 43407125, "imSubject": "subject", "address": "79XXXXXXXXX", "receivedAt": "2021-10-20T08:42:51.354+0000", "imType": "whatsapp", "contentType": "text", "text": "Hello edna", "caption": null, "attachmentUrl": null, "attachmentName": null, "longitude": null, "latitude": null, "locationAddress": null, "userName": "Joe", "firstName": null, "lastName": null, "avatarUrl": null, "apiKeyId": 121, "historyMessages": [ null ], "imSubjectId": 864 }
Request Parameters
Parameter | Type | Description |
id | string | Message ID |
imsubject | string | Subject of the message |
address | string | WhatsApp number in the 79ХХХХХХХХХ format |
receivedAt | string | Time of the received message |
imType | string | The channel that is used for the message delivery |
contentType | string | Type of the message content. It can be a button, text, image, document or video. |
text | string | Message text |
attachmentUrl | string | URL of the attached image/document/video |
attachmentName | string (optional) | The name of the attached image/document/video |
longitude | string | Longitude of the location |
latitude | string | Latitude of the location |
locationAddress | string | Geolocation of the address |
caption | string | Name of the geolocation address |
userName | string | Client’s user name in WhatsApp |
firstName | string | Client’s first name in WhatsApp |
lastName | string | Client’s last name in WhatsApp |
avatarUrl | string | URL of the sender’s avatar |
payload | string | Button code |
apiKeyId | string | Account’s key |
Response Format
A successful response contains only the 200 status code.