API & Webhooks Documentation
Authentication
Tất cả API requests cần header:
Authorization: Bearer <YOUR_API_KEY>
Lấy API Key tại Settings > Developer.
Webhook (Incoming)
Dùng để trigger workflow từ hệ thống bên ngoài (VD: Có đơn hàng mới từ ERP -> Chạy workflow).
- Tạo Workflow mới -> Trigger: Webhook.
- Copy Webhook URL:
https://api.nextgen.ai/v1/webhooks/catch/wk_12345. - Gửi POST request:
POST /v1/webhooks/catch/wk_12345
{
"order_id": "ORD-999",
"customer": "Nguyen Van A",
"total": 500000
}
- Trong Workflow, dùng biến:
{{steps.trigger.body.order_id}}.
REST API (Outgoing)
Gọi API để lấy thông tin.
GET /api/v1/tickets
- Lấy danh sách ticket.
- Params:
status,assignee.
POST /api/v1/workflows/:id/run
- Chạy thủ công một workflow.