logo
In-app Chat
Powered Byspreading
On this page

Set nicknames of group members


Overview

You can call this operation to batch change the nicknames of up to 20 group members at a time. If you need a higher limit, contact ZEGOCLOUD technical support.

After nicknames are changed, group members receive the notification in the following ZIM SDK callbacks.

iOSAndroidmacOSWindows
groupMemberInfoUpdatedonGroupMemberInfoUpdatedgroupMemberInfoUpdatedonGroupMemberInfoUpdated
WebFlutterUnity3DReact Native
groupMemberInfoUpdatedonGroupMemberInfoUpdatedOnGroupMemberInfoUpdatedgroupMemberInfoUpdated

Operation prototype

  • Request method: POST
  • Request URL: https://zim-api.zego.im/?Action=SetGroupMembersNickname
  • Protocol: HTTPS
  • QPS limit: 1 call per second, applicable to group chats only. If you need a higher limit, contact ZEGOCLOUD technical support.

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
FromUserIdStringYesThe ID of the operator. The operator must be registered.
GroupIdStringYesThe group chat ID.
UserIdsArray of ObjectYesThe list of IDs of users whose nicknames are to be changed.
└UserIdStringYesThe user ID.
└NicknameStringYesThe nickname of the user in the group.
Note

The `FromUserId`, `GroupId`, `UserIds`, and `Nickname` parameters can contain only digits, letters, and the following characters: '!', '#', '$', '%', '&', '(', ')', '+', '', ':', ';', '<', '=', '.', '>', '?', '@', '[', ']', '^', '_', ', ', '|', '~'.

Sample request

  • Request URL:

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

    Untitled
    {
        "FromUserId": "zego_user",
        "GroupId": "groupA",
        "UserIds": [
            {
                "UserId": "usera",
                "Nickname": "nicknamea"
            },
            {
                "UserId": "userb",
                "Nickname": "nicknameb"
            }
        ]
    }
    
    1
    Copied!

Response parameters

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

The list of failed results.

  • If Code is 0:

    • If ErrorUsers is empty, the nicknames of all specified users are successfully changed.
    • If ErrorUsers is not empty, the nicknames of some specified users fail to be changed. In this case, see SubCode.
  • If Code is not 0:

    • If ErrorUsers is empty, one or more parameters are invalid, the QPS limit is exceeded, or a system error occurs.
    • If ErrorUsers is not empty, the nicknames of all specified users fail to be changed.
└UserIdStringThe ID of the user whose nickname fails to be changed.
└SubCodeNumberThe code returned when the request fails.

Sample response

Untitled
{
    "Code": 0,
    "Message": "success",
    "RequestId": "343649807833778782"
}
1
Copied!

Return codes

The following table describes only the return codes related to the business logic of the operation. For the complete list of return codes, see Return codes.

Return CodeDescriptionSolution
660000002Invalid parameter.Check the input parameter.
660000011Too many users are included in the list.Check the number of users.
660300006The QPS limit is exceeded.Please try again later, or check the QPS limit.
660500002The operator is not registered.Register the operator.
660600001The group chat does not exist.Check whether the value of the GroupID parameter is valid.

Previous

Add group members

Next

Set group member roles