Callback After Transferring Group Ownership
Function Description
The App business server can use this callback to receive information about the transfer of group ownership. The business server can then perform subsequent processing or recordkeeping for the transferred group.
Precautions
- To enable the callback, it is necessary to configure the callback URL and activate the corresponding switch for this callback protocol. Configuration methods can be found in the Callback Explanation document.
- The direction of the callback is an HTTP/HTTPS POST request initiated by OpenIM Server to the App backend.
- After receiving the callback request, the App business server must verify whether the command parameter in the request URL is its SDKNAME parameter.
- The APP business server must respond to this request within the timeout period.
Scenarios That May Trigger This Callback
- App users or administrators transfer group ownership through the client or API interface.
Timing of the Callback
- After OpenIM Server successfully transfers the ownership of the group.
Interface Description
Request URL Example
In the following example, the callback URL configured by the App is https://callbackurl
.
https://callbackurl?command=$CallbackCommand&contenttype=json
Request Parameter Description
Parameter | Description |
---|---|
https | Request protocol is HTTPS, method is POST |
https://callbackurl | Callback URL |
CallbackCommand | Fixed value: transferGroupOwnerAfterCommand |
contenttype | Fixed value: JSON |
Header
Header Name | Example Value | Mandatory | Type | Description |
---|---|---|---|---|
operationID | 1646445464564 | Required | string | operationID for global link tracing |
Request Packet Example
{
"callbackCommand": "transferGroupOwnerAfterCommand",
"groupID": "G12345",
"oldOwnerUserID": "userOld123",
"newOwnerUserID": "userNew456"
}
Request Packet Field Explanation
Field | Type | Description |
---|---|---|
callbackCommand | string | Callback command, here for the callback after transferring group ownership |
groupID | string | Unique identifier of the group |
oldOwnerUserID | string | User ID of the former group owner |
newOwnerUserID | string | User ID of the new group owner |
Response Packet Example
Successful Handling
Indicates that the business system has successfully processed the callback for group ownership transfer.
{
"actionCode": 0,
"errCode": 0,
"errMsg": "Success",
"errDlt": "",
"nextCode": "0"
}
Unsuccessful Handling
Indicates that the business system was unable to process the callback, providing error information.
{
"actionCode": 1,
"errCode": 5002,
"errMsg": "Unable to process the request",
"errDlt": "The group ownership transfer cannot be processed due to internal policy",
"nextCode": "1"
}
Response Packet Field Explanation
Field | Value | Description |
---|---|---|
actionCode | 0 | Indicates if the business system's callback was executed correctly. 0 means the operation was successful. |
errCode | 0 | Indicates a custom error code, here 0 means ignore the callback result. |
errMsg | "An error message" | Simple error message corresponding to the custom error code. |
errDlt | "Detailed error information" | Detailed error information corresponding to the custom error code. |
nextCode | 1 | Next step instruction, 1 means to refuse to continue executing, set when actionCode is 0 . |