Transfer the group ownership
Overview
You can call this operation to transfer the group ownership to a group member.
After the ownership is successfully transferred, group members receive the notification in the following ZIM SDK callbacks.
| iOS | Android | macOS | Windows | ||
|---|---|---|---|---|---|
| groupMemberInfoUpdated | onGroupMemberInfoUpdated | groupMemberInfoUpdated | onGroupMemberInfoUpdated | ||
| Web | Flutter | Unity3D | React Native | ||
| groupMemberInfoUpdated | onGroupMemberInfoUpdated | OnGroupMemberInfoUpdated | groupMemberInfoUpdated |
Request method and endpoint
- Request method: GET
- Request URL:
https://zim-api.zego.im/?Action=TransferGroupOwner - Protocol: HTTPS
- QPS limit: 1 call per second, applicable to group chats only. If you need a higher limit, contact ZEGOCLOUD technical support.
Request parameters
The following table describes only the operation-specific request parameters and some common request parameters. For the complete list of common request parameters, see the Common request parameters section of the Accessing Server APIs topic.
| Parameter | Type | Required | Description |
|---|---|---|---|
| FromUserId | String | Yes | The ID of the operator. |
| GroupId | String | Yes | The group chat ID. |
| NewOwner | String | Yes | The ID of the user to whom the group ownership is to be transferred. The user must be a group member. |
The FromUserId, GroupId, and NewOwner parameters can contain only digits, letters, and the following characters: '!', '#', '$', '%', '&', '(', ')', '+', '', ':', ';', '<', '=', '.', '>', '?', '@', '[', ']', '^', '_', '{', '}', '|', '~'.
Sample request
https://zim-api.zego.im/?Action=TransferGroupOwner
&FromUserId=zego_user&GroupId=groupid&NewOwner=newowner
&<Common request parameters>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 table describes only the return codes related to the business logic of the operation. For the complete list of return codes, see Return codes.
| Return Code | Description | Solution |
|---|---|---|
| 660000002 | Invalid parameter. | Check the input parameter. |
| 660300006 | The QPS limit is exceeded. | Please try again later. |
| 660500002 | The operator is not registered. | Register the operator. |
| 660600001 | The group chat does not exist. | Check whether the value of the GroupID parameter is valid. |
| 660600024 | The user to whom the group ownership is to be transferred is not in the group chat. | Add the user to the group chat. For more information, see Add group members. |

