logo
In-app Chat
ZIMAudio
On this page

MuteGroupMembers

GET

https://zim-api.zego.im/

By calling this API, you can mute or unmute specific members in a group.

After the API is successfully called, all users in the group will learn which group members cannot speak in the group or have been unmuted through the following ZIM SDK callback interfaces:

iOSAndroidmacOSWindows
groupMemberInfoUpdatedonGroupMemberInfoUpdatedgroupMemberInfoUpdatedonGroupMemberInfoUpdated
WebMini ProgramFlutterReact Native
groupMemberInfoUpdatedgroupMemberInfoUpdatedonGroupMemberInfoUpdatedgroupMemberInfoUpdated
Unity3Duni-app | uni-app xHarmonyOS
OnGroupMemberInfoUpdatedgroupMemberInfoUpdatedgroupMemberInfoUpdated
Note
The users corresponding to the parameters FromUserId and UserId have logged in to the ZIM service by calling the login method on the client, or have completed registration by calling the server-side API.
Note
The parameters FromUserId and UserIds only support numbers, English characters, and '!','#','$','%','&','(',')','+','\'',':',';','<','=','.','>','?', '@','[',']','^','_','{','}','|','~'.
QPS Limit
20 times/s

Request

Query Parameters

    Action stringrequired

    Possible values: [MuteGroupMembers]

    API prototype parameter

    https://zim-api.zego.im/?Action=MuteGroupMembers

    AppId uint32required

    💡Public parameter. Application ID, assigned by ZEGOCLOUD. Get it from the ZEGOCLOUD Admin Console.

    SignatureNonce stringrequired

    💡Public parameter. A 16-character hexadecimal random string (hex encoding of 8-byte random number). Refer to Signature example for how to generate.

    Timestamp int64required

    💡Public parameter. Current Unix timestamp, in seconds. Refer to Signature example for how to generate, with a maximum error of 10 minutes.

    SignatureVersion stringrequired

    Possible values: [2.0]

    Default value: 2.0

    💡Public parameter. Signature version number.

    Signature stringrequired

    💡Public parameter. Signature, used to verify the legitimacy of the request. Refer to Signing the requests for how to generate an API request signature.

    FromUserId stringrequired

    Possible values: <= 32 characters

    Operator user ID (who has logged in to the ZIM service by calling the login method on the client, or has completed registration by calling the server-side API).

    Note

    Since the mute operation will trigger a group tips message, when FromUserId is not a group member, developers need to hide the message or implement other processing to avoid confusion among group users.

    GroupId stringrequired

    Possible values: <= 32 characters

    Group ID.

    UserIds string[]required

    Possible values: <= 20

    List of user IDs of group members to mute or unmute. A single request can include up to 20 user IDs.

    Duration number

    Possible values: >= -1 and <= 2592000

    Mute duration. Defaults to 0 if not passed.

    • -1: Permanent.
    • 0: Unmute.
    • Greater than 0: Mute duration in seconds. Maximum support is 30 days (2,592,000 seconds).

    If this API is called again to update the mute duration during the mute validity period of a group user, the mute time will be recalculated from the moment of this request.

Responses

OK
Schema
    Code number

    Return code.

    The following only lists the Code and SubCode related to the API business logic. For the complete return codes, please refer to Return codes.

    Code / SubCodeDescriptionSuggested Solution
    660000001General business error.Please retry or contact ZEGOCLOUD Technical Support.
    660000002Parameter error.Please check the request parameters.
    660300005The API call frequency exceeds the AppID-level limit.Please try again later.
    660600001Group does not exist.Please confirm if the input GroupID is correct.
    660600009Failed to obtain group-related information.Please confirm if the GroupID is correct first. If correct, please contact ZEGOCLOUD Technical Support.
    660600024FromUserId is not in the group.Please check FromUserId or add FromUserId as a group member.
    660600032FromUserId does not have permission.FromUserId must be the group owner or administrator.
    660600033All specified user operations failed.Please check UserIds.
    Message string

    Description of the operation result.

    RequestId string

    Request ID.

    ErrorUsers object[]
    List of failed users.
    • When Code is 0:
    • If ErrorUsers is empty, all specified users were muted/unmuted successfully.
    • If ErrorUsers is not empty, it means some specified users failed to be muted/unmuted. Please refer to SubCode for handling.
    • When Code is not 0:
    • If ErrorUsers is empty, it indicates parameter error, API frequency limit, or system error.
    • If ErrorUsers is not empty, it means all specified users failed to be muted/unmuted.
  • Array[
  • UserId string

    Failed user ID.

    SubCode number

    Specific return code for failure. For the complete return codes, please refer to the Code description or Return codes.

  • ]

Previous

Mute a group

Next

Fetch the list of groups that are muted in the app

On this page

Back to top