API ReferenceWebhooks
Tạo webhook
POST
Tối đa 5 webhook mỗi môi trường. secret chỉ trả về một lần trong response này; mất thì xoá webhook và tạo lại.
ApiKeyAuthheader
Authorization<token>Authorization: ApiKey <key>. Key sandbox bắt đầu bằng gc_test_, production bằng gc_live_.
Key chỉ hiện một lần lúc tạo. Không dùng key trong app di động hay trình duyệt.
application/json- body
title*stringLength
length <= 100url*stringBắt buộc HTTPS
Format
urievents*array<>Items
1 <= itemsheaders?array<>Items
items <= 10Đã tạo
application/json- response
success*booleandata*curl -X POST 'https://api-stag.gocheap.vn/open-api/v1/webhooks' \ -H 'Content-Type: application/json' \ -d '{ "title": "Hệ thống đặt phòng", "url": "https://api.example.com/gocheap/webhook", "events": [ "booking.driver_assigned", "booking.completed", "booking.cancelled" ], "headers": [ { "key": "X-Source", "value": "gocheap" } ]}'Example Response
{ "success": true, "data": { "id": "string", "title": "string", "url": "http://example.com", "events": [ "booking.created" ], "headers": [ { "key": "string", "value": "string" } ], "is_active": true, "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z", "secret": "string" }}