Transferring a Group

Last updated: 2020-03-12 15:05:15

PDF

Feature Description

  • The app admin uses this API to transfer the ownership of a group.
  • A group without the owner can also be transferred, but the owner of the target group cannot be vacant.

API Calling Description

Applicable group types

Group Type Support This RESTful API
Private Yes
Public Yes
ChatRoom Yes
AVChatRoom No (see the following note)
BChatRoom No (see the following note)

IM provides the preceding five built-in group types. For details, see the Group System.

AVChatRoom and BChatRoom groups do not support the transfer of group ownership. If you attempt to transfer the ownership of these types of groups, error 10007 is returned.

Request URL example

https://console.tim.qq.com/v4/group_open_http_svc/change_group_owner?sdkappid=88888888&identifier=admin&usersig=xxx&random=99999999&contenttype=json

Request parameters

The following table lists only the parameters to be modified when this API is called. For details on other parameters, see RESTful API Overview.

Parameter Description
v4/group_open_http_svc/change_group_owner The request API
sdkappid SDKAppID assigned by the IM console when an app is created
identifier The value must be the app admin account. For details, see App Admins.
usersig Signature generated by the app admin account. For details, see Generating UserSig.
random A random 32-bit unsigned integer ranging from 0 to 4294967295

Maximum calling frequency

The maximum calling frequency is 200 times per second.

Request packet example

Transfers the ownership of a group, and the owner of the target group must be a member of this group.

{
    "GroupId": "@TGS#1NVTZEAE4",  // ID of the target group (required)
    "NewOwner_Account": "peter" // ID of the new group owner (required)
}

Request packet fields

Field Type Attribute Description
GroupId String Required ID of the target group
NewOwner_Account String Required ID of the new group owner

Response packet example

{
    "ActionStatus": "OK",
    "ErrorInfo": "",
    "ErrorCode": 0
}

Response packet fields

Field Type Description
ActionStatus String Request processing result. OK: succeeded. FAIL: failed.
ErrorCode Integer Error code. 0: succeeded. Others: failed.
ErrorInfo String Error information

Error Codes

Unless a network error (such as error 502) occurs, the HTTP return code for this API is always 200. ErrorCode and ErrorInfo in the response packet represent the actual error code and error information, respectively.
For common error codes (60000 to 79999), see Error Codes.
The following table describes the error codes specific to this API.

Error Code Description
10002 A system error occurred. To correct it, try again or contact our technical customer service.
10004 A parameter is invalid. To correct it, based on the ErrorInfo field in the response packet, check whether required fields have been specified, or whether the fields meet protocol requirements.
10007 Operation permissions are insufficient. To correct it, check whether the operator is an app admin.
10010 The group does not exist or has been dismissed.
10015 The group ID is invalid. To correct it, check whether the group ID is correct.

API Commissioning Tool

Use the online commissioning tool for RESTful APIs to commission this API.

References

Recalling a group message (v4/group_open_http_svc/group_msg_recall)