Skip to main content

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:

ParameterTypeRequiredDescription
userIdStringYesUser ID
userProfileStringNoUser basic information in JSON format.
userExtProfileStringNoUser 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:

KeyTypeLength/RangeDescription
uniqueIdString≤32 charsUser application ID
nameString≤64 charsNickname
portraitUriString≤1024 charsAvatar URL
emailString≤128 charsEmail address
birthdayString≤32 charsBirthday
genderIntValues:
- 0: Unknown
- 1: Male
- 2: Female
Gender
locationString≤32 charsLocation
roleInt0-100Role
levelInt0-100Level

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:

FieldTypeDescription
codeNumberStatus code (200 indicates success)
profileKeyStringIf code ≠ 200, returns the failed key

Response Example

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
"code": 200
}