Mute a group
Overview
This interface allows you to mute or unmute all members or certain roles in a group.
After a successful API call, all users in the group will be notified through the following ZIM SDK callback, indicating which roles are unable to speak in the group or can resume speaking:
iOS | Android | macOS | Windows |
---|---|---|---|
groupMutedInfoUpdated | onGroupMutedInfoUpdated | groupMutedInfoUpdated | onGroupMutedInfoUpdated |
Web | Flutter | React Native | |
groupMutedInfoUpdated | onGroupMutedInfoUpdated | groupMutedInfoUpdated |
Operation prototype
- Request method: GET
- Request endpoint:
https://zim-api.zego.im/?Action=MuteGroup
- Protocol: HTTPS
- Rate limit: 20 times/second
Request parameters
The following list only shows the request parameters for this interface and some public parameters. For a complete list of public parameters, please refer to Accessing Server APIs - Public parameters.
Parameter | Type | Required | Description |
---|---|---|---|
FromUserId | String | Yes | The ID of the operating user. |
GroupId | String | Yes | The ID of the group. |
IsAllMuted | Bool | No | Whether to mute all members. If not passed, it defaults to false. |
MuteRoleList[] | Array of Number | No (only works when IsAllMuted is false or not passed) | A list of roles to be muted. Up to 20 group roles can be muted in a single request. The enumerations are as follows:
|
Duration | Number | No | The duration of the mute. If not passed, it defaults to 0.
|
- If
IsAllMuted
,MuteRoleList
, andDuration
are not passed, all users in the group will have their mute status lifted. - If
Duration
is not 0 andIsAllMuted
is set to false, theMuteRoleList
passed in will override the muuted role list set previously. FromUserId
only supports numbers, English characters, and the following special characters: '!', '#', '$', '%', '&', '(', ')', '+', '', ':', ';', '<', '=', '.', '>', '?', '@', '[', ']', '^', '_', '{', '}', '|', '~'.- If
FromUserId
is an administrator,MuteRoleList[]
cannot include 1 (group owner).
Sample request
https://zim-api.zego.im/?Action=MuteGroup
&<Public Request Parameters>
&FromUserId=user1
&GroupId=group
&IsAllForbid=false
&MuteRoleList[]=2
&MuteRoleList[]=3
&Duration=100000
Response Parameters
Parameter | Type | Description |
---|---|---|
Code | Number | The return code. |
Message | String | The description of the operation result. |
RequestId | String | The request ID. |
Sample response
{
"Code": 0,
"Message": "success",
"RequestId": "343649807833778782"
}
Return codes
The following list only shows the return codes related to the business logic of the interface. For a complete list of return codes, please refer to Return codes.
Return Code | Description | Suggested Action |
---|---|---|
660000001 | Business related general error. | Please try again or contact ZEGOCLOUD Technical Support. |
660000002 | Invalid parameter. | The parameter entered is missing or invalid. Please check the parameters. |
660300005 | The call frequency of the interface exceeds the AppID level limit. | Please try again later. |
660600001 | The group does not exist. | Please check the GroupID . |
660600009 | Failed to obtain group-related information. | Please confirm if the GroupID is correct. If it is correct, please contact ZEGO technical support. |
660600024 | FromUserId is not in the group. | Please check FromUserId or add FromUserId as a group member. |
660600032 | FromUserId does not have permission. | FromUserId needs to be the group owner or administrator. |