SetGroupMemberRole
https://zim-api.zego.im/
By calling this API, you can set roles for group members in the group.
ZIM SDK supports setting users as group owner, administrator, or regular member by default. In a group, the group owner has all client-side permissions and can implement all group functions. Administrators have most client-side permissions. Regular members have the fewest client-side permissions, as shown in the following table:
| Client-side Permission | Group Owner (Enum value is 1) | Administrator (Enum value is 2) | Regular Member (Enum value is 3) |
|---|---|---|---|
| Modify group avatar, group name, group notice | Supported | Supported | Supported |
| Modify group attributes | |||
| Modify group member nickname | Supported, can be used for all group role users | Supported, can be used for all regular members | Supported, can only be used for oneself |
| Recall group member messages | |||
| Remove members | Not supported. | ||
| Mute individual group members | |||
| Mute specific group roles | |||
| Set group member roles | Not supported | ||
| Transfer group ownership | |||
| Disband group | |||
| All-member mute |
In addition, you can also customize group roles, but the client-side permissions of this role are consistent with regular members.
After successful setting, group members will receive notifications through the following ZIM callbacks:
| iOS | Android | macOS |
|---|---|---|
| groupMemberInfoUpdated | onGroupMemberInfoUpdated | groupMemberInfoUpdated |
| Windows | Web | Mini Program |
|---|---|---|
| onGroupMemberInfoUpdated | groupMemberInfoUpdated | groupMemberInfoUpdated |
| Flutter | Unity3D | uni-app |
|---|---|---|
| onGroupMemberInfoUpdated | OnGroupMemberInfoUpdated | groupMemberInfoUpdated |
| React Native | HarmonyOS | |
|---|---|---|
| groupMemberInfoUpdated | groupMemberInfoUpdated |
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.Request
Query Parameters
- 2: Administrator.
- 3: Regular member.
- Other values: Custom roles can be defined. The recommended value range is [100, 255], with permissions consistent with regular members.
Possible values: [SetGroupMemberRole]
API prototype parameter
https://zim-api.zego.im/?Action=SetGroupMemberRole
💡Public parameter. Application ID, assigned by ZEGOCLOUD. Get it from the ZEGOCLOUD Admin Console.
💡Public parameter. A 16-character hexadecimal random string (hex encoding of 8-byte random number). Refer to Signature example for how to generate.
💡Public parameter. Current Unix timestamp, in seconds. Refer to Signature example for how to generate, with a maximum error of 10 minutes.
Possible values: [2.0]
Default value: 2.0
💡Public parameter. Signature version number.
💡Public parameter. Signature, used to verify the legitimacy of the request. Refer to Signing the requests for how to generate an API request signature.
Possible values: <= 32 characters
Operator user ID. It is recommended to fill in the group owner ID.
Note
This parameter cannot be the same as ToUserId.
Possible values: <= 32 characters
Group ID.
Possible values: <= 32 characters
Target user ID whose role is to be set.
Possible values: [2, 3]
Role:
Responses
- 200
- application/json
