Thông Báo Webhook

Cấu hình một URL webhook để tự động nhận một callback POST khi một lần render hoàn tất (thành công hoặc thất bại). Bạn có thể thiết lập URL trong Render Console hoặc thông qua lập trình.

Thiết Lập hoặc Cập Nhật URL Webhook

set-webhook.sh
curl -X POST https://render-api.chillin.online/user/webhook \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"url": "https://your-domain.com/webhook"}'

Kích Hoạt Giao Hàng Thử Nghiệm

test-webhook.sh
curl -X POST https://render-api.chillin.online/user/webhook/test \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"url": "https://your-domain.com/webhook"}'

Payload Webhook

webhook_payload.json
{
"render_id": 123,
"user_id": 456,
"status": "success",
"video_url": "https://cloud.chillin.online/video_xxx.mp4",
"json_url": "https://cloud.chillin.online/project_xxx.json",
"error_message": "",
"error_log_url": "",
"cost": 0.05,
"duration": 10.5,
"finished_at": "2024-01-01T12:00:00Z"
}
  • Callback là một yêu cầu JSON POST được gửi ngay lập tức sau khi lần render hoàn tất.
  • Phản hồi trong vòng 5 giây; các lần timeout sẽ không được thử lại.
  • Sử dụng trường status (success hoặc failed) cùng với error_message/error_log_url để xử lý các lỗi một cách hợp lý.