This method helps your server read a client’s response message in the chat. For example, if a client received an HSM message with chat buttons, if they click one of them, the payload parameter will be returned (the code button that was set when creating a template for the HSM message).
You can test receiving messages to a test phone number using edna API for the WhatsApp channel without having to register your channel first. To do that, go the the Testing tab on the Integration page.
URL
For your server to be able to read response messages, during registration, you need to specify your system’s API endpoint that will process incoming POST requests from edna API.
Only the HTTPS protocol is supported, so the address must start with HTTPS, port 443.
Request Example
- Example of a received text message
{ "id": 101, "subject": "test_subject_WA", "subjectId": 234, "subscriber": { "id": 202, "identifier": "79000000000" }, "userInfo": { "userName": "alex", "firstName": null, "lastName": null, "avatarUrl": null }, "messageContent": { "type": "TEXT", "attachment": null, "location": null, "caption": null, "text": "Thank you for your help", "payload": null, "story": null, "items": null }, "receivedAt": "2022-04-29T15:30:08Z" }
- Example of a received message that is a response to a message with an interactive menu
{ "id": 102, "subject": "test_subject_WA", "subjectId": 234, "subscriber": { "id": 202, "identifier": "79000000000" }, "userInfo": { "userName": "alex", "firstName": null, "lastName": null, "avatarUrl": null }, "messageContent": { "type": "LIST_PICKER", "attachment": null, "location": null, "caption": null, "text": null, "payload": null, "story": null, "items": [ { "identifier": "01", "title": "item 1", "subtitle": null } ] }, "receivedAt": "2022-04-29T15:27:40Z" }
Request Parameters
Parameter | Data type | Description |
id | long | Request ID |
subject | string | Subject |
subjectId | long | Subject ID. To retrieve the ID, use the channel-profile method. |
subscriber | object | Sender information |
subscriber.id | long | Sender indetifier |
subscriber.identifier | string | Sender phone number |
userInfo | object | Sender information |
userInfo.userName | string | First name |
userInfo.firstName | string | Last name |
userInfo.lastName | string | Patronymic |
userInfo.avatarUrl | string | Avatar |
messageContent | object | Message information |
messageContent.text | string (optional) | Message text |
messageContent.type | string | Type of content in the message: text, button, image, document, audio, or vodeo |
messageContent.caption | string (optional) | Title |
messageContent.payload | string (optional) | Button code specified when creating an HSM template |
messageContent.items | object | Array of parameters that are returned in the response to a message with an interactive menu. If the received message is not a response to a message with an interactive menu, then messageContent.items is null . |
messageContent.items.title | string (required) | Title of the element of the original interactive menu |
messageContent.items.subtitle | string (optional) | Subtitle of the element of the interactive menu |
messageContent.items.identifier | integer (required) | Element ID for the entire message. This ID is returned in the client’s response message |
messageContent.location | object (optional) | Location address |
messageContent.attachment | object (optional) | Null or attachment data |
messageContent.attachment.url | string (optional) | URL of the attached image/document/video |
messageContent.attachmentname | string (optional) | Name of the attached image/document/video |
messageContent.attachmentsize | string (optional) | Attachment size |
receivedAt | string | Date and time when the message was received |
The list of the elements that are returned as a result of the request might be replenished at our discretion. Please use the elements from the list that you require.