10 April 2019

One API: Receive message callback

10 April 2019
clock
3 minutes

Clickatell will asynchronously send a callback to your application with the details of any messages that were received via either your SMS or WhatsApp channels (incoming messages sent from the end user’s mobile phone to your business account).

Note that the sequence in which message callbacks are received is not guaranteed to be the original sequence in which these messages were initiated by users. The callback will return the incoming messages with a timestamp generated upon receiving them in the Clickatell system. The exact implementation of this timestamp could vary from channel to channel.

Receive Message Callback

Below is a standard callback sample that is generated when an incoming message has been received by the platform:

POST Request


{
  "integrationId": "fa8090815f05d5ed015f0b5b56080cd2",
  "integrationName": "My integration",
  "event": {
    "moText": [
      {
        "channel": "whatsapp",
        "messageId": "3a89680503414383af44dcd0e4e5f184",
        "relatedMessageId": "d33eef0838a121f71069a4cc8d55c19e",
        "relatedClientMessageId": "d33eef0838a121f71069a4cc8d55c19e",
        "from": "2799900001",
        "to": "2799900002",
        "timestamp": 1506607698000,
        "content": "Text Content of the reply message",
        "charset": "UTF-8"
      }
    ]
  }
}

Media Message Callback

When a media message is received from the end user, our platform will convert the media object into a base64 encoded string as the message content. The media message callback will also contain additional information like content-type and caption that identifies the media object type.

POST Request


{
  "integrationId": "fa8090815f05d5ed015f0b5b56080cd2",
  "integrationName": "My integration",
  "event": {
    "moMedia": [
      {
        "channel": "whatsapp ",
        "messageId": "7ed16cedd7ca7c4d252c7ec854dec3cb",
        "relatedMessageId": "8f287d93f5e5c5fd3ba228fef124c975",
        "relatedClientMessageId": null,
        "from": "2799900001",
        "to": "2799900002",
        "timestamp": 1506607698000,
        "content": "Base64 Binary Media Stream Content",
        "sha256Hash": "529fd5482f43db39992a894bbe4216f51a4d724131a97b93cc5589433b545820", 
        "caption": "Message caption text"
      }
    ]
  }
} 

Setting a username & password on callback (Optional)

It is possible to predefine a username and password for your message callbacks. This value will then be included as parameters in the body to allow for system authentication.

Featured Insight Circle post

Reclaiming Billions in the Digital Economy: James Ronca

Related blogs posts

Reclaiming Billions in the Digital Economy: James Ronca
The 2020s: Decade of Dynamic Payments
Life will never be the same

About Clickatell

Todays’ consumers spend more time on chat like text, Instagram, Facebook Messenger, and WhatsApp than apps, and they expect a high degree of convenience in the way brands serve them. Clickatell makes it possible for brands and consumers to engage and transact via mobile chat and digital channels with industry-leading communications commerce platforms and solutions. With offices in San Francisco, Toronto, Cape Town, and Lagos, Clickatell serves more than 15,000 global brands, ranging from Fortune 500 organizations to well-known consumer brands and small businesses in over 220 countries worldwide.

Read more about Clickatell

Related blogs posts

Reclaiming Billions in the Digital Economy: James Ronca
The 2020s: Decade of Dynamic Payments
Life will never be the same

This website uses cookies to allow us to see how the site is used. The cookies cannot identify you. If you continue to use this site we will assume that you are happy with this. If you want to use the site without cookies or would like to know more, you can do that here.