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

User Logged in Callback


Description

When developers need to know information about users currently in a Room, they can receive the "User Logged in Callback" and analyze it in combination with the User Logged out Callback.

Callback instructions

  • Request method: POST。
Note

The callback data format is JSON, you need to decode it with UrlDecode.

  • Request URL: Please configure the callback URL in the ZEGOCLOUD console.
  • Transfer protocol: HTTPS/HTTP, HTTPS is recommended.

Callback parameters

Common parametersTypeDescription
eventStringCallback event, this callback returns room_login.
appidStringUnique identifier of the App.
timestampStringServer current time, Unix timestamp, unit: seconds.
nonceStringRandom number.
signatureStringVerification string, for details see Verification instructions.
Business parametersTypeDescription
room_idStringRoom ID.
room_nameStringRoom name.
room_seqString

Unique identifier of the Room lifecycle, remains unchanged during the entire lifecycle of the Room.
After the Room is created, a unique room_seq will be generated; if the Room is destroyed and then a new Room is created with the same room_id, a new unique room_seq will be generated.

This parameter is consistent with the parameter room_session_id in the Room created callback and Room destroyed callback.

user_accountStringUser ID of the user Logged in to the Room (userID used when the client logs in).
user_nicknameStringUsername of the user Logged in to the Room (userName used when the client logs in).
session_idStringUser session ID of the user Logged in to the Room.
login_timeStringServer current time when the user Logged in to the Room, Unix timestamp, unit: milliseconds.
user_roleString

User role of the user Logged in to the Room.

  • 1: Host.
  • 2: Audience.
  • 4: Admin, this type of user mainly exists in scenarios such as cloud Recording and audio/video stream moderation. Client SDK user-related interfaces will filter this type of user.

This return parameter is only meaningful when integrating LiveRoom SDK. Please ignore this parameter when integrating Express SDK.

auth_levelString

Authentication level when the user Logged in.

  • 0: Non-Token authentication succeeded.
  • 1: Token version 01.
  • 2: Token version 02.
  • 3: Token version 03.
  • 4: Token version 04.
reloginString

Relogin identifier.

  • 0: First Login.
  • 1: Relogin.
user_update_seqStringRoom user list change seq, increments by 1 when a user Logged in or Logged out.
callback_dataStringCustom callback information when the user Logged in, defaults to an empty string.
Note

It is recommended to convert some parameters to Int for logical processing. Related fields include appid, login_time, room_seq, session_id, timestamp, user_role, auth_level, and user_update_seq.

Data example

{
    "event": "room_login",
    "appid": "1",
    "timestamp": "1499676978",
    "nonce": "350176",
    "signature": "signature",
    "room_id": "rid_1242649",
    "room_name": "room#123",
    "room_seq": "6085791336856668982",
    "user_account": "888120154",
    "user_nickname": "888120154",
    "session_id": "792148503087288320",
    "login_time": "1499676978027",
    "user_role": "2",
    "auth_level": "4",
    "relogin": "0",
    "user_update_seq": "1",
    "callback_data": "user login"
}

Return response

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

Callback retry strategy

If ZEGOCLOUD server does not receive a response, or the received HTTP status code is not 2XX (e.g. 200), it will try to retry, up to 5 retries. The interval between each retry request and the previous request is 2s, 4s, 8s, 16s, 32s respectively. If the 5th retry still fails, no more retries will be made and the callback will be lost.

Previous

Room destroyed Callback

Next

User Logged out Callback

On this page

Back to top