Messages format

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://alendei.com" } ] } ], "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://alendei.com", "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).




    • Related Articles

    • Actions format

      Action add tag Use this response to add a tag to a subscriber. Tag with the same name must exist in your bot: { "version": "v1", "content": { "messages": [ { "type": "text", "text": "simple text with button", "buttons": [ { "type": "url", "caption": ...
    • How to format date time?

      There are date time custom field in OCP, sometime, you want to format them properly. Here is a few formats you can refer. The following characters can be used: d - The day of the month (from 01 to 31) D - A textual representation of a day (three ...
    • Why your bot is sending duplicate messages?

      So if your bot is sending duplicate message, it might be the following reasons: For messenger channel, It’s possible you connect more than 1 app in your page advance settings. Please make sure you only connect OCP app to your page. For WhatsApp cloud ...
    • Quick replies

      quick_replies property of server response is optional. Quick replies cannot be used in dynamic block of a content node if there are other blocks exist afterwards. Quick reply description format is the same for buttons, it supports content, node, ...
    • STOP-LIGHT DOCUMENTATION for Template API

      STOP-LIGHT DOCUMENTATION The released documentation covers how to use APIs to send templates directly from the Marketing panel. POST https://connect.api-wa.co/project-apis/v1/project/{project_id}/messages PARAMETER Project_id : XXX AUTH ...