In-app Chat
  • iOS : Objective-C
  • Android
  • Web
  • Flutter
  • React Native
  • Unity3D
  • Windows
  • macOS
  • Introduction
    • Overview
    • Basic concepts
  • Sample app
  • Getting started
  • Client SDKs
    • SDK downloads
    • Release notes
    • Upgrade guide
  • Guides
    • Authentication
    • Manage users
    • Room
    • Group
    • Messaging
    • Call invitation (signaling)
    • Manage sessions
  • Offline push notifications
  • Error codes
  • Client APIs
  • Server APIs
  • Documentation
  • In-app Chat
  • Server APIs
  • User related
  • Modify user information

Modify user information

Last updated:2024-03-15 15:03

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.

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

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

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

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.
  • 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.
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
{
    "Code": 0,
    "Message": "success",
    "RequestId": "343649807833778782",
    "ErrorList": [
        {
            "UserId": "aaa",
            "SubCode": 660000012,
            "SubMessage": "user length limit"
        },
        {
            "UserId": "bbb",
            "SubCode": 660000013,
            "SubMessage": "this is a demo"
        }
    ]
}

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.
Page Directory