Overview
Query the online status of multiple users. Use this API to display users' initial status. To receive real-time online and offline status updates, use User Online/Offline Status Subscriptions.
Request
Authentication: Add authentication headers to the request. See Authentication.
Method:
POST
Rate limit:
100 requests/second
Endpoint: https://API domain/apigateway/users/onlinestatus/query
Content-Type:
application/json
Request Parameters
| Parameter | Data Type | Required | Description | |
|---|---|---|---|---|
| user_ids | array | Yes | List of user IDs to query. Each user ID can contain up to 32 characters. |
Request Example
POST /apigateway/users/onlinestatus/query HTTP/1.1
appkey: appkey
signature: 2e639ae3600a4sdff61fb88b76f485b
nonce: nonce
timestamp: 1672568121910
Content-Type: application/json
{
"user_ids":["userid1","userid2"]
}
Response Parameters
| Parameter | Data Type | Description | |
|---|---|---|---|
| user_id | string | User ID. | |
| is_online | bool | Whether the user is online. |
Response Example
{
"code":0,
"msg":"sucess",
"data":{
"items":[
{
"user_id":"user1",
"is_online":true
},
{
"user_id":"user2",
"is_online":false
}
]
}
}