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:
iOS | Android | macOS |
---|---|---|
Windows | Web | Flutter |
---|---|---|
Unity3D | Reactive 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.
Parameter | Type | Required | Description |
---|---|---|---|
FromUserId | String | Yes | The user ID of the operator who modifies the group data (must be registered). |
GroupId | String | Yes | The group ID of the target group to be modified. |
GroupAvatar | String | At least one of group avatar, group name, and group notice | Group avatar address, with a length limit of 500 characters. |
GroupName | String | Same as above | Group name, with a length limit of 50 characters. |
GroupNotice | String | Same as above | Group notice, with a length limit of 300 characters. |
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:
https://zim-api.zego.im/?Action=UpdateGroupData
&<Common request parameters>
- Request body:
{
"FromUserId": "user",
"GroupId": "111",
"GroupName": "newName",
"GroupAvatar": "https://xxx.com/xxx.png",
"GroupNotice": "newNotice",
}
Response parameters
Parameter | Type | Description |
---|---|---|
Code | Number | Return code. |
Message | String | Operation result description. |
RequestId | String | Request ID. |
Response example
{
"Code": 0,
"Message": "success",
"RequestId": "343649807833778782"
}
Return codes
Return code | Description | Solution |
---|---|---|
660000002 | Invalid input parameters. | Please check the input parameters. |
660300006 | The frequency of calling the interface exceeds the group/room limit. | Please try again later. |
660500002 | FromUserId is not registered. | Please register FromUserId first. |
660600001 | The group does not exist. | Please confirm whether the input GroupId is correct, or create a group. |
660600009 | Failed to get group information. | Please confirm whether the GroupId is correct. If correct, contact ZEGO technical support. |
660600028 | Failed to update group information. | Please contact ZEGO technical support. |