Skip to main content

Callback Before Creating Group

Functional Description

Before creating 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 creating a group.

Interface Description

Request URL Example

Here CallbackCommand is: callbackBeforeCreateGroupCommand

{WEBHOOK_ADDRESS}/callbackBeforeCreateGroupCommand?contenttype=json

Request Package Example

{
"callbackCommand": "callbackBeforeCreateGroupCommand",
"groupID": "12345",
"groupName": "MyGroup",
"notification": "Welcome to MyGroup!",
"introduction": "This is a group for discussing example topics.",
"faceURL": "http://example.com/path/to/face/image.png",
"ownerUserID": "user123",
"createTime": 1673048592000,
"memberCount": 10,
"ex": "Extra data",
"status": 1,
"creatorUserID": "user123",
"groupType": 1,
"needVerification": 1,
"lookMemberInfo": 1,
"applyMemberFriend": 0,
"notificationUpdateTime": 1673048592000,
"notificationUserID": "user456",
"initMemberList": [
{
"userID": "user789",
"roleLevel": 60
},
{
"userID": "user101112",
"roleLevel": 20
}
]
}

Request Package Field Description

ObjectTypeDescription
callbackCommandstringCallback command, here it is the callback before creating a group
groupIDstringUnique identifier of the group
groupNamestringName of the group
notificationstringNotification info of the group
introductionstringIntroduction of the group
faceURLstringURL of the group's icon
ownerUserIDstringUser ID of the group owner
createTimeint64Timestamp of group creation (milliseconds)
memberCountuint32Number of group members
exstringExtra data field
statusint32Status of the group
creatorUserIDstringUser ID of the group creator
groupTypeint32Group type, fixed as 2.
needVerificationint32Whether verification is needed to join the group
lookMemberInfoint32Whether member info can be viewed
applyMemberFriendint32Whether members can be applied as friends
notificationUpdateTimeint64Timestamp of group notification update (milliseconds)
notificationUserIDstringUser ID who updated the group notification
initMemberListarrayList of initial group members, including userID and roleLevel sub-fields
initMemberList.userIDstringUser ID of the initial member
initMemberList.roleLevelint32Role level of the initial member

Response Package Example

Allow Creation

{
"actionCode": 0,
"errCode": 0,
"errMsg": "",
"errDlt": "",
"nextCode": 0,
"groupID": "G001",
"groupName": "MyGroup",
"notification": "Welcome to MyGroup!",
"introduction": "A group for discussions",
"faceURL": "http://example.com/groupface.png",
"ownerUserID": "user01",
"ex": "Some extra data",
"status": 1,
"creatorUserID": "user02",
"groupType": 1,
"needVerification": 0,
"lookMemberInfo": 1,
"applyMemberFriend": 1
}

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.
groupIDstringUnique identifier of the group.
groupNamestringName of the group.
notificationstringNotification/announcement message of the group.
introductionstringIntroduction of the group.
faceURLstringURL of the group's icon or picture.
ownerUserIDstringUser ID of the group owner.
exstringExtra data or information.
statusint32Status of the group.
creatorUserIDstringUser ID of the creator of the group.
groupTypeint32Group type, fixed as 2.
needVerificationint32Whether verification is needed to join the group.
lookMemberInfoint32Whether group member info can be viewed.
applyMemberFriendint32Whether group members can be applied as friends.