Skip to main content

Callback Before Inviting New Members to Join Group

Functional Description​

Before inviting new members to join a group, the business server can reject this request, or modify and intervene in the request.

Precautions​

  • To enable the callback, you must configure the callback URL and turn on the switch corresponding to this callback protocol. See the Callback Description document for configuration methods.
  • The callback direction is an HTTP/HTTPS POST request initiated by IMServer to the business server.
  • The business server must respond to this request within the timeout period.

Scenarios That May Trigger This Callback​

  • Before users perform corresponding operations through the client or APP administrators through REST API.

Timing of Callback​

  • Before inviting new members to join a group.

Interface Description​

Request URL Example​

Here CallbackCommand is: callbackBeforeInviteJoinGroupCommand

{WEBHOOK_ADDRESS}/callbackBeforeInviteJoinGroupCommand?contenttype=json

Request Package Example​

{
"callbackCommand": "callbackBeforeInviteJoinGroupCommand",
"operationID": "1646445464564",
"groupID": "12345",
"reason": "friend",
"invitedUserIDs": "[\"user1\",\"user2\"]"
}

Request Package Field Description​

ObjectTypeDescription
callbackCommandstringCallback command, here it is the callback before inviting friends to join a group.
operationIDstringoperationID used for global link tracking
groupIDstringUnique identifier of the group.
reasonstringInvitation reason
invitedUserIDsstringArray of User IDs invited to join the group in string format.

Response Package Example​

Allow Creation​

Allow users to join the group.

{
"actionCode": 0,
"errCode": 0,
"errMsg": "",
"errDlt": "",
"nextCode": 0,
"invitedUserIDs": "[\"user1\",\"user2\"]"
}

Response Package Field Description​

FieldValueDescription
actionCode0Indicates whether the business system callback was executed correctly. 0 means the operation was successful.
errCode5001Custom error code, ranges from 5000-9999. Set when actionCode is not 0; set when nextCode is 1.
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.
nextCode1Next execution instruction, 1 means refusing to continue execution, set when actionCode is 0.
invitedUserIDsstringArray of User IDs invited to join the group in string format.