Server APIs v2
  • Server APIs overview
  • Accessing Server APIs
  • Room signaling
  • Stream mixing
  • Streaming moderation
  • Streaming control
  • CDN recording
  • Server callbacks
  • Return codes
  • API testing
  • FAQ
  • Documentation
  • Server APIs v2
  • Server callbacks
  • Callback on recording completed

Callback on recording completed

Last updated:2023-04-17 18:27

1 Description

With CDN recording enabled and the related callback setup in place, the ZEGO server will send an event notification to the pre-configured server callback URL when a stream recording on CDN is completed.

2 Callback request

  • Request method: POST/JSON or POST/FORM

    • The default data format for requesting data is POST/JSON format. If you need to use the POST/FORM format, please contact ZEGOCLOUD technical support.
    • The form values in POST/FORM format need to be decoded with urldecode.
  • Request endpoint: The corresponding callback endpoint in the ZEGOCLOUD Admin Console. (Click here to learn how to config the callback endpoint)

  • Transmission protocol: HTTPS/HTTP (HTTPS is recommended).

  • 3 Request parameters

    Parameter Type Description
    stream_alias
    String
    Stream name, with a maximum length of 255 bytes. Same as the StreamID on the client side.
    replay_url
    String
    Playback URL, with a maximum length of 1024 bytes.
    begin_time
    String
    Start time,a Unix timestamp.
    end_time
    String
    End time, a Unix timestamp.
    timestamp
    String
    Server's current time, a Unix timestamp.
    nonce
    String
    A random number.
    signature
    String
    The signature for request authentication. For more details about the request signature, see Authenticating server-to-server Callbacks.
    appid
    String
    AppId。
    event
    String
    Event name. For this callback, the event name is "record".
    extra_params
    String
    Extension field.
    • If Wingsu CDN is used for recording, the parameter extra_params is defined as follows:
    Parameter Type Description
    PersistentId
    String
    The unique recording ID.
    Duration
    Float
    Recording duration.
    • If Tencent CDN is used for recording, the parameter extra_params is defined as follows:
    Parameter Type Description
    TaskId
    String
    The unique ID of the recording task.
    FileID
    String
    The unique ID of the recorded file.
    Duration
    Float
    Recording duration.

    4 Sample request

    Array
    (
        [stream_alias] => aaaa
        [replay_url] => replay_url
        [begin_time] => 1481597358
        [end_time] => 1481597358
        [extra_params] => extra_params
        [timestamp] => 1481597358
        [nonce] => 158273
        [signature] => signature
        [appid] => 1
        [event] => record
    )

    5 Sample response

    1

    A response "1" means that the request has completed successfully. Other responses indicate a failed request.

    6 Retry mechanism

    If the ZEGOCLOUD server does not receive a response, it will retry with intervals of 2s, 4s, 8s, 16s, and 32s respectively. If the retry still fails after an interval of 32s, it will no longer retry.

    Page Directory