Overview
The IM Server stores user information for displaying message sender and conversation details. When user information changes, call this API to synchronize the updated information with the IM service.
User information synchronization
After user information is updated, the IM service does not proactively notify clients. When a message is sent in a conversation associated with the user, the IM service automatically synchronizes the latest user information to the client.
Request
Authentication: Add authentication headers to the request. See Authentication.
Method:
POST
Rate limit:
100 requests/second
Endpoint: https://API domain/apigateway/users/update
Content-Type:
application/json
Request Parameters
| Parameter | Data Type | Required | Description | |
|---|---|---|---|---|
| user_id | string | Yes | ID of the user to update. Maximum length: 32 characters. | |
| nickname | string | No | Nickname. Maximum length: 50 characters. | |
| user_portrait | string | No | Avatar URL. Maximum length: 200 characters. | |
| ext_fields | map | No | Additional fields. Keys can contain up to 50 characters; values can contain up to 2,000 characters. |
Request Example
POST /apigateway/users/update HTTP/1.1
appkey: appkey
signature: 2e639ae3600a4sdff61fb88b76f485b
nonce: nonce
timestamp: 1672568121910
Content-Type: application/json
{
"user_id":"userid1",
"nickname":"user1",
"user_portrait":"xxxxx",
"ext_fields":{
"field1":"aaa",
"field2":"bbb"
}
}
Response Example
{
"code":0,
"msg":"sucess"
}