Skip to content

机器人进群/出群

事件描述

应用机器人被用户添加/移出群聊时触发此事件

订阅说明

事件主体kso.xz.group.chat.robot
回调地址请先在开发者后台-事件订阅模块配置地址
支持应用类型企业自建应用、第三方企业应用
权限要求订阅群组变更通知(kso.im.chat.read.notification)
解密方式详见 解密算法

事件体(解密前)

名称类型说明
topicstring消息主题(值为"kso.xz.group.chat.robot")
operationstring消息变更动作(创建:create 删除:delete)
timeinteger时间(秒为单位的时间戳)
noncestringiv向量(解密时使用)
signaturestring消息签名
encrypted_datastring消息变更的加密字段

事件体示例(解密前)

json
{
  "topic": "kso.xz.group.chat.robot",
  "operation": "create",
  "nonce": "xxxxxx",
  "signature": "xxxxxxxxxxxx",
  "time": 0, // 秒为单位的时间戳
  "encrypted_data": "xxxxxx"
}

事件体(解密后)

名称类型说明
chat_idinteger会话id
company_idstring会话归属企业id
operatorobject操作者信息
 ∟ user_idinteger操作者用户id
 ∟ company_idinteger操作者归属企业id

事件体示例(解密后)

json
data: {
    "chat_id": 22222,            // 会话id
    "company_id": "string",        // 企业id
    "operator": {
        "user_id": 123452,   // 操作者id
        "company_id": 23456543     // 操作者所属企业id
    }
}