Modify user information
Overview
You can call this operation to modify user information, including the nickname and avatar.
After user information is successfully modified, the user receives the notification in the following ZIM SDK callbacks.
iOS | Android | macOS | Windows | |
---|---|---|---|---|
userInfoUpdated | onUserInfoUpdated | userInfoUpdated | onUserInfoUpdated | |
Web | Flutter | Unity3D | React Native | |
userInfoUpdated | onUserInfoUpdated | OnUserInfoUpdated | userInfoUpdated |
Operation prototype
- Request method: POST
- Request URL:
https://zim-api.zego.im/?Action=ModifyUserInfo
- Protocol: HTTPS
- QPS limit: 20 calls per second
Request parameters
The following table describes only the operation-specific request parameters and some common request parameters. For the complete list of common request parameters, see the Public request parameters section of the Accessing Server APIs topic.
Parameter | Type | Required | Description |
UserInfo | Array of Object | Yes | The list of IDs of users whose information is to be modified. Up to 100 user IDs can be included. |
└UserId | String | Yes | The ID of the user whose information is to be modified. |
└UserName | String | No | The new username, which cannot exceed 256 bytes in length. |
└UserAvatar | String | No | The new URL of the user avatar, which cannot exceed 500 bytes in length. |
└Extra | String | No | Additional user information, which cannot exceed 2 KB in size. If you need a higher limit (32 KB at maximum), contact ZEGOCLOUD technical support. |
Sample request
-
Request URL
Untitledhttps://zim-api.zego.im/?Action=ModifyUserInfo&<Common request parameters>
1 -
Request body
Untitled{ "UserInfo": [ { "UserId": "aaa", "UserName": "userNamea", "UserAvatar": "http", "Extra": "extra info" }, { "UserId": "bbb", "UserName": "userNameb", "UserAvatar": "http" } ] }
1
Response parameters
Parameter | Type | Description |
---|---|---|
Code | Number | The return code. |
Message | String | The description of the operation result. |
RequestId | String | The request ID. |
ErrorList | Array of Object | The list of failed results.
|
└UserId | String | The ID of the user whose information fails to be modified. |
SubCode | Number | The code returned when the request fails. |
└SubMessage | String | The error message. |
Sample response
Untitled
{
"Code": 0,
"Message": "success",
"RequestId": "343649807833778782",
"ErrorList": [
{
"UserId": "aaa",
"SubCode": 660000012,
"SubMessage": "user length limit"
},
{
"UserId": "bbb",
"SubCode": 660000013,
"SubMessage": "this is a demo"
}
]
}
1
Return codes
Return Code | Description | Solution |
---|---|---|
660000002 | Invalid parameter. | Check the input parameter. For more information, see Request parameters. |
660300005 | The QPS limit specified in AppID is exceeded. | Try again later. |
660700012 | The user is not registered. | Register the user. |
660700013 | An error occurred while querying user information. | Contact ZEGOCLOUD technical support. |
660700016 | An error occurred while synchronizing user information. | Contact ZEGOCLOUD technical support. |
660700017 | An error occurred while updating user information. | Contact ZEGOCLOUD technical support. |