BotCake
Search…
Dynamic Block Docs
Response Reference Docs

Response format

Response format for sending dynamic messages:
1
{
2
"version": "botcake_v1",
3
"content": {
4
"messages": [
5
{
6
"type": "text",
7
"text": "simple text"
8
},
9
{
10
...Another messages
11
}
12
],
13
"actions": [ //optional
14
{
15
"action": "add_tag",
16
"tag_name": "example tag"
17
},
18
{
19
...Another actions
20
}
21
],
22
"quick_replies": [ //optional
23
{
24
"type": "flow",
25
"title": "Go",
26
"flow_id": "12345"
27
},
28
{
29
...Another quick replies
30
}
31
]
32
}
33
}
Copied!
Dynamic block API current version botcake_v1 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.
1
{
2
"version": "botcake_v1",
3
"content": {
4
"messages": [
5
{
6
"type": "text",
7
"text": "simple text with button",
8
"buttons": [
9
{
10
"type": "url",
11
"title": "External link",
12
"url": "https://botcake.io"
13
}
14
]
15
}
16
],
17
"actions": [],
18
"quick_replies": []
19
}
20
}
Copied!

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.
1
{
2
"version": "botcake_v1",
3
"content": {
4
"messages": [
5
{
6
"type": "image",
7
"url": "https://statics.pancake.vn/user-content.pancake.vn/photo/xyz.png",
8
"buttons": []
9
}
10
],
11
"actions": [],
12
"quick_replies": []
13
}
14
}
Copied!

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.
1
{
2
"version": "botcake_v1",
3
"content": {
4
"messages": [
5
{
6
"type": "video",
7
"url": "https://statics.pancake.vn/user-content.pancake.vn/video/xyz.mpg",
8
"buttons": []
9
}
10
],
11
"actions": [],
12
"quick_replies": []
13
}
14
}
Copied!

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.
1
{
2
"version": "botcake_v1",
3
"content": {
4
"messages": [
5
{
6
"type": "audio",
7
"url": "https://statics.pancake.vn/user-content.pancake.vn/audio/xyz.mp3",
8
"buttons": []
9
}
10
],
11
"actions": [],
12
"quick_replies": []
13
}
14
}
Copied!

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.
1
{
2
"version": "botcake_v1",
3
"content": {
4
"messages": [
5
{
6
"type": "file",
7
"url": "https://statics.pancake.vn/user-content.pancake.vn/file/xyz.pdf"
8
}
9
],
10
"actions": [],
11
"quick_replies": []
12
}
13
}
Copied!

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.
1
{
2
"version": "botcake_v1",
3
"content": {
4
"messages": [
5
{
6
"type": "text",
7
"text": "simple text",
8
"buttons": [
9
{
10
"type": "url",
11
"title": "External link",
12
"url": "https://botcake.io"
13
},
14
{
15
...Another buttons
16
}
17
]
18
},
19
{
20
...Another messages
21
}
22
],
23
"actions": [ //optional
24
{
25
"action": "add_tag",
26
"tag_name": "example tag"
27
},
28
{
29
...Another actions
30
}
31
],
32
"quick_replies": [ //optional
33
{
34
"type": "flow",
35
"title": "Go",
36
"flow_id": "12345"
37
},
38
{
39
...Another quick replies
40
}
41
]
42
}
43
}
Copied!

Call button

1
{
2
"version": "botcake_v1",
3
"content": {
4
"messages": [
5
{
6
"type": "text",
7
"text": "simple text with button",
8
"buttons": [
9
{
10
"type": "call",
11
"title": "Call me",
12
"phone": "+1 (555) 555-55-55"
13
}
14
]
15
}
16
],
17
"actions": [],
18
"quick_replies": []
19
}
20
}
Copied!

Url button

There are 3 options of webview_size:
full - (100%),
medium - (75%),
compact - (50%)
The "webview_size" property is optional.
1
{
2
"version": "botcake_v1",
3
"content": {
4
"messages": [
5
{
6
"type": "text",
7
"text": "simple text with button",
8
"buttons": [
9
{
10
"type": "url",
11
"title": "External link",
12
"url": "https://botcake.io",
13
"webview_size": "full"
14
}
15
]
16
}
17
],
18
"actions": [],
19
"quick_replies": []
20
}
21
}
Copied!

Go to flow button

1
{
2
"version": "botcake_v1",
3
"content": {
4
"messages": [
5
{
6
"type": "text",
7
"text": "simple text with button",
8
"buttons": [
9
{
10
"type": "flow",
11
"title": "Go",
12
"flow_id": "12345"
13
}
14
]
15
}
16
],
17
"actions": [],
18
"quick_replies": []
19
}
20
}
Copied!
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:
1
{
2
"version": "botcake_v1",
3
"content": {
4
"messages": [
5
{
6
"type": "text",
7
"text": "simple text with button",
8
"buttons": [
9
{
10
"type": "url",
11
"title": "External link",
12
"url": "https://botcake.io"
13
}
14
]
15
}
16
],
17
"actions": [
18
{
19
"action": "add_tag",
20
"tag_name": "your tag",
21
}
22
],
23
"quick_replies": []
24
}
25
}
Copied!
Tag name sent using tag_name parameter should match one of existing tags within Botcake bot

Action remove tag

Use this response to remove a tag from a subscriber. Tag with the same name must exist in your bot:
1
{
2
"version": "botcake_v1",
3
"content": {
4
"messages": [
5
{
6
"type": "text",
7
"text": "simple text with button",
8
"buttons": [
9
{
10
"type": "url",
11
"title": "External link",
12
"url": "https://botcake.io"
13
}
14
]
15
}
16
],
17
"actions": [
18
{
19
"action": "remove_tag",
20
"tag_name": "your tag",
21
}
22
],
23
"quick_replies": []
24
}
25
}
Copied!

Quick replies

Go to flow quick reply

1
{
2
"version": "botcake_v1",
3
"content": {
4
"messages": [
5
{
6
"type": "text",
7
"text": "simple text with button",
8
"buttons": [
9
{
10
"type": "url",
11
"title": "External link",
12
"url": "https://botcake.io"
13
}
14
]
15
}
16
],
17
"actions": [],
18
"quick_replies": [
19
{
20
"type": "flow",
21
"title": "Go",
22
"flow_id": "12345"
23
}
24
]
25
}
26
}
Copied!
flow_id needs flow ID (it can be found in URL when flow is opened)
Last modified 1yr ago