This method helps your server to read a client’s response message in chat. For example, if a client receives an HSM message with chat buttons, when they click on one of them, the payload parameter is returned (the code button that was set when a template was created for the HSM message).
You can test receiving messages to a test phone number using the edna API for the WhatsApp channel without registering your channel first. To do this, go to the Testing tab on the Integration page.
Connection URL
Only the HTTPS protocol is supported, so the address must start with HTTPS, port 443.
In order for your server to be able to read response messages, you should specify your system’s API endpoint during registration, which will handle incoming POST requests from the edna API.
Request Example
An 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" }
An 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 | The request ID. |
subject | string | The subject. |
subjectId | long | The subject ID. To retrieve the ID, use the channel-profile method. |
subscriber | object | The sender information. |
subscriber.id | long | The sender identifier. |
subscriber.identifier | string | The sender phone number. |
userInfo | object | The sender information. |
userInfo.userName | string | The first name. |
userInfo.firstName | string | The last name. |
userInfo.lastName | string | The patronymic. |
userInfo.avatarUrl | string | The avatar. |
messageContent | object | The message information. |
messageContent.text | string (optional) | The message text. |
messageContent.type | string | The type of content in the message: text, button, image, document, audio, or video. |
messageContent.caption | string (optional) | The title. |
messageContent.payload | string (optional) | The button code specified when creating an HSM template. |
messageContent.items | object | The array of parameters that are returned to 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) | The title of the element of the original interactive menu. |
messageContent.items.subtitle | string (optional) | The subtitle of the element of the interactive menu. |
messageContent.items.identifier | integer (required) | The element ID for the entire message. This ID is returned to the client’s response message. |
messageContent.location | object (optional) | The location address. |
messageContent.attachment | object (optional) | Null or attachment data. |
messageContent.attachment.url | string (optional) | The URL of the attached image/document/video. |
messageContent.attachmentname | string (optional) | The name of the attached image/document/video. |
messageContent.attachmentsize | string (optional) | The attachment size. |
messageContent.contact | object (optional) | The contact card consisting of the following fields: first name, last name, phone number. |
contact.firstName | string (optional) | The name in the contact card. |
contact.lastName | string (optional) | The last name in the contact card. |
contact.phoneNumber | string (optional) | The phone number in the contact card. |
receivedAt | string | The date and time when the message was received. |
replyInMessageId | long | The internal identifier of the user’s quoted message. The user quotes message sent to the company. |
replyOutMessageId | long | The internal identifier of the company’s quoted message. The user quotes a message received from the company. |
replyOutMessageExternalRequestId | long | The external identifier of the company’s quoted message that it specifies when sending an outgoing message via the API if the user quoted a message received from the company. |
You can change the set of items that are returned as a result of the request. To do this, use the required items from the list.