Notifiche Webhook

Configura un URL webhook per ricevere automaticamente un callback POST quando un rendering termina (successo o fallimento). Puoi impostare l'URL nella Console di Rendering o programmaticamente.

Imposta o Aggiorna l'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"}'

Attiva una Consegna di Test

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"
}
  • Il callback è una richiesta JSON POST inviata immediatamente dopo il termine del rendering.
  • Rispondi entro 5 secondi; i timeout non vengono riprovati.
  • Usa il campo status (success o failed) insieme a error_message/error_log_url per gestire i fallimenti in modo elegante.