# 获取指定聊天记录
# 请求方式
GET
# 请求地址
https://nbd-api.myscrm.cn/open-nbd-qw-msgaudit/v1/raw-chat-record/get
# 请求参数
# 示例
https://nbd-api.myscrm.cn/open-nbd-qw-msgaudit/v1/raw-chat-record/get?app_id=xxx&chat_record_id=xxxx&action=send&thumb_option=image/resize,m_fixed,w_100,h_100/rotate,90
# 说明
参数 | 类型 | 必须 | 说明 |
---|---|---|---|
app_id | string | 是 | 企微中台应用 id |
chat_record_id | string | 是 | 企微中台聊天消息 id |
thumb_option | string | 否 | 缩略图参数,见说明 (opens new window) |
# 返回参数
# 示例
{
"errcode": 0,
"errmsg": "ok",
"encrypted": "加密内容"
}
# 说明
参数 | 类型 | 说明 |
---|---|---|
encrypted | string | 加密的聊天记录,解密方式与企微回调信息的解密方式 (opens new window)一致,加解密使用的 key 是对应企业的会话存档能力的回调 encoding_aes_key |
encrypted 解密后的结构:
{
"action": "send",
"chat_id": "xxxx",
"chat_record_id": "xxxx",
"corp_id": "ww3e3e5b8f4aa4fd94",
"e_id": "xxxx",
"msgid": "xxxxx",
"msgtime": 1654313050127,
"msgtype": "image",
"roomid": "",
"from": "xxxxx",
"tolist": ["wm-TUtCAAALORBagqUA3xSa8pwJEX33Q"],
"is_revoke": 0,
"revoke_time": 0,
"voiceid": "",
"voipid": "",
"sender_type": 1,
"image": {
"filesize": 1978643,
"md5sum": "a81db2e97c9b8fe4df6b215a06e163cc",
"oss_url": "xxxxxx",
"sdkfileid": "xxxxxx"
}
}
参数 | 类型 | 说明 |
---|---|---|
action | string | 消息动作:send-发送,recall-撤回 |
chat_id | string | 企微中台聊天 id |
chat_record_id | string | 企微中台聊天消息 id |
corp_id | string | 企微企业 id |
e_id | string | 企微中台企业 id |
msgid | string | 企微消息 id |
msgtime | uint64 | 消息发送的毫秒时间戳 |
msgtype | string | 消息类型:text、image、revoke、agree、disagree、voice、video、card、location、emotion、file、link、chatrecord、todo、vote、collect、redpacket、meeting、docmsg、markdown、news、calendar、mixed、meeting_voice_call、voip_doc_share,voiptext,qydiskfile,类型名称与企微文档 (opens new window)一致 |
roomid | string | 群聊消息的群 id,单聊则为空 |
from | string | 消息发送方 id,与企微文档 (opens new window)定义一致 |
tolist | string[] | 消息接收方 id 列表,与企微文档 (opens new window)定义一致 |
is_revoke | int | 消息是否撤回:0-未撤回,1-已撤回,action=send 时才有可能为 1 |
revoke_time | uint64 | 消息撤回的毫秒时间戳,未撤回时为 0 |
voiceid | string | 音频 id,msgtype=meeting_voice_call 时有值 |
voipid | string | 音频 id,msgtype=voip_doc_share 时有值 |
sender_type | int32 | 发送方类型:0-未知,1-成员,2-外部联系人,3-机器人 |
消息详情 | object | 与企微文档 (opens new window)定义一致。当消息中含有 sdkfileid 字段时,会存在对应的字段 oss_url,oss_url 是该聊天消息中的文件在企微中台存储中的临时访问链接,有效期为 1 小时 |
# 注意事项
- 目前 chatrecord、mixed 消息中的文件存在无法访问的问题,正在修复中
← 拉取聊天记录 获取统计规则的触发记录 →