logo
Video Call
Server API
Stream Mixing and Transcoding APIs
On this page

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.

Warning

After receiving the media file merge completed callback, it is recommended to retrieve relevant information after 5 seconds.

Callback instructions

  • Request method: POST.
Note

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

ParameterTypeDescription
appidStringAppId.
eventStringCallback event. This callback returns compose.
replay_urlStringReplay URL of the merged media file, not exceeding 1024 bytes.
task_idStringTask ID, the same as the TaskId carried in the Data parameter of the Merge Media Files interface response.
file_idStringFile 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.
codeStringError code. 0 indicates success, other values indicate failure:
  • 40000: Input parameter is invalid, please check the input parameters
  • 60000: Source file error (e.g., video data is corrupted), please confirm if the source file is normal
  • 70000: Internal service error, retry is recommended
Only needs attention when the CDN vendor is Tencent Cloud.
messageStringError message.Only needs attention when the CDN vendor is Tencent Cloud.
timestampStringServer current time, Unix timestamp.
nonceStringRandom number.
signatureStringVerification 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.

Previous

Recording File Generated Callback

Next

On-Demand Transcoding Completed Callback

On this page

Back to top