×

Receive messages webhook can be passed in status_callback parameter in send message/template message APIs to receive replies on messages from the business. To receive any message from an end user which is not a reply to a business message, a default callback value needs to be configured. Exotel team will help you configure the default URL while onboarding.

  • If you pass receive messages webhook in send message/template message APIs, reply messages from users will be triggered to the respective URL 
  • If you do not pass any receive messages webhook in send message/template message APIs, reply messages from users will be triggered to the default URL, if any.
  • All user initiated conversations and messages which are not a reply on business message, will be triggered to the default URL

*NOTE: Any messages from an user can be received only in one webhook at any time

Webhook Parameter

Parameter

Type

Mandatory

Notes

whatsapp

Message ICM Object

Mandatory

Incoming message callback for Whatsapp

Message ICM Object

Parameter

Type

Mandatory

Notes

messages

[]Whatsapp Message ICM Object

Mandatory

Information relating to the incoming messages from the end-users

Whatsapp Message ICM Object

Parameter

Type

Mandatory

Notes

callback_type

String

Mandatory

Type of the callback. Possible values: dlr/icm

from

String

Mandatory

Number of the end user who has sent the incoming message to the business

to

String

Mandatory

Business number to whom the message was sent

profile_name

String

Mandatory

Profile Name of the user who has sent the incoming message

timestamp

String

Mandatory

Timestamp at which incoming message was sent

content

Content Object

Mandatory

Content related to the incoming message

Content Object

Parameter

Type

Mandatory

Notes

type

String

Mandatory

Type of the message

text

Text Object

Optional

Mandatory if type is text

image

Media Response Object

Optional

Mandatory if type is image

audio

Media Response Object

Optional

Mandatory if type is audio

video

Media Response Object

Optional

Mandatory if type is video

document

Media Response Object

Optional

Mandatory if type is document

error

Message ICM Error Object

Optional

If there is an error

Media Response Object

Parameter

Type

Mandatory

Notes

url

String

Mandatory

URL to download the media

caption

String

Optional

Caption for the media. Describes the specified media.

filename

String

Optional

This is passed if the media is document. Describes the filename for the specific document. 

The extension of the filename will specify what format the document is displayed as in WhatsApp.

Message ICM Error Object

Parameter

Type

Mandatory

Notes

exo_status_code

Integer

Mandatory

Exo Status Code for the error

exo_status

String

Mandatory

Detailed Status of the Exo Status Code

description

String

Mandatory

Description of the Exo Status code

{
   "whatsapp": {
     "messages": [
       {
         "callback_type": "incoming_message",
         "from": "1234",
         "profile_name": "John",
         "to": "5698",
         "timestamp": "1235654654",
         "content": {
           "type": "text",
           "text": {
             "body": "This is a text message from Whatsapp"
           }
         }
       }
     ]
   }
 }
{
   "whatsapp": {
     "messages": [
       {
         "callback_type": "incoming_message",
         "from": "1234",
         "profile_name": "John",
         "to": "5698",
         "timestamp": "1235654654",
         "content": {
           "type": "image",
           "image": {
             "url": "https://exotel.com/abc.jpeg",
             "caption": "Hello this is image from Whatsapp"
           }
         }
       }
     ]
   }
 }
{
   "whatsapp": {
     "messages": [
       {
         "callback_type": "incoming_message",
         "from": "1234",
         "profile_name": "John",
         "to": "5698",
         "timestamp": "1235654654",
         "content": {
           "type": "image",
           "image": {
             "url": "https://exotel.com/abc.jpeg",
             "caption": "Hello this is image from Whatsapp"
           }
         }
       }
     ]
   }
 }