Incoming WhatsApp messages
Find out in which format will the message sent from your customers be delivered to your end-point.
Incoming messages will be forwarded in real-time to the end-point client provided during the setup. This way, 2-way communication will be established and Enterprise is enabled to create certain logic for processing incoming messages.
NOTE
The endpoint needs to be provided by the Client. The endpoint is the URL where your services can be accessed by Infobip cPaaS platform. Infobip will complete the setup of the provided URL as part of the setup procedure on your behalf.
The connection can be secured with additional authorization header between Infobip cPaas and Enterprise’s’ endpoint.
Text Incoming message
There are two ways how incoming messages can be forwarded to the client's end-point. They can be delivered with or without contact name.
Example of incoming message without contact name:
{
"results": [
{
"from": "385919998888",
"to": "1234",
"integrationType": "WHATSAPP",
"receivedAt": "2019-07-19T11:21:27.861+0000",
"messageId": "ABEGOFl3VCQoAhAqnlmSd2FKPOaraEaS0rPQ",
"pairedMessageId": null,
"callbackData": null,
"message": {
"type": "TEXT",
"text": "Support hello"
},
"price": {
"pricePerMessage": 0,
"currency": "EUR"
}
}
],
"messageCount": 1,
"pendingMessageCount": 0
}
Example of the incoming message with the contact name:
{
"results": [
{
"from": "385919998888",
"to": "1234",
"integrationType": "WHATSAPP",
"receivedAt": "2019-07-19T11:23:26.998+0000",
"messageId": "ABEGOFl3VCQoAhBalbc6rTQT6mgS29EmGZ7a",
"pairedMessageId": null,
"callbackData": null,
"message": {
"type": "TEXT",
"text": "Support hello"
},
"contact": {
"name": "Frank"
},
"price": {
"pricePerMessage": 0,
"currency": "EUR"
}
}
],
"messageCount": 1,
"pendingMessageCount": 0
}
You can choose between these two types how you want to receive incoming messages. If you want to change from one type to another, you can contact our support.
NOTE
If, for example, type with contact name is being used, it will apply for the incoming messages with media as well (image, document, location, etc.).
Image Incoming Message
{
"results": [
{
"from": "385919998888",
"to": "1234",
"integrationType": "WHATSAPP",
"receivedAt": "2018-09-10T11:27:17.980+0000",
"messageId": "ABEGOFkWA5EBAgo6B82cNiWIAMKC",
"pairedMessageId": null,
"callbackData": null,
"message": {
"type": "IMAGE",
"caption": "Image Caption",
"url": "https://{base_url}/whatsapp/1/senders/447796344125/media/f1b96d31-9ab9-4513-808b-50ab37360fbe"
},
"price": {
"pricePerMessage": 0.000000,
"currency": "HRK"
}
}
],
"messageCount": 1,
"pendingMessageCount": 0
}
Document Incoming message
{
"results": [
{
"from": "385919998888",
"to": "1234",
"integrationType": "WHATSAPP",
"receivedAt": "2018-09-10T12:10:18.379+0000",
"messageId": "ABEGOFkWA5EBAgo6B82cNiWIAMKC",
"pairedMessageId": null,
"callbackData": null,
"message": {
"type": "DOCUMENT",
"caption": "Document caption",
"url": "https://{base_url}/whatsapp/1/senders/447796344125/media/c256e11d-a7e9-4dbb-aa9c-2a6028ddf7e8"
},
"price": {
"pricePerMessage": 0.000000,
"currency": "HRK"
}
}
],
"messageCount": 1,
"pendingMessageCount": 0
}
Location Incoming Message
{
"results": [
{
"from": "385919998888",
"to": "1234",
"integrationType": "WHATSAPP",
"receivedAt": "2018-09-10T12:13:53.864+0000",
"messageId": "ABEGOFkWA5EBAgo6B82cNiWIAMKC",
"pairedMessageId": null,
"callbackData": null,
"message": {
"type": "LOCATION",
"longitude": 15.9459228515625,
"latitude": 45.793365478515625
},
"price": {
"pricePerMessage": 0.000000,
"currency": "HRK"
}
}
],
"messageCount": 1,
"pendingMessageCount": 1
}
Contact Incoming Message
{
"results": [
{
"from": "385919998888",
"to": "1234",
"integrationType": "WHATSAPP",
"receivedAt": "2019-09-24T10:07:04.070+0000",
"messageId": "ABEGOFmJJRkFAhA7ud6mcWKmglIlIO6xibx9",
"pairedMessageId": null,
"callbackData": null,
"message": {
"contacts": [
{
"name": {
"first_name": "Frank",
"last_name": "Bipper",
"formatted_name": "Frank Bipper"
},
"org": {
"company": "Infobip"
},
"phones": [
{
"phone": "+385 91 888 9999",
"type": "Mobile",
"wa_id": "385918889999"
}
]
}
],
"price": {
"pricePerMessage": 0,
"currency": "EUR"
},
"messageCount": 1,
"pendingMessageCount": 0
}
}
]
}
Video Incoming Message
{
"results": [
{
"from": "385918889999",
"to": "1234",
"integrationType": "WHATSAPP",
"receivedAt": "2019-09-24T12:21:06.486+0000",
"messageId": "ABEGOFmJJRkFAhDvgHvPWYmCNKXZSQaqgH2A",
"pairedMessageId": null,
"callbackData": null,
"message": {
"caption": "Look at this!",
"type": "VIDEO",
"url": "https://api.infobip.com/whatsapp/1/senders/447860098731/media/42f076b9-1d1e-4d56-8c1e-02d0a402a1e3"
},
"price": {
"pricePerMessage": 0,
"currency": "EUR"
}
}
],
"messageCount": 1,
"pendingMessageCount": 0
}