跳到主要内容

设置群组信息EX之前的回调

功能说明

App 业务服务端可以通过该回调在设置群组信息之前进行干预。这使得业务服务端可以在实际修改群组信息前,对请求进行审核或修改。

注意事项

  • 为启用回调,必须配置回调 URL,并开启本条回调协议对应的开关。配置方法详见 回调说明 文档。
  • 回调的方向是 OpenIMServer 向 App 后台发起 HTTP/HTTPS POST 请求。
  • APP 业务服务端需在超时时间内响应此请求。

可能触发该回调的场景

  • App 用户通过客户端请求修改群组信息。
  • App 管理员通过 REST API 修改群组信息。

回调发生时机

  • OpenIMServer 收到设置群组信息的请求之后,处理该请求前。

接口说明

请求 URL 示例

以下示例中 App 配置的回调 URL 为 http://www.example.com/callbackCommand?contenttype=json

http://www.example.com/callbackBeforeSetGroupInfoEXCommand?contenttype=json

请求参数说明

参数说明
http请求协议为 HTTP,请求方式为 POST
www.example.comconfigy.yaml 中的 callback.url 字段,域名或主机名
CallbackCommand此处为:callbackBeforeSetGroupInfoEXCommand
contenttype固定值为:JSON
header名示例值选填类型说明
operationID1646445464564必填stringoperationID用于全局链路追踪

请求包示例

{
"callbackCommand": "callbackBeforeSetGroupInfoEXCommand",
"groupInfoForSet": {
"groupID": "G002",
"groupName": "NewGroupName",
"notification": "Updated group notification",
"introduction": "Updated group introduction",
"faceURL": "http://example.com/new/path/to/face/image.png",
"ex": {
"value": "Updated extra data"
},
"needVerification": {
"value": 0
},
"lookMemberInfo": {
"value": 1
},
"applyMemberFriend": {
"value": 0
}
}
}

请求包字段说明

字段类型描述
callbackCommandstring回调命令,这里为设置群组信息之前的回调
groupInfoForSetobject包含要设置的群组信息的对象
groupIDstring群组的唯一标识符
groupNamestring群组的名称
notificationStringValue群组的通知信息
introductionStringValue群组的简介
faceURLStringValue群组的图标的URL
exStringValue额外的数据字段
needVerificationInt32Value是否需要验证加入群组
lookMemberInfoInt32Value是否可以查看群成员信息
applyMemberFriendInt32Value是否可以申请加群成员为好友

应答包示例

允许修改

允许修改群组信息。

{
"actionCode": 0,
"errCode": 0,
"errMsg": "Success",
"errDlt": "",
"nextCode": "nextCodeValue",
"groupInfoForSet": {
"groupID": "G002",
"groupName": "NewGroupName",
"notification": "Updated group notification",
"introduction": "Updated group introduction",
"faceURL": "http://example.com/new/path/to/face/image.png",
"ex": {
"value": "Updated extra data"
},
"needVerification": {
"value": 0
},
"lookMemberInfo": {
"value": 1
},
"applyMemberFriend": {
"value": 0
}
}
}

应答包字段说明

字段类型描述
actionCode0表示业务系统的回调是否正确执行。0表示操作成功。
errCode5001表示自定义错误码,范围在5000-9999之间。在 actionCode 不等于0时设置;在 nextCode 等于1时设置。
errMsg"An error message"自定义错误码对应的简单错误信息。
errDlt"Detailed error information"自定义错误码对应的详细错误信息。
nextCode1下一步执行指令,1表示拒绝继续执行,actionCode 等于0时设置。
groupIDstring群组的唯一标识符
groupNamestring群组的名称
notificationStringValue群组的通知信息
introductionStringValue群组的简介
faceURLStringValue群组的图标的URL
exStringValue额外的数据字段
needVerificationInt32Value是否需要验证加入群组
lookMemberInfoInt32Value是否可以查看群成员信息
applyMemberFriendInt32Value是否可以申请加群成员为好友