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 logged in room

Callback on logged in room

Last updated:2023-11-06 11:50

1 Description

After you configure this callback for the specified project, this callback will be triggered when users log in to the room.

When the ZEGOCLOUD server does not receive a response and the callback after two request attempts, the callback may be lost.

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
    user_account
    String
    User account ID.
    user_nickname
    String
    User nickname.
    session_id
    String
    User session ID.
    room_id
    String
    Room ID.
    room_seq
    String
    The unique identifier of the room's lifetime.
    For example, the user's room_id is r1 for two logins, but the room_seq of the first login is 123, and the room_seq of the second login is 234. At this time, the room_seq (123) room can only be created after the room is destroyed. Although the room_id is the same, it is a different room.
    room_name
    String
    Room name.
    login_time
    Int
    User login room timestamp, unit: milliseconds.
    timestamp
    Int
    The current server time, Uinx timestamp.
    nonce
    String
    Random number.
    signature
    String
    appid
    String
    The unique Application ID assigned to your project by ZEGOCLOUD.
    event
    String
    Callback event, the return value of this callback is room_login.

    4 Sample request

    • POST/JSON
    {
        "user_account": "888120154",
        "user_nickname": "888120154",
        "session_id": "0",
        "room_id": "rid_1242649",
        "room_seq": "6085791336856668982",
        "room_name": "room#123",
        "login_time": 1499676978027,
        "timestamp": 1499676978,
        "nonce": "350176",
        "signature": "signature",
        "appid": "1",
        "event": "room_login"
    }
    • POST/FORM
    Array
    (
        [user_account] => 888120154
        [user_nickname] => 888120154
        [session_id] => 0
        [room_id] => rid_1242649
        [room_seq] => 6085791336856668982
        [room_name] => room#123
        [login_time] => 1499676978027
        [timestamp] => 1499676978
        [nonce] => 350176
        [signature] => signature
        [appid] => 1
        [event] => room_login
    )

    5 Sample response

    Returning an HTTP status code of 2XX (e.g., 200) indicates success, and other responses indicate failure.

    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