please select

Callback After the Group Owner Changed

Feature Overview

The app backend can use this callback to view group owner change information in real-time. The app backend can perform operations such as data synchronization based on this callback.

Notes

To enable the callback, you must configure a callback URL and toggle on the corresponding protocol switch. For detailed configuration methods, see Third-party Callback Configuration document.
During this callback, the Chat backend initiates an HTTP POST request to the app backend.
After the callback request is received, the app backend must check whether the SDKAppID contained in the request URL is consistent with its own SDKAppID.
For other security-related matters, please refer to the Webhook Overview - Security Considerations document.

Scenarios That May Trigger This Callback

An app user successfully transfers the group owner via the client.
An app administrator successfully transfers the group owner via the REST API.

Callback Trigger Time

After you successfully transferring the group owner.

API Description

Sample Request URL

In the subsequent example, the callback URL configured within the app is https://www.example.com. Example:
https://www.example.com?SdkAppid=$SDKAppID&CallbackCommand=$CallbackCommand&contenttype=json&ClientIP=$ClientIP&OptPlatform=$OptPlatform

Request Parameters

Parameter
Description
https
The request protocol is HTTPS, and the request method is POST
www.example.com
Callback URL
SdkAppid
SDKAppID allocated by Chat console at the time of application creation
CallbackCommand
Fixed to Group.CallbackAfterChangeGroupOwner
contenttype
Fixed value: JSON
ClientIP
Client IP, for example: 127.0.0.1
OptPlatform
Client Platform, see the Webhook Overview - Callback Protocol for the meaning of the OptPlatform parameter

Sample Request Packets

{
"CallbackCommand": "Group.CallbackAfterChangeGroupOwner", // Callback after the group owner changes
"GroupId": "@TGS#2TTV7VSII", // Group ID
"Type": "Public", // Group Type
"Operator_Account": "admin", // Operating User ID
"OldOwner_Account": "user1", // Original group owner
"NewOwner_Account": "user2", // New group owner
"EventTime":"1670574414123"// Event trigger timestamp in milliseconds
}

Request Packet Fields

Field
Type
Description
CallbackCommand
String
Callback command
GroupId
String
Operating Group ID
Type
String
Group Type Group Type Introduction, e.g., Public
Operator_Account
String
Operating User UserID
OldOwner_Account
String
Original Group Owner UserID
NewOwner_Account
String
New Group Owner UserID
EventTime
Integer
Event trigger timestamp in milliseconds

Response Packet Example

Following data synchronization, the app backend dispatches a callback response packet.
{
"ActionStatus": "OK",
"ErrorInfo": "",
"ErrorCode": 0 // Ignore callback result
}

Response Packet Field Description

Field
Type
Attribute
Description
ActionStatus
String
Required
Processed Request Result:
OK: Indicates successful processing
FAIL: Indicates failure
ErrorCode
Integer
Required
Error Code, entering 0 here means to ignore the response result
ErrorInfo
String
Required
Error message

Reference