Get started

    Điểm cuối api        
https://cytechbot.com/api

The CyTechBot API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, common HTTP verbs and uses API key based authentication.

To use this API, you need an API key. To get your own API key, please click on the profile picture on the top-right-side on your dashboard and then click on the API Key menu.

Note: Endpoints that have marked (Admin) have to be admin user to make a call to them.

Có được người dùng

                
curl -X GET 'https://cytechbot.com/api/get_user_info/?api_key=api_key&user_id=user_id'
                
            

Để nhận thông tin người dùng, bạn cần thực hiện một cuộc gọi đến điểm cuối sau:
/get_user_info


                
Success Result Example:

{
    "status": "success",
    "user_info": {
        "id": "39",
        "name": "test_username",
        "email": "[email protected]",
        "mobile": "01234567891",
        "address": "Heaven 21",
        "user_type": "Member",
        "status": "1",
        "add_date": "2020-09-27 08:13:01",
        "last_login_at": "0000-00-00 00:00:00",
        "expired_date": "2020-10-27 00:00:00",
        "package_id": "16",
        "last_login_ip": "127.0.0.1"
    }
}

Error Result Example:

{
    "status": "error",
    "message": "No Matching User Found"
}
                
            

PARAMETERS

Field Type Description
api_key String Your API key
user_id Integer The ID of the user
email String The email address of the user

Use either user_id or email address to make a successful get-user-info API call

Tạo người dùng

                
curl -X POST \
'https://cytechbot.com/api/create_system_user' \
-d 'api_key=your_api_key' \
-d 'name=name' \
-d 'email=email' \
-d 'password=password' \
-d 'package_id=package_id' \
-d 'expired_date=expired_date'
                
            

Để tạo người dùng mới, bạn cần thực hiện cuộc gọi đăng bài tới điểm cuối sau:
/create_system_user


                
Success Result example :

{ 
    "status": "success",
    "id": 29
}

Error Result Example:

{
    "status": "error",
    "message": "Email already exists"
}
                
            

PARAMETERS

Field Type Description
api_key String Your API key.
name String Name of the user
email String Email of the user
password String Password of the user. We recommend use a combination of alpha-numeric characters including special characters.
package_id Integer Package ID of the system
expired_date String Expire Date in YYYY-MM-DD Format
mobile Numeric (optional) Mobile number of the user
address String (optional) Address of the user

Cập nhật người dùng

                
curl -X POST \
'https://cytechbot.com/api/update_user/{userId}' \
-d 'api_key=api_key' \
-d 'name=name' \
-d 'mobile=mobile' \
-d 'address=address' \
-d 'package_id=package_id' \
-d 'expired_date=expired_date' 
                
            

Để cập nhật người dùng, bạn cần thực hiện cuộc gọi đăng bài tới điểm cuối sau:
/create_system_user/{userId}


                
Success Result Example:

{
    "status": "success"
}

Error Result Example:

{
    "status": "error",
    "message": "User not found with the ID: 12"
}
                
            

PARAMETERS

Field Type Description
api_key String Your API key
name String (optional) The user's name to be updated
mobile Numeric (optional) The user's mobile number to be updated
address String (optional) The user's address number to be updated
package_id Integer (optional) The package_id to be updated
expired_date Date (optional) The expired_date of the user's validity to be updated:
Date Format: 'YYYY-MM-DD'

You need to provide at least one more parameter with the api_key to make a successful update-user API call

Nhận gói

                
curl -X GET 'https://cytechbot.com/api/get_all_packages/?api_key=api_key'
                
            

Để nhận thông tin về tất cả nhịp độ, bạn cần thực hiện cuộc gọi đến điểm cuối sau:
/get_all_packages


                
Success Result Example:

{
    "status": "success",
    "packages": [
        {
            "id": "1",
            "package_name": "Trial",
            "module_ids": "251,80,79,263,65, ...",
            "price": "0",
            "validity": "0",
            "deleted": "0",
            "visible": "0",
            "highlight": "0"
        },
        {
            "id": "16",
            "package_name": "everything",
            "module_ids": "251,80,202,201,88,206, ...",
            "price": "112.35",
            "validity": "700",
            "deleted": "0",
            "visible": "1",
            "highlight": "0"
        }

        // more
    ]
}

Error Result Example:

{
    "status": "error",
    "message": "Either API Key Invalid or Member Validity Expired"
}
                
            

PARAMETERS

Field Type Description
api_key String Your API key

Có được người đăng ký

                
curl -X GET 'https://cytechbot.com/api/subscriber_information/?api_key=api_key&subscriber_id=subscriber_id'
                
            

Để nhận thông tin người đăng ký, bạn cần thực hiện cuộc gọi đến điểm cuối sau:
/subscriber_information


                
Success Result Example:

{
    "status": "success",
    "subscriber_info": {
        "subscriber_id": "134242424",
        "labels": "",
        "first_name": "test_first_name",
        "last_name": "test_last_name",
        "full_name": "test_full_name",
        "gender": "",
        "locale": "",
        "timezone": "",
        "page_name": "XeroDevs",
        "page_id": "1123123123123",
        "unavailable": "0",
        "last_error_message": "",
        "refferer_source": "",
        "subscribed_at": "0000-00-00 00:00:00",
        "email": "[email protected]",
        "phone_number": "01234567891",
        "birthdate": "0000-00-00",
        "last_subscriber_interaction_time": "0000-00-00 00:00:00"
    }
}

Error Result Example:

{
    "status": "error",
    "message":" No Matching Subscriber Found"
}
                
            

PARAMETERS

Field Type Description
api_key String Your API key
subscriber_id Integer Subscriber PSID

Lấy nhãn

                
curl -X GET 'https://cytechbot.com/api/get_all_labels/?api_key=api_key&page_id=page_id'
                
            

Để nhận tất cả các nhãn, bạn cần thực hiện lệnh nhận đến điểm cuối sau:
/get_all_labels


                
Success Result Example:

{
    "status": "success",
    "label_info":[
        {
            "label_id": "2472856209402188",
            "label_name": "Important"
        },
        {
            "label_id": "2328660457215897",
            "label_name": "Product"
        }
    ]
}

Error Result Example:

{
    "status": "error",
    "message": "No Matching Label Found"
}
                
            

PARAMETERS

Field Type Description
api_key String Your API key
page_id Integer Page ID [must be bot enabled in the system]

Tạo nhãn

                
curl -X POST \ 
'https://cytechbot.com/api/create_label' \
-d 'api_key=api_key' \
-d 'label_name=label_name' \
-d 'page_id=page_id' 
                
            

Để tạo nhãn, bạn cần thực hiện cuộc gọi đăng đến điểm cuối sau:
/create_label


                
Success Result Example:

{
    "status": "success",
    "label_id": "012345678790"
}

Error Result Example:

{
    "status": "error",
    "message": "No Enabled Bot Found"
}
                
            

PARAMETERS

Field Type Description
api_key String Your API key
label_name String Label name to be created
page_id Integer Page ID [must be bot enabled in the system]

Gán nhãn

                
curl -X POST \ 
'https://cytechbot.com/api/assign_label' \
-d 'api_key=api_key' \
-d 'label_ids=6243946525492645,9452768492754035' \
-d 'page_id=page_id' \
-d 'subscriber_id=subscriber_id'
                
            

Để gán nhãn, bạn cần thực hiện cuộc gọi đăng đến điểm cuối sau:
/assign_label


                
Success Result Example:

{
    "success": true,
    "status": "success"
}

Error Result Example:

{
    "status": "error",
    "message": "(#100) The user ID is not valid."
}

{
    "status": "error",
    "message": "No Enabled Bot Found"
}
                
            

PARAMETERS

Field Type Description
api_key String Your API key
label_ids String Label ID to be assigned. You can provide multiple label IDs separated by comma
page_id Integer Page ID [must be bot enabled in the system]
subscriber_id Integer Subscriber PSID

Có được nhóm liên hệ

                
curl -X GET 'https://cytechbot.com/api/get_contact_group/?api_key=api_key&contact_type_id=contact_type_id'
                
            

Để có được nhóm liên hệ, bạn cần thực hiện cuộc gọi đến điểm cuối sau:
/get_contact_group


                
Success Result Example:

{
    "id": "4567",
    "user_id": "345",
    "type": "Group 12",
    "created_at": "2020-10-28 13:40:46",
    "deleted": "0"
}

Error Result Example:

{
    "status": "error",
    "message": "The contact type ID is required"
}
                
            

PARAMETERS

Field Type Description
api_key String Your API key
contact_type_id Integer The contact type ID to be fetched

Tạo nhóm liên hệ

                
curl -X POST \
'https://cytechbot.com/api/create_contact_group' \
-d 'api_key=api_key' \
-d 'name=name' 
                
            

Để tạo nhóm liên hệ, bạn cần thực hiện cuộc gọi đăng bài tới điểm cuối sau:
/create_contact_group


                
Success Result Example:

{
    "status": "success",
    "contact_type_id": 276
}

Error Result Example:

{
    "status": "error",
    "message": "The contact type name is required"
}
                
            

PARAMETERS

Field Type Description
api_key String Your API key
name String The name of contact group to be created

Cập nhật nhóm liên lạc

                
curl -X POST \
'https://cytechbot.com/api/update_contact_group/{contact_type_id}' \
-d 'api_key=api_key' \
-d 'name=name' 
                
            

Để cập nhật nhóm liên hệ, bạn cần thực hiện cuộc gọi đăng bài tới điểm cuối sau:
/update_contact_group/{contact_type_id}


                
Success Result Example:

{
    "status": "success"
}

Error Result Example:

{
    "status": "error",
    "message": "The contact type name is required"
}
                
            

PARAMETERS

Field Type Description
api_key String Your API key
name String The name of the contact group to be updated

Xóa liên lạcGroup

                
curl -X POST \
'https://cytechbot.com/api/delete_contact_group' \
-d 'api_key=api_key' \
-d 'contact_type_id=contact_type_id'
                
            

Để xóa nhóm liên hệ, bạn cần thực hiện một cuộc gọi đăng đến điểm cuối sau:
/delete_contact_group


                
Success Result Example:

{
    "status": "success",
    "message": "The contact type ID (2) has been deleted"
}

Error Result Example:

{
    "status": "error",
    "message": "The contact_type_id field is required"
}
                
            

PARAMETERS

Field Type Description
api_key String Your API key
contact_type_id Integer The contact type ID to be deleted

Nhận liên hệ

                
curl -X GET 'https://cytechbot.com/api/get_contact/?api_key=api_key&contact_id=contact_id'
                
            

Để có được liên hệ, bạn cần thực hiện một cuộc gọi đến điểm cuối sau:
/get_contact


                
Success Result Example:

{
    "id": "233",
    "user_id": "87",
    "contact_type_id": "67",
    "first_name": "test_first_name",
    "last_name": "test_last_name",
    "phone_number": "01234567891",
    "email": "[email protected]",
    "notes": "",
    "unsubscribed": "0",
    "deleted": "0"
}

Error Result Example:

{
    "status": "error",
    "message": "The contact ID does not exist"
}
                
            

PARAMETERS

Field Type Description
api_key String Your API key
contact_id Integer The contact ID to be fetched

Tạo ra liên lạc

                
curl -X POST \
'https://cytechbot.com/api/create_contact' \
-d 'api_key=api_key' \
-d 'contact_type_id=contact_type_id' \
-d 'email=email' \
-d 'phone_number=phone_number' \
-d 'first_name=first_name' \
-d 'last_name=last_name' 
                
            

Để tạo liên hệ, bạn cần thực hiện cuộc gọi đăng bài tới điểm cuối sau:
/create_contact


                
Success Result Example:

{
    "status": "success",
    "new_contact_id": 45
}

Error Result Example:

{
    "status": "error",
    "message": "The email or phone_number is required"
}

{
    "status": "error",
    "message": "The contact ID does not exist"
}
                
            

PARAMETERS

Field Type Description
api_key String Your API key
contact_type_id Integer The contact type ID to be attached to
email String The email address of the user
phone_number String The phone number of the user
first_name String (optional) The first name of the user
last_name String (optional) The last name of the user

Note: Either email or phone_number is required

Cập nhật liên lạc

                
curl -X POST \
'https://cytechbot.com/api/update_contact/{contact_id}' \
-d 'api_key=api_key' \
-d 'email=email' \
-d 'phone_number=phone_number' \
-d 'first_name=first_name' \
-d 'last_name=last_name' 
                
            

Để cập nhật liên hệ, bạn cần thực hiện một cuộc gọi đăng đến điểm cuối sau :
/update_contact/{contact_id}


                
Success Result Example:

{
    "status": "success"
}

Error Result Example:

{
    "status": "error",
    "message": "You should at least provide value for first name or last name or email or phone number"
}

{
    "status": "error",
    "message": "The contact ID does not exist"
}
                
            

PARAMETERS

Field Type Description
api_key String Your API key
contact_id Integer The contact ID to be updated for
email String (optional) The email address of the user
phone_number String (optional) The phone number of the user
first_name String (optional) The first name of the user
last_name String (optional) The last name of the user

Note: You can update first_name or last_name. You can update email or phone_number if they have not been added previously.

Xóa liên lạc

                
curl -X POST \
'https://cytechbot.com/api/delete_contact' \
-d 'api_key=api_key' \
-d 'contact_id=contact_id' 
                
            

Để xóa liên hệ, bạn cần thực hiện một cuộc gọi đăng đến điểm cuối sau:
/delete_contact


                
Success Result Example:

{
    "status": "success",
    "message": "The contact ID (3) has been deleted"
}

Error Result Example:

{
    "status": "error",
    "message": "The contact ID does not exist"
}
                
            

PARAMETERS

Field Type Description
api_key String Your API key
contact_id Integer The contact ID to be deleted

Nhận danh sách chiến dịch luồng

                
curl -X GET 'https://cytechbot.com/api/get_flow_campaigns/?api_key=api_key                
            

Để có được danh sách chiến dịch quy trình, bạn cần thực hiện cuộc gọi đến điểm cuối sau :
/get_flow_campaigns


                
Success Result Example:

[
    {
        "id": "1",
        "flow_name": "Flow Campaign 1"
    },
    {
        "id": "2",
        "flow_name": "Flow Campaign 2"
    },
    {
        "id": "3",
        "flow_name": "Flow Campaign 3"
    },
    {
        "id": "6",
        "flow_name": "Flow Campaign 4"
    }
]
                
            

PARAMETERS

Field Type Description
api_key String Your API key

Nhận thông tin chiến dịch luồng

                
curl -X POST 'https://cytechbot.com/api/get_flow_campaign_info/?api_key=api_key&flow_campaign_id=flow_campaign_id'
                
            

Để nhận thông tin chiến dịch quy trình, bạn cần thực hiện cuộc gọi đến điểm cuối sau:
/get_flow_campaign_info


                
Success Result Example:

{
    "id": "1",
    "flow_name": "serial check",
    "questions": [
        "What do you like to do?",
        "What is your favorite pet?",
        "What is your favorite color?",
        "Who is your favorite author?",
        "Which country do you love to live in?"
    ]
}

Error Result Example:

{
    "status": "error",
    "message": "The flow_campaign_id field is required"
}
                
            

PARAMETERS

Field Type Description
api_key String Your API key
flow_campaign_id Integer The ID of the flow campaign

Nhận thông tin về luồng người đăng ký

                
curl -X GET 'https://cytechbot.com/api/get_single_subscriber_flow_info/?api_key=api_key&flow_campaign_id=flow_campaign_id&subscriber_id=subscriber_id'
                
            

Để nhận thông tin về luồng người đăng ký, bạn cần thực hiện cuộc gọi đến điểm cuối sau:
/get_single_subscriber_flow_info


                
Success Result Example:

{
    "id": "1",
    "flow_name": "Flow Campaign 1",
    "data": [
        {
            "question_id": "45",
            "question": "What do you like to do?",
            "answer": "Reading, Traveling, Watching Movies"
        },
        {
            "question_id": "46",
            "question": "What is your favorite pet?",
            "answer": "Dog"
        },
        {
            "question_id": "47",
            "question": "What is your favorite color?",
            "answer": "Black"
        },
        {
            "question_id": "48",
            "question": "Who is your favorite author?",
            "answer": "Sigmund Freud"
        },
        {
            "question_id": "49",
            "question": "Which country do you love to live in?",
            "answer": "France"
        }
    ]
}

Error Result Example:

{
    "status": "error",
    "message": "The flow campaign ID does not exist"
}
                
            

PARAMETERS

Field Type Description
api_key String Your API key
flow_campaign_id Integer The ID of the flow campaign
subscriber_id Integer The ID of the flow campaign subscriber

Nhận thông tin về luồng người đăng ký

                
curl -X GET 'https://cytechbot.com/api/get_all_subscriber_flow_info/?api_key=api_key&flow_campaign_id=flow_campaign_id'
                
            

Để nhận thông tin về luồng người đăng ký, bạn cần thực hiện cuộc gọi đến điểm cuối sau:
/get_all_subscriber_flow_info


                
Success Result Example:

{
    "id": "1",
    "flow_name": "serial check",
    "data": {
        "2499454673490220": [
            {
                "question_id": "45",
                "question": "What do you like to do?",
                "answer": "Reading, Traveling, Watching Movies"
            },
            {
                "question_id": "46",
                "question": "What is your favorite pet?",
                "answer": "Dog"
            },
            {
                "question_id": "47",
                "question": "What is your favorite color?",
                "answer": "Black"
            },
            {
                "question_id": "48",
                "question": "Who is your favorite author?",
                "answer": "Sigmund Freud"
            },
            {
                "question_id": "49",
                "question": "Which country do you love to live in?",
                "answer": "France"
            }
        ],
        "3001440154747507": [
            {
                "question_id": "45",
                "question": "What do you like to do?",
                "answer": "Traveling, Watching Movies"
            },
            {
                "question_id": "46",
                "question": "What is your favorite pet?",
                "answer": "Cat"
            },
            {
                "question_id": "47",
                "question": "What is your favorite color?",
                "answer": "Blue"
            },
            {
                "question_id": "48",
                "question": "Who is your favorite author?",
                "answer": "William Shakespeare"
            },
            {
                "question_id": "49",
                "question": "Which country do you love to live in?",
                "answer": "Germany"
            }
        ]
    }
}
                
            

PARAMETERS

Field Type Description
api_key String Your API key
flow_campaign_id Integer The ID of the flow campaign