Inbound Messages

There are several types of inbound messages that may be delivered to your Bot.

You will receive a notification when your business receives a message. The message object section below covers all the information you may receive about an incoming message. This section shows examples of text messages and location messages.

Text Message

📘

Example: Text Message Received

The following is an example of a text message you received from a customer.

{
  "channel": "wab",
  "target": "b092cb06bd69f8fcc30e571cdbe43163",
  "endUserInfo": {
    "userID": "20100xxxxxx",
    "userName": "Mostafa Ali",
    "phoneNumber": "20100xxxxxx",
    "senderFullname": "Mostafa Ali"
  },
  "type": "text",
  "text": "Hi"
}

Static Location Message

📘

Example: Static Location Message Received

The following is an example of a message you received from a customer specifying their static location.

{
  "channel": "wab",
  "target": "b092cb06bd69f8fcc30e571cdbe43163",
  "endUserInfo": {
    "userID": "20100xxxxxx",
    "userName": "Mostafa Ali",
    "phoneNumber": "20100xxxxxx",
    "senderFullname": "Mostafa Ali"
  },
  "type": "text",
  "text": "https://www.google.com/maps/search/?api=1&query=24.715343385681127,46.62035034015846"
}

Message with Image

📘

Example: Message with Image Received

The following is an example inbound message that contains an image.

{
  "channel": "wab",
  "target": "b092cb06bd69f8fcc30e571cdbe43163",
  "endUserInfo": {
    "userID": "20100xxxxxx",
    "userName": "Mostafa Ali",
    "phoneNumber": "20100xxxxxx",
    "senderFullname": "Mostafa Ali"
  },
  "type": "image",
  "text": " ",
  "metadata": {
    "src": "<your image url>",
    "type": "image/jpeg",
    "width": 200,
    "height": 200
  }
}

Message with video

📘

Example: Message with video Received

The following is an example inbound message that contains a video.

{
  "channel": "wab",
  "target": "b092cb06bd69f8fcc30e571cdbe43163",
  "endUserInfo": {
    "userID": "20100xxxxxx",
    "userName": "Mostafa Ali",
    "phoneNumber": "20100xxxxxx",
    "senderFullname": "Mostafa Ali"
  },
  "type": "video",
  "text": " ",
  "metadata": {
    "src": "<your video URL>",
    "type": "video/mp4"
  }
}

Message with Document

📘

Example: Message with Document Received

The following is an example inbound message that contains a document.

{
  "channel": "wab",
  "target": "b092cb06bd69f8fcc30e571cdbe43163",
  "endUserInfo": {
    "userID": "20100xxxxxx",
    "userName": "Mostafa Ali",
    "phoneNumber": "20100xxxxxx",
    "senderFullname": "Mostafa Ali"
  },
  "type": "file",
  "text": " ",
  "metadata": {
    "src": "<your file url>",
    "filename": "abc.pdf",
    "name": "abc.pdf"
  }
}

Contacts Message

📘

Example: Contacts Message Received

The following is an example of a message you received from a customer specifying their contact information. See the contacts object section below for more information.

{
  "channel": "wab",
  "target": "b092cb06bd69f8fcc30e571cdbe43163",
  "endUserInfo": {
    "userID": "20100xxxxxx",
    "userName": "Mostafa Ali",
    "phoneNumber": "20100xxxxxx",
    "senderFullname": "Mostafa Ali"
  },
  "type": "text",
  "text": "User sent contacts type message, It's not supported from Omni-Channel Chat till now."
}