Set User Information
Configure application user information, including basic information (userProfile
) and extended information (userExtProfile
). Basic information consists of common attributes for all users, such as nickname, gender, email, and birthday. Extended information refers to customizable additional fields.
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/set.json
Rate Limit: 100 requests per second
Signature Rules: All server API requests require signature verification. See API Request Signature.
Request Parameters
The HTTP request body uses application/x-www-form-urlencoded
format and supports the following form parameters:
Parameter | Type | Required | Description |
---|---|---|---|
userId | String | Yes | User ID |
userProfile | String | No | User basic information in JSON format. |
userExtProfile | String | No | User extended information in JSON format. Keys must: - Contain only English letters (case-sensitive) - Not exceed 32 characters - Use ext_ prefix Values must be strings not exceeding 256 characters. Default limit: 20 key-value pairs. Note: You must first add custom attributes in the Console before submitting extended information. |
userProfile
keys:
Key | Type | Length/Range | Description |
---|---|---|---|
uniqueId | String | ≤32 chars | User application ID |
name | String | ≤64 chars | Nickname |
portraitUri | String | ≤1024 chars | Avatar URL |
email | String | ≤128 chars | Email address |
birthday | String | ≤32 chars | Birthday |
gender | Int | Values: - 0 : Unknown- 1 : Male- 2 : Female | Gender |
location | String | ≤32 chars | Location |
role | Int | 0-100 | Role |
level | Int | 0-100 | Level |
Request Example
POST /user/profile/set.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&userProfile={"name":"Nick"}&userExtProfile={"ext_Profile":"testpro1"}
Response
The HTTP response body contains a JSON object with this structure:
Field | Type | Description |
---|---|---|
code | Number | Status code (200 indicates success) |
profileKey | String | If code ≠ 200, returns the failed key |
Response Example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"code": 200
}