Query user information
Description
This API allows you to retrieve information for multiple users based on their user IDs. The response includes each user's name, avatar, and other extended fields.
Request method and endpoint
- Request method: POST
- Request endpoint:
https://zim-api.zego.im/?Action=QueryUserInfos
- Transmission protocol: HTTPS
- Rate limit: 20 requests/second
Request parameters
Listed below are the parameters specific to this request and part of the public request parameters. For the complete list of public request parameters, see Accessing Server APIs - Public parameters.
Parameter | Type | Required | Description |
---|---|---|---|
UserIds[] | Array of String | Yes | The list of user IDs to be queried, up tp 100 user IDs can be queried. Each user ID should be less than 64 bytes. |
The UserId
can only contain numbers, letters, and the following special characters: !#$%&()+-:<=.>?@[]^_|~.
Sample request
-
Request URL
Untitledhttps://zim-api.zego.im/?Action=QueryUserInfos &<Common request parameters>
1 -
Request body
Untitled{ "UserIds": ["userA","userB","userC"] }
1
Response parameters
Parameter | Type | Description |
---|---|---|
Code | Number | Return code. |
Message | String | Description of the request execution result. |
RequestId | String | Request ID. |
Result | Object | Results of the successful query. |
└UserId | String | User ID of successful query. |
└UserName | String | User name. |
└UserAvatar | String | User avatar address. |
└Extra | String | Extra fileld. |
ErrorList | Object | The list of query failures. |
└UserId | String | User ID of failed query. |
└SubCode | Number | Return code indicating query failure. The returned code when the query fails. This parameter is only returned when |
Sample response
{
"Code": 0,
"Message": "success",
"RequestId": "343649807833778782",
"Result": [
{
"UserId": "UserA",
"UserName": "userName",
"UserAvatar": "avatar",
"Extra": "extra"
}
],
"ErrorList": [
{
"UserId": "UserB",
"SubCode": 660000002
}
]
}
Return codes
Listed below are the return codes related to this API. For the complete list of return codes, see Return codes|_balnk.
return code | Description |
---|---|
660000001 | Business related general error. Please try again or contact ZEGOCLOUD Technical Support. |
660000002 | Invalid parameter. The parameter entered is missing or invalid. Please check the parameters. |
660300005 | The QPS limit specified in AppID is exceeded. Try again later. |
660700008 | Failed to get user information. Please check the user IDs or contact ZEGOCLOUD Technical Support. |
660700015 | The user is not registered. Please register the user first. |