logo
In-app Chat
Powered Byspreading
On this page

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.

iOSAndroidmacOSWindows
userInfoUpdatedonUserInfoUpdateduserInfoUpdatedonUserInfoUpdated
WebFlutterUnity3DReact Native
userInfoUpdatedonUserInfoUpdatedOnUserInfoUpdateduserInfoUpdated

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.

ParameterTypeRequiredDescription
UserInfoArray of ObjectYesThe list of IDs of users whose information is to be modified. Up to 100 user IDs can be included.
└UserIdStringYesThe ID of the user whose information is to be modified.
└UserNameStringNoThe new username, which cannot exceed 256 bytes in length.
└UserAvatarStringNoThe new URL of the user avatar, which cannot exceed 500 bytes in length.
└ExtraStringNoAdditional 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

    Untitled
    https://zim-api.zego.im/?Action=ModifyUserInfo&<Common request parameters>
    
    1
    Copied!
  • Request body

    Untitled
    {
        "UserInfo": [
            {
                "UserId": "aaa",
                "UserName": "userNamea",
                "UserAvatar": "http",
                "Extra": "extra info"
            },
            {
                "UserId": "bbb",
                "UserName": "userNameb",
                "UserAvatar": "http"
            }
        ]
    }
    
    1
    Copied!

Response parameters

ParameterTypeDescription
CodeNumberThe return code.
MessageStringThe description of the operation result.
RequestIdStringThe request ID.
ErrorListArray of Object

The list of failed results.

  • If Code is 0:

    • If ErrorList is empty, the information of all users is successfully modified.
    • If ErrorList is not empty, the information of some users fails to be modified. In this case, see SubCode and SubMessage.
  • If Code is not 0:

    • If ErrorList is empty, one or more parameters are invalid, the QPS limit is exceeded, or a system error occurs.
    • If ErrorList is not empty, the information of all users fails to be modified.
└UserIdStringThe ID of the user whose information fails to be modified.
SubCodeNumberThe code returned when the request fails.
└SubMessageStringThe 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
Copied!

Return codes

Return CodeDescriptionSolution
660000002Invalid parameter.Check the input parameter. For more information, see Request parameters.
660300005The QPS limit specified in AppID is exceeded.Try again later.
660700012The user is not registered.Register the user.
660700013An error occurred while querying user information.Contact ZEGOCLOUD technical support.
660700016An error occurred while synchronizing user information.Contact ZEGOCLOUD technical support.
660700017An error occurred while updating user information.Contact ZEGOCLOUD technical support.

Previous

Batch register users

Next

Batch add friends