User Logged out Callback
Description
When developers need to know the number of users currently in the Room, they can be notified when users Logged out of the Room, and analyze it in combination with the User Logged in Callback.
Callback instructions
- Request method: POST。
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 parameters | Type | Description |
|---|---|---|
| event | String | Callback event, this callback returns room_logout. |
| appid | String | Unique identifier of the App. |
| timestamp | String | Server current time, Unix timestamp, unit: seconds. |
| nonce | String | Random number. |
| signature | String | Verification string, for details see Verification instructions. |
| Business parameters | Type | Description |
| room_id | String | Room ID. |
| room_seq | String | Unique identifier of the Room lifecycle, remains unchanged during the entire lifecycle of the Room. This parameter is consistent with the parameter room_session_id in the Room created callback and Room destroyed callback. |
| user_account | String | User ID of the user Logged in to the Room (userID used when the client logs in). |
| user_nickname | String | Username of the user Logged in to the Room (userName used when the client logs in). |
| session_id | String | User session ID of the user Logged in to the Room. |
| login_time | String | Server current time when the user Logged in to the Room, Unix timestamp, unit: milliseconds. |
| logout_time | String | Server current time when the user Logged out of the Room, Unix timestamp, unit: milliseconds. |
| reason | String | Reason for the user to Logged out of the Room.
|
| user_role | String | User role of the user Logged in to the Room.
This return parameter is only meaningful when integrating LiveRoom SDK. Please ignore this parameter when integrating Express SDK. |
| user_update_seq | String | Room user list change seq, increments by 1 when a user Logged in or Logged out. |
It is recommended to convert some parameters to Int for logical processing. Related fields include appid, login_time, logout_time , reason, room_seq, session_id, timestamp, user_role, and user_update_seq.
Data example
{
"event": "room_logout",
"appid": "1",
"timestamp": "1499676978",
"nonce": "350176",
"signature": "signature",
"room_id": "rid_1242649",
"room_seq": "6085791336856668982",
"user_account": "888120154",
"user_nickname": "888120154",
"session_id": "792462300429684736",
"login_time": "1663740623660",
"logout_time": "1663740627986",
"reason": "0",
"user_role": "1",
"user_update_seq": "13"
}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.
