Skip to main content

Receiving Messages

Last updated: 8 April 2025

This method allows your server to read the user's reply message in the chat.

For example, after sending an HSM message with chat buttons to a user, when one of the buttons is clicked, the payload parameter is returned — the button code specified when creating the HSM message template.

info

You can test sending messages using the edna Pulse API for the WhatsApp channel without registering the channel.

File IconTesting WhatsApp Channel API

Connection URL

info

The address should start with HTTPS — HTTPS protocol, port 443.

To read users' reply messages in chats, specify your system's API Endpoint in your personal account during registration, which will process incoming POST requests from the edna API.

Examples

Received text messages

{
"id": 101,
"subject": "test_subject_WA",
"subjectId": 345,
"subscriber": {
"id": 202,
"identifier": "35700000000"
},
"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",
"replyOutMessageId": 5043874,
"replyOutMessageExternalRequestId": "2c2dd5f1-5ad8-449d-9c38-b6bdf288f1e5",
"replyInMessageId": null
}

Received message that is a response to a message with an interactive menu

{
"id": 102,
"subject": "test_subject_WA",
"subjectId": 345,
"subscriber": {
"id": 202,
"identifier": "35700000000"
},
"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",
"replyOutMessageId": null,
"replyOutMessageExternalRequestId": null,
"replyInMessageId": 537701
}

Incoming message with the PRODUCT value in the messageContent.type parameter

{
"id": 803101,
"subject": "test_subject_WA",
"subjectId": 47610,
"subscriber": {
"id": 4633047,
"identifier": "79997776655"
},
"userInfo": {
"userName": "John Smith",
"firstName": null,
"lastName": null,
"avatarUrl": null
},
"messageContent": {
"type": "PRODUCT",
"attachment": null,
"location": null,
"caption": null,
"text": "Hello",
"payload": null,
"story": null,
"items": null,
"contact": null,
"product": {
"id": "321",
"catalogId": "123"
},
"catalog": null,
"order": null
},
"receivedAt": "2024-08-05T08: 24: 14Z",
"replyOutMessageId": null,
"replyOutMessageExternalRequestId": null,
"replyInMessageId": null
}

Incoming message with the ORDER value in the messageContent.type parameter

{
"id": 804201,
"subject": "test_subject_WA",
"subjectId": 47610,
"subscriber": {
"id": 4633047,
"identifier": "79997776655"
},
"userInfo": {
"userName": "John Smith",
"firstName": null,
"lastName": null,
"avatarUrl": null
},
"messageContent": {
"type": "ORDER",
"attachment": null,
"location": null,
"caption": null,
"text": null,
"payload": null,
"story": null,
"items": null,
"contact": null,
"product": null,
"catalog": null,
"order": {
"catalogId": "1022121105031922",
"products": [
{
"id": "111222",
"quantity": 2,
"price": 5,
"currency": "EUR"
}
]
}
},
"receivedAt": "2024-08-05T12:44:22Z",
"replyOutMessageId": null,
"replyOutMessageExternalRequestId": null,
"replyInMessageId": null
}

Callback for an incoming message with the referral parameter

info

Allows you to get information about where the customer started a conversation in WhatsApp.

{
"id": 115611,
"subject": "test_WA",
"subjectId": 195,
"subscriber": {
"id": 1111111,
"identifier": "35700000000"
},
"userInfo": {
"userName": "Anna",
"firstName": null,
"lastName": null,
"avatarUrl": null
},
"messageContent": {
"type": "TEXT",
"attachment": null,
"location": null,
"referral": {
"body": "This is a great product",
"headline": "Our new product",
"sourceId": "123",
"sourceType": "ad",
"sourceUrl": "https://www.fb.com"
},
"caption": null,
"text": "text for test",
"payload": null,
"story": null,
"items": null,
"contact": null,
"product": null,
"catalog": null,
"order": null
},
"receivedAt": "2024-01-11T11:20:00Z",
"replyOutMessageId": null,
"replyOutMessageExternalRequestId": null,
"replyInMessageId": null
}

Callbacks for incoming messages with the FLOW value in the messageContent.type parameter

[
{
"id": 101,
"subject": "test_subject_WA",
"subjectId": 50520,
"subscriber": {
"id": 4633047,
"identifier": "79997776655"
},
"userInfo": {
"userName": "John Smith",
"firstName": null,
"lastName": null,
"avatarUrl": null
},
"messageContent": {
"type": "FLOW",
"attachment": null,
"location": null,
"referral": null,
"caption": null,
"text": "{\"flow_token\":\"example\"}",
"payload": null,
"story": null,
"items": null,
"contact": null,
"product": null,
"catalog": null,
"order": null
},
"receivedAt": "2025-03-25T12:12:12Z",
"replyOutMessageId": null,
"replyOutMessageExternalRequestId": null,
"replyInMessageId": null
}
]
[
{
"id": 101,
"subject": "test_subject_WA",
"subjectId": 50520,
"subscriber": {
"id": 4633047,
"identifier": "79997776655"
},
"userInfo": {
"userName": "John Smith",
"firstName": null,
"lastName": null,
"avatarUrl": null
},
"messageContent": {
"type": "FLOW",
"attachment": null,
"location": null,
"referral": null,
"caption": null,
"text": "{\"screen_0_Name_0\":\"Ivan\",\"screen_0_Order_number_1\":\"6\",\"screen_0_Choose_a_topic_2\":\"0_order\",\"flow_token\":\"example\"}",
"payload": null,
"story": null,
"items": null,
"contact": null,
"product": null,
"catalog": null,
"order": null
},
"receivedAt": "2025-03-25T12:12:12Z",
"replyOutMessageId": null,
"replyOutMessageExternalRequestId": null,
"replyInMessageId": null
}
]

Request Parameters

ParameterData typeDescription
idlongRequest ID.
subjectstringName of the signature.
subjectIdlongThe signature ID. You can find out through the channel list method.
subscriberobjectInformation about the sender of the message.
subscriber.id longThe identifier.
subscriber.identifierstringPhone number.
userInfoobjectUser information.
userInfo.userNamestringName.
userInfo.firstNamestringLast name.
userInfo.lastNamestringMiddle name.
userInfo.avatarUrlstringAvatar.
messageContentobjectInformation about the message.
messageContent.textstring (optional)The text of the message. When using WhatsApp Flows, information about Flow will be sent in this parameter.

developers.facebook.com
messageContent.typestringThe type of message. Possible values:

- TEXT — text message;

- IMAGE — image;

- DOCUMENT — document attached to the message;

- VIDEO— message containing a video;

- AUDIO — a message containing sound;

- PRODUCT — a message containing a product;

- ORDER — a message containing an order;

- LIST_PICKER — WhatsApp interactive menu buttons;

- FLOW — message containing WhatsApp Flows.

File IconUsing WhatsApp Flows
textstringRequired if ContentType = TEXT, AUTHENTICATION or FLOW
MessageContent.captionstring (optional)Name.
MessageContent.payloadstring (optional)The button code. Specified when creating the HSM template.
MessageContent.itemsobjectA set of parameters that are returned in a response message from the client when it responds to a message with an interactive menu. If the client's message is ordinary (for example, text) and is not a response to a message with an interactive menu, the parameter is returned as follows: MessageContent.items = null.
messageContent.items.titlestring (required)The name of the item in the original interactive menu.
MessageContent.items.subtitlestring (optional)The subtitle of the original interactive menu item.
messageContent.items.identifierinteger (optional)The end-to-end element ID for the entire message will be returned in the user's reply message.
messageContent.locationobject (optional)Location address.
MessageContent.attachmentobject (optional)null or document data.
MessageContent.attachment.urlstring (optional)URL of the attached image, document, or video.
MessageContent.attachmentnamestring (optional)The name of the attached image, document, or video.
MessageContent.attachmentsizestring (optional)Size.
MessageContent.contactobject (optional)A contact card consisting of the fields: first name, last name, and mobile phone.
contact.firstNamestring (optional)The name in the contact card.
contact.lastNamestring (optional)Last name in the contact card.
contact.PhoneNumberstring (optional)The mobile phone in the contact card.
receivedAtstringDate and time of receipt.
replyInMessageIdlongThe internal identifier of the user's quoted message. The user quotes his message sent to the company.
replyOutMessageIdlongThe internal identifier of the quoted message of the company. The user quotes a message received from the company.
replyOutMessageExternalRequestIdlongThe external identifier of the quoted message of the company, which it specifies when sending an outgoing message via the API. In the event that the user quoted a message received from the company.
info

You can add to the set of items that are returned as a result of the request. To do this, use the necessary items from the list.

Response parameters

ParameterData typeDescription
messageContent.referralobjectInformation obtained from a link hidden from the user or from an advertisement
MessageContent.referral.bodystringThe ad text associated with the message.
messageContent.referral.headlinestringThe title of the ad associated with the message.
MessageContent.referral.SourceIDstringID of the Facebook ad or post.
MessageContent.referral.sourceTypestringType of the ad source. Possible values:

- ad — ad

- post — publication
MessageContent.referral.sourceURLstringURL of the ad that the user viewed.