Callback Protocol
As for the Async task(image generation / video generation / virtual try-on),if you actively set the callback_url when you Create Task, the server will actively notify you when the task status changes, and the protocol is as follows:
JSONCopyCollapse
1234567891011121314151617181920212223242526272829{
"task_id": "string", //Task ID, generated by the system
"task_status": "string", //Task status, Enum values:submitted、processing、succeed、failed
"task_status_msg": "string", //Task status information, displaying the failure reason when the task fails (such as triggering the content risk control of the platform, etc.)
"created_at": 1722769557708, //Task creation time,UniTask creation time,Task update time, Unix timestamp, unit msask update time, Unix timestamp, unit msask update time, Unix timestamp, unit msask update time, Unix timestamp, unit msask update time, Unix timestamp, unit msUnix timestamp, unit msd_at": 1722769557708, //Task update time, Unix timestamp, unit ms
"task_info":{ //Task creation parameters
"parent_video": {
"id": "string", //Generated video ID; globally unique
"url": "string", //URL for generating images(To ensure information security, generated images/videos will be cleared after 30 days. Please make sure to save them promptly.)
"duration": "string" //Total duration of the video before continuation, in s
},
"external_task_id": "string" //Customer-defined task ID
}, //Detailed information provided by the user during task creation.
"task_result":{
"images":[ //The result of image-related tasks
{
"index": int, //Image Number
"url": "string" // URL for generating images,such as:https://h1.inkwai.com/bs2/upload-ylab-stunt/1fa0ac67d8ce6cd55b50d68b967b3a59.png(To ensure information security, generated images/videos will be cleared after 30 days. Please make sure to save them promptly.)
}
],
"videos":[ //The result of video-related tasks
{
"id": "string", //Generated video ID; globally unique
"url": "string", //URL for generating videos(To ensure information security, generated images/videos will be cleared after 30 days. Please make sure to save them promptly.)
"duration": "string" //Total video duration, unit: s (seconds)
}
]
}
}
Last updated