LogoLogo
Vietnamese
Vietnamese
  • Giới thiệu
  • Giải thích thuật ngữ
  • Kết nối Botcake lần đầu sử dụng
  • Tích hợp Zalo OA
  • Tích hợp Instagram
  • Google Site Search
  • Tích hợp Google API
  • Tích hợp WhatsApp
  • Các chức năng chính
    • Ecommerce
    • Cấu hình chung
    • Bảng điều khiển
    • Khách hàng
    • Livechat
    • Công cụ Bình luận
    • Gửi tin nhắn
    • Luồng tin nhắn
    • Công cụ
      • QR Code
      • Customer Chat
      • Messenger Ref URL
      • Facebook Ads JSON
  • Automation
    • Câu hỏi thường gặp
    • Menu chính
    • Tin nhắn mở đầu
    • Tin nhắn mặc định
    • Từ khoá
    • Kịch bản chăm sóc
    • Quy luật
  • Thiết lập tin nhắn
    • Các thành phần trong trang thiết lập tin nhắn
    • Hướng dẫn lấy URL Facebook
    • Hướng dẫn import và phát Coupon code
  • Cấu hình
    • Dynamic Block Docs
    • Thẻ khách hàng
    • Danh mục sản phẩm
    • Custom Field
    • Chủ đề OTN
    • Marketing Messages(MM) - Tin nhắn Marketing
    • Vòng quay may mắn
    • Tích hợp ChatGPT
    • Quản trị viên và lịch sử lỗi
  • Nâng cao
    • Hướng dẫn thiết lập luồng tự động lên đơn tại POS với Botcake
    • Các mã lỗi thường gặp khi sử dụng Chatbot
    • Upsell không vi phạm chính sách của Facebook
    • Usecase chăm sóc lại khách hàng cũ miễn phí
    • Changelog
      • Giao thức chuyển giao
  • API Reference
Powered by GitBook
On this page
  • How to generate and authorize your token
  • Get Flows
  • Get Flows by path
  • Get Flow Statistics
  • Get Keywords
  • Get Asked Question
  • Get Main Menu
  • Get Tools
  • Create Keyword
  • Update Keyword
  • Send Flow For Customer
  • Send Content For Customer

Was this helpful?

API Reference

PreviousGiao thức chuyển giao

Last updated 1 year ago

Was this helpful?

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

Name
Type
Description

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)

{
    "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
            }
        ]
    }
}
"Server internal error"

Get Flows by path

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

Query Parameters

Name
Type
Description

path

Array

Thư mục muốn lấy ra(ví dụ: lấy dữ liệu trong thư mục id 2, thư mục id 2 nằm trong thư mục id 1, thư mục id 1 không có thư mục nào trên nữa thì path = [1,2])

Headers

Name
Type
Description

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)

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

Get Flow Statistics

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

Headers

Name
Type
Description

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)

Get Keywords

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

Headers

Name
Type
Description

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)

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

Get Asked Question

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

Headers

Name
Type
Description

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)

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

Get Main Menu

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

Headers

Name
Type
Description

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)

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

Get Tools

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

Headers

Name
Type
Description

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)

{
    "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
        }
    ]
}
"Server internal error"

Create Keyword

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

Headers

Name
Type
Description

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)

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

Update Keyword

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

Headers

Name
Type
Description

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

Name
Type
Description

keyword_id*

Integer

Id của keyword được trả về trong api get keywords

update*

Object

Các trường bạn muốn update

Hiện tại hỗ trợ:

{

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
  }
}
"Server internal error"

Send Flow For Customer

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

Headers

Name
Type
Description

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

Name
Type
Description

psid*

String

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

flow_id*

Integer

Id của flow mà bạn muốn gửi cho khách hàng

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
}
"Server internal error"

Send Content For Customer

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

Headers

Name
Type
Description

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

Name
Type
Description

psid*

String

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

data*

Object

Data format:

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",

...

}

message_tag

String

{
  "success": true
}
"Server internal error"

Supported message tags:

https://docs.botcake.io/cau-hinh/response-reference-docs
https://developers.facebook.com/docs/messenger-platform/send-messages/message-tags#supported_tags