Casso Developer
v1
v1
  • Tổng quan
  • Webhook
    • Thiết lập Webhook thủ công
    • Lập trình xử lý sự kiện Webhook
  • API KEY
    • Tạo API Key thủ công
  • OAuth 2
    • Tích hợp OAuth2
  • Thực hành
    • Tích hợp xác nhận thanh toán
  • Change log
    • Change log
  • Danh sách API
    • API lấy Acess-Token
    • API lấy thông tin user
    • API thiết lập webhook
    • API tải thông tin giao dịch
    • API check giao dịch mới
  • Tài nguyên khác
    • Tài khoản ngân hàng Demo
Powered by GitBook
On this page
  • Tạo webhook
  • Chi tiết
  • Cập nhật
  • Xoá một webhook
  • Xoá tất cả webhook trong đường dẫn

Was this helpful?

  1. Danh sách API

API thiết lập webhook

Thay vì thiết lập webhook thủ công thì nay Casso cung cấp endpoint để có thể thiết lập webhook tự động.

Tạo webhook

POST https://oauth.casso.vn/v1/webhooks

Thực hiện tạo webhook tới server của bạn

Headers

Name
Type
Description

Authorization

string

chứa Access-Token

Request Body

Name
Type
Description

income_only

boolean

là giá trị được thiết lập để có gửi webhook đối với tiền vào hay không

secure_token

string

mã bảo mật

webhook

string

đường dẫn tới api đầu nhận webhook server của bạn

{
    "error": 0,
    "message": "success",
    "data": {
        "id": 114,
        "channel": "webhook",
        "param1": "https://ten-mien-cua-ban.com/wc/handler-bank-transfer.php",
        "param2": "",
        "send_only_income": 1
    }
}
{
    "error": 401,
    "message": "Unauthorized Access",
    "data": null
}
curl --location --request POST 'https://oauth.casso.vn/v1/webhooks' \
--header 'Authorization: Access token' \
--header 'Content-Type: application/json' \
--data-raw '{
    "webhook": "https://ten-mien-cua-ban.com/wc/handler-bank-transfer.php",
    "secure_token": "@123#abc",
    "income_only": true
}'

Chi tiết

GET https://oauth.casso.vn/v1/webhooks/:id

Xem chi tiết các thông về webhook của bạn theo webhook Id

Path Parameters

Name
Type
Description

id

string

id webhook bạn muốn xem chi tiết

Headers

Name
Type
Description

Authorization

string

Access-Token

{
    "error": 0,
    "message": "success",
    "data": {
        "id": 111,
        "channel": "webhook",
        "param1": "https://ten-mien-cua-ban.com.vn/wc/handler-bank-transfer.php",
        "param2": "",
        "send_only_income": 1
    }
}
{
    "error": 401,
    "message": "Unauthorized Access",
    "data": null
}
curl --location --request GET 'https://oauth.casso.vn/v1/webhooks/134' \
--header 'Authorization: Access-Token'

Cập nhật

PUT https://oauth.casso.vn/v1/webhooks/:id

Cập nhật các thông tin trong webhook đã được thiết lập trước đó

Path Parameters

Name
Type
Description

id

string

id webhook

Headers

Name
Type
Description

Authorization

string

access token

Request Body

Name
Type
Description

income_only

boolean

xác nhận gửi webhook tiền vào

secure_token

string

mã bảo mật

webhook

string

đường dẫn tới đầu api nhận webhook server của bạn

{
    "error": 0,
    "message": "success",
    "data": {
        "id": 111,
        "channel": "webhook",
        "param1": "https://webhook-cua-ban.com.vn",
        "param2": "sdf",
        "send_only_income": 1
    }
}
{
    "error": 401,
    "message": "Unauthorized Access",
    "data": null
}
curl --location --request PUT 'https://oauth.casso.vn/v1/webhooks/111' \
--header 'Authorization: Access-Token' \
--header 'Content-Type: application/json' \
--data-raw '{
    "webhook": "https://ten-mien-cua-ban.com/api/bank",
    "secure_token": "@xyz@123",
    "income_only": "false"
}'

Xoá một webhook

DELETE https://oauth.casso.vn/v1/webhooks/:id

Thực hiện xóa một webhook bằng id webhook

Path Parameters

Name
Type
Description

id

string

id webhook

Headers

Name
Type
Description

Authorization

string

Access-Token

{
    "error": 0,
    "message": "success",
    "data": {
        "id": 111,
        "channel": "webhook",
        "param1": "https://khanh-dep-trai.com.vn",
        "param2": "sdf",
        "send_only_income": 1
    }
}
{
    "error": 401,
    "message": "Unauthorized Access",
    "data": null
}
curl --location --request DELETE 'https://oauth.casso.vn/v1/webhooks/85' \
--header 'Authorization: Access-Token'

Xoá tất cả webhook trong đường dẫn

DELETE https://oauth.casso.vn/v1/webhooks

Xóa tất cả các webhook đang tồn tại trong đường dẫn webhook trùng với đường dẫn của bạn ( Nếu đã tạo trước đó rồi thì phải xóa mà đúng không! )

Query Parameters

Name
Type
Description

webhook

string

đường dẫn tới đầu api nhận webhook server của bạn

Headers

Name
Type
Description

Authorization

string

Access-Token

{
    "error": 0,
    "message": "success",
    "data": [
        {
            "id": 108,
            "channel": "webhook",
            "param1": "https://ten-mien-cua-ban.com/wc/handler.php",
            "param2": "",
            "send_only_income": 1
        },
        {
            "id": 109,
            "channel": "webhook",
            "param1": "https://ten-mien-cua-ban.com/wc/handler.php",
            "param2": "",
            "send_only_income": 1
        },
        {
            "id": 110,
            "channel": "webhook",
            "param1": "https://ten-mien-cua-ban.com/wc/handler.php",
            "param2": "",
            "send_only_income": 1
        },
    ]
}
{
    "error": 401,
    "message": "Unauthorized Access",
    "data": null
}
{
    "error": 12,
    "message": "Webhook not exists",
    "data": null
}
curl --location --request DELETE 'https://oauth.casso.vn/v1/webhooks?webhook=https://websitecuaban.com/api/webhook' \
--header 'Authorization: Access-Token'
PreviousAPI lấy thông tin userNextAPI tải thông tin giao dịch

Last updated 3 years ago

Was this helpful?