# Messages format

# Sending text

Use this response for sending text messages. url, node and call buttons can be used with text message. The "buttons", "actions", "quick_replies" properties are optional.

{
  "version": "v1",
  "content": {
    "messages": [
      {
        "type": "text",
        "text": "simple text with button",
        "buttons": [
          {
            "type": "url",
            "caption": "External link",
            "url": "https://uchat.com.au"
          }
        ]
      }
    ],
    "actions": [],
    "quick_replies": []
  }
}

# Sending image

This response is used to send image files. Messenger supports JPG, PNG and GIF images. You can use url, call and node buttons. The "buttons", "actions", "quick_replies" properties are optional.

{
  "version": "v1",
  "content": {
    "messages": [
      {
        "type": "image",
        "url": "https://example.comxxxxxxzzzzzzzzz.png",
        "buttons": []
      }
    ],
    "actions": [],
    "quick_replies": []
  }
}

# Sending video file

This response is used to send video files. Messenger supports videos, which are up to 25MB in size. You can use url, call and node buttons. The "buttons", "actions", "quick_replies" properties are optional.

{
  "version": "v1",
  "content": {
    "messages": [
      {
        "type": "video",
        "url": "https://example.com/xxxxxxzzzzzzzzz.mpg",
        "buttons": []
      }
    ],
    "actions": [],
    "quick_replies": []
  }
}

# Sending audio file

This response is used to send audio files. Messenger supports audio, which are up to 25MB in size. You can use url, call and node buttons. The "buttons", "actions", "quick_replies" properties are optional.

{
  "version": "v1",
  "content": {
    "messages": [
      {
        "type": "audio",
        "url": "https://example.com/xxxxxxzzzzzzzzz.mp3",
        "buttons": []
      }
    ],
    "actions": [],
    "quick_replies": []
  }
}

# Sending files

This response is used to send any other files, which are no larger than 25 MB. The "actions", "quick_replies" properties are optional.

{
  "version": "v1",
  "content": {
    "messages": [
      {
        "type": "file",
        "url": "https://example.com/xxxxxxzzzzzzzzz.pdf"
      }
    ],
    "actions": [],
    "quick_replies": []
  }
}

This response is used to send a horizontal scrollable gallery. You can use url, call and node buttons. The "action_url", "buttons", "actions", "quick_replies" properties are optional.

{
  "version": "v1",
  "content": {
    "messages": [
      {
        "type": "cards",
        "elements": [
          {
            "title": "Card title",
            "subtitle": "card text",
            "image_url": "https://example.com/xxxxxxzzzzzzzzz.png",
            "action_url": "https://uchat.com.au",
            "buttons": []
          }
        ],
        "image_aspect_ratio": "horizontal"
      }
    ],
    "actions": [],
    "quick_replies": []
  }
}

action_url - URLs starting with HTTP may not open in some browsers. We strongly suggest to use HTTPS protocol for your URLs.\ image_aspect_ratio - The aspect ratio used to render cards. You can use horizontal or square (default horizontal).

Last Updated: 12/9/2020, 4:56:07 AM