Botcake
English
English
  • Introduction
  • Term explanation
  • Connecting Botcake for the first time
  • Integrated Zalo OA
  • Integrated Instagram
  • Integrated WhatsApp
  • Main function
    • General
    • Dashboard
    • Customer
    • Livechat
    • Facebook Comments
    • Broadcasts
    • Flow
    • Growth Tools
      • QR Code
      • Customer Chat
      • Facebook Ads JSON
      • Messager Ref URL
  • Automation
    • Icebreaker
    • Main Menu
    • Welcome Message
    • Default Reply
    • Keyword
    • Sequences
    • Rules
  • Create Content Message
    • Make an Appointment
    • Components in message setup page
    • Getting the Facebook URL
  • Settings
    • Dynamic Block Docs
    • General and Notification
    • Tag
    • Product Management
    • Custom Field
    • OTN Topic
    • Marketing messages
    • ChatGPT Integration
    • Intergrations
    • Admin and Error Logs
  • Advanced
    • Common Errors while using Botcake
    • Upsell does not violate Facebook's policy
  • Changelog
    • Update feature to hide photos in Gallery
  • Botcake FAQ
    • Botcake is not working
    • The Button Is Disabled
    • "Botcake Reply Failed" on Pancake Display
    • Can We Set Working Hours For Botcake?
    • Cannot find the Pages to connect to Botcake?
    • How to synchronize Data from Botcake to Google Sheet?
  • API Reference
Powered by GitBook
On this page
  • Response format
  • Messages format
  • Sending text
  • Sending image
  • Sending video file
  • Sending audio file
  • Sending files
  • Sending gallery cards
  • Buttons
  • Call button
  • Url button
  • Go to flow button
  • Actions format
  • Action add tag
  • Action add custom field
  • Action remove tag
  • Quick replies
  • Go to flow quick reply
  • Go to phone number quick reply
  • Go to email quick reply
  • Variables

Was this helpful?

  1. Settings

Dynamic Block Docs

Response Reference Docs

Response format

Response format for sending dynamic messages:

{
  "version": "v2",
  "content": {
    "messages": [
      {
        "type": "text",
        "text": "simple text"
      },
      {
        ...Another messages
      }
    ],
    "actions": [  //optional
      {
        "action": "add_tag",
        "tag_id": 12345
      },
      {
        "action": "set_custom_field",
        "action_id": 17,
        "action_value": "abcd"
      },
      {
        ...Another actions
      }
    ],
    "quick_replies": [ //optional
      {
        "type": "flow",
        "caption": "Go",
        "flow_id": 12345
      },
      {
        ...Another quick replies
      }
    ]
  }
}

Dynamic block API current version v2 Dynamic block has a limit to have not more than 10 messages in messages block, 11 quick replies and 5 actions. The "buttons", "actions", "quick_replies" properties are optional.

Messages format

Sending text

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

{
  "version": "v2",
  "content": {
    "messages": [
      {
        "type": "text",
        "text": "simple text with button",
        "buttons": [
          {
            "type": "url",
            "title": "External link",
            "url": "https://botcake.io"
          }
        ]
      }
    ],
    "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, flow buttons. The "buttons", "actions", "quick_replies" properties are optional.

{
  "version": "v2",
  "content": {
    "messages": [
      {
        "type": "image",
        "url": "https://statics.pancake.vn/user-content.pancake.vn/photo/xyz.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, flow buttons. The "buttons", "actions", "quick_replies" properties are optional.

{
  "version": "v2",
  "content": {
    "messages": [
      {
        "type": "video",
        "url": "https://statics.pancake.vn/user-content.pancake.vn/video/xyz.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, flow buttons. The "buttons", "actions", "quick_replies" properties are optional.

{
  "version": "v2",
  "content": {
    "messages": [
      {
        "type": "audio",
        "url": "https://statics.pancake.vn/user-content.pancake.vn/audio/xyz.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": "v2",
  "content": {
    "messages": [
      {
        "type": "file",
        "url": "https://statics.pancake.vn/user-content.pancake.vn/file/xyz.pdf"
      }
    ],
    "actions": [],
    "quick_replies": []
  }
}

Sending gallery cards

On WhatsApp, it requires at least 1 button in gallery

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

{
  "version": "v2",
  "content": {
    "messages": [
      {
        "type": "cards",
        "elements": [
          {
            "title": "Card title",
            "subtitle": "card text",
            "image_url": "https://statics.pancake.vn/user-content.pancake.vn/photo/xyz.png",
            "buttons": []
          }
        ],
        "image_aspect_ratio": "horizontal"
      }
    ],
    "actions": [],
    "quick_replies": []
  }
}

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).

Buttons

You can use buttons with each types: call, url, flow. You can provide custom action to be performed with the button. Actions can only be attached to url, flow button types. Actions for buttons must comply with same format and restrictions as described in Actions format bellow. The "actions" property is optional.

{
  "version": "v2",
  "content": {
    "messages": [
      {
        "type": "text",
        "text": "simple text",
        "buttons": [
          {
            "type": "url",
            "title": "External link",
            "url": "https://botcake.io"
          },
          {
            ...Another buttons
          }
        ]
      },
      {
        ...Another messages
      }
    ],
    "actions": [  //optional
      {
        "action": "add_tag",
        "tag_id": 12345
      },
      {
        ...Another actions
      }
    ],
    "quick_replies": [ //optional
      {
        "type": "flow",
        "caption": "Go",
        "flow_id": 12345
      },
      {
        ...Another quick replies
      }
    ]
  }
}

Call button

Not available on WhatsApp

{
  "version": "v2",
  "content": {
    "messages": [
      {
        "type": "text",
        "text": "simple text with button",
        "buttons": [
          {
            "type": "call",
            "title": "Call me",
            "phone": "+1 (555) 555-55-55"
          }
        ]
      }
    ],
    "actions": [],
    "quick_replies": []
  }
}

Url button

Not available on WhatsApp

There are 3 options of webview_size:

full - (100%),

medium - (75%),

compact - (50%)

The "webview_size" property is optional.

{
  "version": "v2",
  "content": {
    "messages": [
      {
        "type": "text",
        "text": "simple text with button",
        "buttons": [
          {
            "type": "url",
            "title": "External link",
            "url": "https://botcake.io",
            "webview_size": "full"
          }
        ]
      }
    ],
    "actions": [],
    "quick_replies": []
  }
}

Go to flow button

{
  "version": "v2",
  "content": {
    "messages": [
      {
        "type": "text",
        "text": "simple text with button",
        "buttons": [
          {
            "type": "flow",
            "title": "Go",
            "flow_id": 12345
          }
        ]
      }
    ],
    "actions": [],
    "quick_replies": []
  }
}

flow_id needs flow ID (it can be found in URL when flow is opened)

Actions format

actions property of server response is optional.

Action add tag

Use this response to add a tag to a subscriber. Tag with the same name must exist in your bot:

{
  "version": "v2",
  "content": {
    "messages": [
      {
        "type": "text",
        "text": "simple text with button",
        "buttons": [
          {
            "type": "url",
            "title": "External link",
            "url": "https://botcake.io"
          }
        ]
      }
    ],
    "actions": [
      {
        "action": "add_tag",
        "tag_id": 12345
      }
    ],
    "quick_replies": []
  }
}

Tag name sent using tag_name parameter should match one of existing tags within Botcake bot

Action add custom field

Use this response to add a custom field to a subscriber.

{
  "version": "v2",
  "content": {
    "messages": [
      {
        "type": "text",
        "text": "simple text with button",
        "buttons": [
          {
            "type": "url",
            "title": "External link",
            "url": "https://botcake.io"
          }
        ]
      }
    ],
    "actions": [
      {
        "action": "set_custom_field",
        "action_id": 17,
        "action_value": "abcd"
      }
    ],
    "quick_replies": []
  }
}

Action remove tag

Use this response to remove a tag from a subscriber. Tag with the same name must exist in your bot:

{
  "version": "v2",
  "content": {
    "messages": [
      {
        "type": "text",
        "text": "simple text with button",
        "buttons": [
          {
            "type": "url",
            "title": "External link",
            "url": "https://botcake.io"
          }
        ]
      }
    ],
    "actions": [
      {
        "action": "remove_tag",
        "tag_id": 12345
      }
    ],
    "quick_replies": []
  }
}

Quick replies

Go to flow quick reply

Only available on Messenger or Instagram

{
  "version": "v2",
  "content": {
    "messages": [
      {
        "type": "text",
        "text": "simple text with button",
        "buttons": [
          {
            "type": "url",
            "title": "External link",
            "url": "https://botcake.io"
          }
        ]
      }
    ],
    "actions": [],
    "quick_replies": [
      {
        "type": "flow",
        "caption": "Go",
        "flow_id": 12345
      }
    ]
  }
}

flow_id needs flow ID (it can be found in URL when flow is opened)

Go to phone number quick reply

Only available on Messenger

{
  "version": "v2",
  "content": {
    "messages": [
      {
        "type": "text",
        "text": "simple text with button",
        "buttons": [
          {
            "type": "url",
            "title": "External link",
            "url": "https://botcake.io"
          }
        ]
      }
    ],
    "actions": [],
    "quick_replies": [
      {
        "type": "user_phone_number"
      }
    ]
  }
}

Go to email quick reply

Only available on Messenger

{
  "version": "v2",
  "content": {
    "messages": [
      {
        "type": "text",
        "text": "simple text with button",
        "buttons": [
          {
            "type": "url",
            "title": "External link",
            "url": "https://botcake.io"
          }
        ]
      }
    ],
    "actions": [],
    "quick_replies": [
      {
        "type": "user_email"
      }
    ]
  }
}

Variables

In dynamic block request body, you can use Full Subscriber Data variable, that contains all subscriber’s information:

{
    "user_first_name": "Firstname",
    "user_last_name": "Lastname",
    "user_full_name": "Subscriber",
    "#GENDER{{MALE|FEMALE|UNKNOWN}}": "MALE",
    "psid": "123456xxxxxx",
    "ad_id": "123456xxxxx",
    "page_name": "Botcake",
    "{{SPIN_1|SPIN_2}}": "SPIN_1",
    "email": "abc@gmail.com",
    "phone": "+8438409xxxx",
    "address": "Ha Noi",
    "current_date": "2018-07-02T00:00:00+00:00",
    "CONVERSATION_LINK": "https://pages.fm/323087334762615?c_id=323087334762615_xxxxxxxxxx",
}
PreviousGetting the Facebook URLNextGeneral and Notification

Last updated 1 year ago

Was this helpful?