Batch query user profiles
Retrieve profile information for multiple users, including basic info and extended attributes.
Request method
POST: https://Base URL/v4/user/profile/batch/get
Rate limit: 100 requests per second
Signature required: All server API requests require signature verification. See API request signature.
Request body
The request body is in application/json format and supports the following parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
userIds | Array | Yes | User IDs. Maximum 20 per request. |
Request example
HTTP
POST /v4/user/profile/batch/get HTTP/1.1
Host: api.sg-light-api.com
App-Key: uwd1c0sxdlx2
Nonce: 14314
Timestamp: 1408710653491
Signature: xxxxxxxxxxxxxxxx
Content-Type: application/json
{
"userIds": [
"u1",
"u2"
]
}
Response
| Field | Type | Description |
|---|---|---|
code | Number | Status code. 0 indicates success. |
result | Object | Response data. |
result.users | Array | List of user profile objects. |
result.users fields:
| Field | Type | Description |
|---|---|---|
users[i].userId | String | The user ID. |
users[i].version | Number | Profile version number. |
users[i].userProfile | JSON KV | Basic user profile. |
users[i].userExtProfile | JSON KV | Extended user profile. |
userProfile fields:
| Key | Type | Length/Range | Description |
|---|---|---|---|
uniqueId | String | Max 32 characters | App-specific user 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 | 0 = unknown, 1 = male, 2 = female | Gender |
location | String | Max 32 characters | Location |
role | Int | 0–100 | Role |
level | Int | 0–100 | Level |
Response example
HTTP
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"code": 0,
"result": {
"users": [
{
"userId": "u1",
"version": 12343433499942,
"userProfile": {"birthday":"20011221","level":2},
"userExtProfile": {"ext1":"testext"}
},
{
"userId": "u2",
"userProfile": {"gender":1,"level":5}
}
]
}
}