Webhooks (Callback URL)

작업 상태 엔드포인트를 폴링하는 대신, 비디오 생성 작업이 완료, 실패 또는 취소될 때 실시간 HTTP POST 알림을 받을 수 있습니다.

콜백 설정

생성 요청에 callback_url을 포함하세요:

import requests

response = requests.post(
    "https://api.evolink.ai/v1/videos/generations",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json"
    },
    json={
        "model": "seedance-2.0",
        "prompt": "A sunset over the ocean, cinematic wide shot",
        "quality": "1080p",
        "callback_url": "https://yourapp.com/api/video-callback"
    }
)

콜백 페이로드

작업이 완료(또는 실패)되면 callback_url로 POST 요청이 전송됩니다. 응답 본문의 형식은 작업 조회 API 응답과 동일합니다:

완료

{
    "id": "task-unified-1756817821-4x3rx6ny",
    "object": "video.generation.task",
    "created": 1756817821,
    "model": "seedance-2.0",
    "status": "completed",
    "progress": 100,
    "results": [
        "https://cdn.example.com/videos/task-unified-1756817821-4x3rx6ny.mp4"
    ],
    "type": "video",
    "task_info": {
        "can_cancel": false
    }
}

실패

{
    "id": "task-unified-1756817821-4x3rx6ny",
    "object": "video.generation.task",
    "created": 1756817821,
    "model": "seedance-2.0",
    "status": "failed",
    "progress": 0,
    "type": "video",
    "task_info": {
        "can_cancel": false
    }
}

콜백 타이밍

  • 작업이 완료, 실패 또는 취소되었을 때 트리거됩니다
  • 과금 확인이 완료된 후 전송됩니다

콜백 요구 사항

요구 사항세부 내용
프로토콜HTTPS만 지원
타임아웃엔드포인트는 10초 이내에 응답해야 합니다
성공 응답수신 확인을 위해 2xx 상태 코드를 반환해야 합니다
재시도실패 시 최대 3회 재시도 (1초, 2초, 4초 후)
URL 길이최대 2048
네트워크내부/사설 IP는 사용할 수 없습니다 (127.0.0.1, 10.x.x.x, 172.16-31.x.x, 192.168.x.x)

관련 문서