Media File Merge Completed Callback
Description
When a callback URL is configured before calling Merge Media Files and the CDN vendor is Tencent Cloud or Huawei Cloud, this callback will be received when the merge task is completed. The callback will make a POST request to the callback URL.
After receiving the media file merge completed callback, it is recommended to retrieve relevant information after 5 seconds.
Callback instructions
- Request method: POST.
The callback data format is JSON. You need to perform UrlDecode decoding on it.
- Request URL: Please contact ZEGOCLOUD Technical Support to configure the callback URL.
- Transfer protocol: HTTPS/HTTP. HTTPS is recommended.
Callback parameters
| Parameter | Type | Description |
|---|---|---|
| appid | String | AppId. |
| event | String | Callback event. This callback returns compose. |
| replay_url | String | Replay URL of the merged media file, not exceeding 1024 bytes. |
| task_id | String | Task ID, the same as the TaskId carried in the Data parameter of the Merge Media Files interface response. |
| file_id | String | File ID, the same as the FileId carried in the Data parameter of the Search Media Information interface response.Only returned when the CDN vendor is Tencent Cloud. |
| code | String | Error code. 0 indicates success, other values indicate failure:
|
| message | String | Error message.Only needs attention when the CDN vendor is Tencent Cloud. |
| timestamp | String | Server current time, Unix timestamp. |
| nonce | String | Random number. |
| signature | String | Verification string. For details, see Callback instructions - Verification instructions. |
Data example
{
"appid": "1",
"event": "compose",
"replay_url": "replay_url",
"task_id": "task_id",
"file_id": "5285890813218549789",
"code": "0",
"message": "message",
"timestamp": "1481597358",
"nonce": "158273",
"signature": "signature"
}Return response
Return HTTP status code 2XX (e.g., 200) indicates success, and other responses indicate failure.
Callback retry strategy
If the ZEGO server does not receive a response, or the received HTTP status code is not 2XX (e.g., 200), it will attempt to retry, up to 5 retries. The interval between each retry request and the previous request is 2s, 4s, 8s, 16s, and 32s respectively. If the 5th retry still fails, no more retries will be made, and the callback will be lost.
