API Reference

How to generate and authorize your token

To use Botcake API, you need to generate a token. Navigate to Settings -> API and click Generate your Token button.

Please note: Refreshing and Deleting your token will disable all connected API methods!

After a successful token generation, you can use API.

Get Flows

GET https://botcake.io/api/public_api/v1/pages/[:page_id]/flows

Headers

NameTypeDescription

access-token*

String

Token of page(You can create it in Setting/ API)

{
    "success": true,
    "data": {
        "folders": [
            {
                "parent_id": 1562,
                "name": "folder hihihi",
                "id": 1566
            },
            {
                "parent_id": 1561,
                "name": "folder hahaha",
                "id": 1564
            },
            {
                "parent_id": null,
                "name": "hello folder 2",
                "id": 1562
            },
            {
                "parent_id": null,
                "name": "hello folder 1",
                "id": 1561
            }
        ],
        "flows": [
            {
                "parent_id": 1562,
                "name": "flow hihihi",
                "id": 1567
            },
            {
                "parent_id": 1561,
                "name": "flow hahaha",
                "id": 1565
            },
            {
                "parent_id": null,
                "name": "hello flow 2",
                "id": 1560
            },
            {
                "parent_id": null,
                "name": "hello flow 1",
                "id": 1559
            }
        ]
    }
}

Get Flows by path

GET https://botcake.io/api/public_api/v1/pages/[:page_id]/flows/[:path]

Query Parameters

NameTypeDescription

path*

Array

The directory you want to retrieve (for example, get data in folder id 2, folder id 2 is in folder id 1, folder id 1 has no other folders on it, then path = [1,2])

Headers

NameTypeDescription

access-token*

String

Token of page(You can create it in Setting/ API)

{
    "success": true,
    "data": {
        "folders": [
            {
                "parent_id": 1561,
                "name": "folder hahaha",
                "id": 1564
            }
        ],
        "flows": [
            {
                "parent_id": 1561,
                "name": "flow hahaha",
                "id": 1565
            }
        ]
    }
}

Get Flow Statistics

GET https://botcake.io/api/public_api/v1/pages/[:page_id]/flows/:flow_id/statistics

Headers

NameTypeDescription

access-token*

String

Token of page(You can create it in Setting/ API)

Get Keywords

GET https://botcake.io/api/public_api/v1/pages/[:page_id]/keywords

Headers

NameTypeDescription

access-token*

String

Token of page(You can create it in Setting/ API)

{
    "success": true,
    "data": [
        {
            "is_activated": false,
            "id": 641,
            "flow_id": null
        }
    ]
}

Get Asked Question

GET https://botcake.io/api/public_api/v1/pages/[:page_id]/ice_breaker

Headers

NameTypeDescription

access-token*

String

Token of page(You can create it in Setting/ API)

{
    "success": true,
    "data": [
        {
            "title": "ice breaker 1",
            "id": 6,
            "flow_id": 1559
        },
        {
            "title": "ice breaker 2",
            "id": 7,
            "flow_id": 1560
        }
    ]
}

Get Main Menu

GET https://botcake.io/api/public_api/v1/pages/[:page_id]/main_menu

Headers

NameTypeDescription

access-token*

String

Token of page(You can create it in Setting/ API)

{
    "success": true,
    "data": [
        {
            "type": "flow",
            "title": "tab 1",
            "id": 389,
            "flow_id": 1559
        },
        {
            "url": "https://solo.com",
            "type": "link",
            "title": "tab 2",
            "id": 390
        }
    ]
}

Get Tools

GET https://botcake.io/api/public_api/v1/pages/[:page_id]/tools

Headers

NameTypeDescription

access-token*

String

Token of page(You can create it in Setting/ API)

{
    "success": true,
    "data": [
        {
            "type": "messenger_ref_url",
            "name": "tool 2",
            "is_published": false,
            "id": 331
        },
        {
            "type": "facebook_ads_json",
            "name": "tool 1",
            "is_published": false,
            "id": 330
        }
    ]
}

Create Keyword

POST https://botcake.io/api/public_api/v1/pages/[:page_id]/keywords/create

Headers

NameTypeDescription

access-token*

String

Token of page(You can create it in Setting/ API)

{
  "success": true,
  "keyword": {
    "id": 646,
    "flow_id": null
  }
}

Update Keyword

POST https://botcake.io/api/public_api/v1/pages/[:page_id]/keywords/update

Headers

NameTypeDescription

access-token*

String

Token of page(You can create it in Setting/ API)

Request Body

NameTypeDescription

keyword_id*

Integer

The id of the keyword returned in the api get keywords

update*

Object

The fields you want to update.

Currently supported:

{

flow_id(Integer): id của flow sẽ được chạy khi keyword được kích hoạt

}

{
  "success": true,
  "keyword": {
    "id": 642,
    "flow_id": 23
  }
}

Send Flow For Customer

POST https://botcake.io/api/public_api/v1/pages/[:page_id]/flows/send_flow

Headers

NameTypeDescription

access-token*

String

Token of page(You can create it in Setting/ API)

Request Body

NameTypeDescription

psid*

String

The returned id string of the customer on the Facebook page

flow_id*

Integer

The id of the flow you want to send to the client

payload

Object

In the Dynamic Block request body, you can use the Full Contact Data variable which contains all contact’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",

...

}

{
  "success": true
}

Send Content For Customer

POST https://botcake.io/api/public_api/v1/pages/[:page_id]/flows/send_content

Headers

NameTypeDescription

access_token*

String

Chuỗi token của page(Khách hàng có thể tạo ở mục Cấu hình/ API Access Token)

Request Body

NameTypeDescription

psid*

String

Chuỗi id của khách hàng trên page Facebook trả về

data*

Object

Data format:

message_tag

String

payload

Object

In the Dynamic Block request body, you can use the Full Contact Data variable which contains all contact’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",

...

}

{
  "success": true
}

Last updated