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
Authorization
string
chứa Access-Token
Request Body
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
} 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
id
string
id webhook bạn muốn xem chi tiết
Headers
Authorization
string
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
id
string
id webhook
Headers
Authorization
string
access token
Request Body
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
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
id
string
id webhook
Headers
Authorization
string
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
webhook
string
đường dẫn tới đầu api nhận webhook server của bạn
Headers
Authorization
string
Access-Token
Last updated
Was this helpful?