{

MO Webhooks

Description

You can receive your incoming reply messages in your own systems. Replies are defined as messages that are returned on an outgoing message, within a certain period. This period can vary; it is at least 5 days.

To receive replies, you are required to send out the original message with a SenderID that is reply-enabled. Messages to that number need to be delivered at CM's messaging platform and the number must have been configured to process reply messages.

CM has a set of shared numbers available that are free to use to receive your replies on. The downside of using one of these numbers, is that traffic from other customers using the same number could interfere with your traffic, making replies unreliable. For reliant and confidential communication, we advise you to obtain a dedicated phone number. Contact support for more information about choosing and acquiring a suitable SenderID.

This feature is free of charge, and can be configured via the CM-Gateway app. (For the reception of inbound messages, costs can apply, depending on contract and country of destination.) Click the 'Reply settings' button in the top right to set up your incoming messages. Enable replies for your account using the checkmark at the top and, at the bottom, add your URL to send your message to. The default 'Json' format is the prefered choice, as the other formats (Xml and Get) are subject to change and might be deprecated in the near future.

Data content

If setup correctly, you will receive a json object like this on the specified URLs:

Field Description
reference The unique reference of the message. *(See below)
from Information about the sender (See below).
to Information about the recipient of the message (See below).
message The content of the message, see below.
groupings Array of exactly three strings with the grouping information. *(See below)

Note: For replies, both 'reference' and 'groupings' return information sent with the original message the message was responded on. This value is only supplied when the message was received as a reply and not when it was received as a message on a distinct keyword or phone-number match.

From:

Field Description
name For some channels, such as WhatsApp, this will contain the profile name of the user (if set)
number Phone number of the device from where the message originated.

To:

Field Description
number Phone number (MSISDN or shortcode) to which the message was sent.

Message:

Field Description
text The text content of the message, when the message contains text.
media A media item, can be a image, audio, movie or document file. If no media item was sent all fields will be empty
custom Custom object, can be anything a specific channel supports such as a location or a list of contact items.

Examples

{
     "reference": "2f2d42ac-3809-40fb-bce5-dc720e400000",
     "from": {
           "number": "+316012345678",
           "name": ""
     },
     "to": {
           "number": "3669"
     },
     "message": {
           "text": "This is an example message",
           "media": {
                "mediaUri": "",
                "contentType": "",
                "title": ""
           },
           "custom": {}
     },
     "groupings": ["39373ce0-f4aa-4918-8ff1-3cef7f77b112", "messagesApi", ""]
}

Media item:

{
     "reference": "2f2d42ac-3809-40fb-bce5-dc720e400000",
     "from": {
           "number": "+316012345678",
           "name": "Demo"
     },
     "to": {
           "number": "3669"
     },
     "message": {
           "text": "",
           "media": {
                "mediaUri": "https://temp.com/adsadsa",
                "contentType": "image/png",
                "title": "Media items can be empty"
           },
           "custom": {}
     },
     "groupings": ["39373ce0-f4aa-4918-8ff1-3cef7f77b112", "messagesApi", ""]
}

WhatsApp location:

{
     "reference": "2f2d42ac-3809-40fb-bce5-dc720e400000",
     "from": {
           "number": "+316012345678",
           "name": "Demo"
     },
     "to": {
           "number": "+316012345678"
     },
     "message": {
           "text": "",
           "media": {
                "mediaUri": "",
                "contentType": "",
                "title": ""
           },
           "custom": {
                "location": {
                     "latitude": 51.603802,
                     "longitude": 4.770821,
                     "label": "CM HQ",
                     "searchQuery": "Konijnenberg 30"
                }
           }
     },
     "groupings": ["39373ce0-f4aa-4918-8ff1-3cef7f77b112", "messagesApi", ""]
}