Batch Query User Profiles
Retrieve information for specified users in bulk, including both basic user information and extended information.
Enable the Service
Before calling this API, enable the profile hosting service by submitting a ticket.
Request Method
POST: https://data center domain/user/profile/batch/query.json
Rate Limit: 100 requests per second
Signature Rule: All server API requests require signature verification. See API Request Signature for details.
Request Parameters
The HTTP request body uses application/x-www-form-urlencoded
format and supports the following form parameters:
Parameter | Type | Required | Description |
---|---|---|---|
userId | Array | Yes | User IDs (maximum 100 per request) |
Request Example
POST /user/profile/batch/query.json HTTP/1.1
Host: api.rong-api.com
App-Key: uwd1c0sxdlx2
Nonce: 14314
Timestamp: 1408710653491
Signature: 45beb7cc7307889a8e711219a47b7cf6a5b000e8
Content-Type: application/x-www-form-urlencoded
userId=u1&userId=u2
Response
The HTTP response body contains a JSON object with the following structure:
Field | Type | Description |
---|---|---|
code | Number | Status code (200 indicates success) |
userList | JSONArray | List of user information |
userList structure |
userList structure details:
Field | Type | Description |
---|---|---|
userList[i].userId | String | User ID |
userList[i].version | long | User profile version number |
userList[i].userProfile | String | Basic user information (JSON format) |
userList[i].userExtProfile | String | Extended user information (JSON format) |
userProfile
keys:
Key | Type | Length/Range | Description |
---|---|---|---|
uniqueId | String | Max 32 characters | User application ID |
name | String | Max 32 characters | Nickname |
portraitUri | String | Max 128 characters | Avatar URL |
email | String | Max 128 characters | Email address |
birthday | String | Max 32 characters | Birthday |
gender | Int | Values:
| Gender |
location | String | Max 32 characters | Location |
role | Int | 0-100 | Role |
level | Int | 0-100 | Level |
Response Example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"code": 200,
"userList": [
{
"userId": "u1",
"version": 12343433499942,
"userProfile": {"birthday":"20011221","level":2},
"userExtProfile": {"ext_1":"testext"}
},
{
"userId": "u2",
"userProfile": {"gender":1,"level":5}
}
]
}