Query user's online status
Description
Query the user's online status, and support querying a single user or multiple users' online status in batches.
Request method and endpoint
- Request method: GET
- Request URL:
https://zim-api.zego.im/?Action=QueryUserOnlineState
- Transmission protocol: HTTPS
- QPS limit: 20 requests/second
Request parameters
Listed below are the parameters specific to this request and part of the common request parameters. For the complete list of common request parameters, see Accessing Server APIs - Common parameters.
Parameter | Type | Required | Description |
---|---|---|---|
UserId[] | Array of String | Yes | The list of user IDs to be queried, up tp 100 user IDs can be queried. For example: UserId[]=a&UserId[]=b |
The UserId
can only contain numbers, letters, and the following special characters: !#$%&()+-:;<=.>?@[]^_{}|~ .
Sample request
https://zim-api.zego.im/?Action=QueryUserOnlineState
&UserId[]=a&UserId[]=b
&<Common parameters>
Response parameters
Parameter | Type | Description |
---|---|---|
Code | Number | Return code. |
Message | String | Description of the request execution result. |
RequestId | String | Request ID. |
Result | Object | The result fo the quert to the user's online status. |
ErrorList | Object | The list of query failures. |
Among which, the returned field ErrorList:
Parameter | Type | Description |
---|---|---|
SubCode | Number | The returned code when the query fails. This parameter is only returned when |
Sample response
{
"Code":0,
"Message":"success",
"RequestId":"343649807833778782"
"Result": [
{
"UserId": "id1",
"Status": "Offline"
},
{
"UserId": "id2",
"Status": "Online"
}
],
"ErrorList": [
{
"UserId": "id4",
"SubCode": 1
}
]
}
Return codes
Listed below are the return codes related to this API. For the complete list of return codes, see Return codes.
return code | Description |
---|---|
660000011 | The number of users has exceeded the limit. |