Callback After New Member Joins Group
Description
The App business server can use this callback to monitor real-time updates when a new member joins a group, enabling necessary data synchronization on the App's backend.
Important Notes
- To enable this callback, configure the callback URL and activate the corresponding protocol switch. For configuration details, refer to the Callback Introduction document.
- The callback is initiated from the OpenIM Server to the App backend as an HTTP/HTTPS POST request.
- The App business server must respond within the timeout period.
Scenarios that Trigger This Callback
- An App user applies and is approved to join a group.
- An App user successfully invites another user to join a group.
- An App administrator adds a user to a group through the REST API.
Timing of Callback
- After a user’s request to join a group is approved.
- After a user is invited by another member and successfully joins a group.
- After a user is added to the group by an administrator through the REST API.
Interface Description
Example Request URL
The CallbackCommand
here is: callbackAfterJoinGroupCommand
{WEBHOOK_ADDRESS}/callbackAfterJoinGroupCommand?contenttype=json
Example Request Package
{
"callbackCommand": "callbackAfterJoinGroupCommand",
"operationID": "1646445464564",
"groupID": "12345",
"userID": "user789",
"ex": "Extra data",
"groupEx": "GroupExtra data"
}
Request Package Field Descriptions
Field | Type | Description |
---|---|---|
callbackCommand | string | Callback command, here indicating a post-join action. |
operationID | string | Operation ID for global traceability. |
userID | string | ID of the user joining the group. |
groupID | string | Unique identifier of the group. |
ex | string | Additional data field. |
groupEx | string | Additional group data field. |
Example Response Package
After the App backend synchronizes data, it sends the callback response package.
{
"actionCode": 0,
"errCode": 0,
"errMsg": "",
"errDlt": "",
"nextCode": 1
}
Response Package Field Descriptions
Field | Value | Description |
---|---|---|
actionCode | 0 | Indicates if the callback executed correctly. 0 means success. |
errCode | 0 | Custom error code, set to 0 to ignore callback result. |
errMsg | "An error message" | Simple error message corresponding to the custom error code. |
errDlt | "Detailed error information" | Detailed error information for the custom error code. |
nextCode | 1 | Next action instruction, set to 1 to stop further action when actionCode = 0 . |