logo
In-app Chat
On this page

Update group data


Description

With this API, you can update group information, including group avatar, group name, and group notice.

After the group data is updated successfully, the group members can receive the group data update notification through the following ZIM SDK callback interfaces:

iOSAndroidmacOS
WindowsWebFlutter
Unity3DReactive Native

Request method and endpoint

  • Request method: POST
  • Request URL: https://zim-api.zego.im/?Action=UpdateGroupData
  • Protocol: HTTPS
  • Rate limit: 20 requests/second

Request parameters

Listed below are the parameters specific to this request and part of the common request parameters. For the complete list of common request parameters, see Accessing Server APIs - Common parameters.

ParameterTypeRequiredDescription
FromUserIdStringYesThe user ID of the operator who modifies the group data (must be registered).
GroupIdStringYesThe group ID of the target group to be modified.
GroupAvatarStringAt least one of group avatar, group name, and group noticeGroup avatar address, with a length limit of 500 characters.
GroupNameStringSame as aboveGroup name, with a length limit of 50 characters.
GroupNoticeStringSame as aboveGroup notice, with a length limit of 300 characters.
Note

Since GroupAvatar, GroupName, and GroupNotice support setting to empty strings, if you do not need to modify a field, you cannot include the field name in the JSON string (cannot pass empty strings). Otherwise, it will be considered an empty string, and the original content will be deleted.

Request example

  • Request URL:
Untitled
https://zim-api.zego.im/?Action=UpdateGroupData
&<Common request parameters>
1
Copied!
  • Request body:
Untitled
{
    "FromUserId": "user",
    "GroupId": "111",
    "GroupName": "newName",
    "GroupAvatar": "https://xxx.com/xxx.png",
    "GroupNotice": "newNotice",
}
1
Copied!

Response parameters

ParameterTypeDescription
CodeNumberReturn code.
MessageStringOperation result description.
RequestIdStringRequest ID.

Response example

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

Return codes

Return codeDescriptionSolution
660000002Invalid input parameters.Please check the input parameters.
660300006The frequency of calling the interface exceeds the group/room limit.Please try again later.
660500002FromUserId is not registered.Please register FromUserId first.
660600001The group does not exist.Please confirm whether the input GroupId is correct, or create a group.
660600009Failed to get group information.Please confirm whether the GroupId is correct. If correct, contact ZEGO technical support.
660600028Failed to update group information.Please contact ZEGO technical support.

Previous

Create a group

Next

Query group information