Synchronize Hosted Profile Changes
When user profiles change in your app, you can synchronize the updated profiles in real time to your application server.
Enable the Service
Before calling this API, enable the profile hosting service by submitting a ticket.
Callback Method
Request method: POST
Data format: application/json
The IM service adds signature parameters to the POST request URL. Verify the caller's identity and data validity using the signature. For details, see Server Callback Signature.
Request Body Parameters
The HTTP request body uses application/x-www-form-urlencoded
format and supports these form parameters:
Parameter | Type | Required | Description |
---|---|---|---|
userId | String | Yes | User ID |
type | Int | Yes | Change type: 0: Clear 1: Modify |
time | Long | Yes | Modification timestamp |
userProfile | String | No | Modified basic user profile (JSON format) |
userExtProfile | String | No | Modified extended user profile (JSON format) |
Callback Example
This example assumes your configured callback URL is http://example.com/user/profile/sync.php.
POST /user/profile/sync HTTP/1.1
Host: example.com
Content-Type: application/json
{
"userId":"uid1",
"time":1574476797772,
"userProfile": {"uniqueId":"testAppName","level":2},
"userExtProfile": {"ext_Profile":"testExt"}
}
Respond to Callback Requests
tip
- The service considers the status synchronized upon receiving an HTTP
200 OK
response. - If the response times out after 5 seconds, the service retries twice. After 3 total failures, it stops synchronizing this status.
- If multiple timeouts occur simultaneously, callback requests pause for 1 minute before resuming.