# 拉取指定聊天的聊天记录

# 请求方式

GET

# 请求地址

https://nbd-api.myscrm.cn/bff-nbd-qw-openapi/v1/chat-record/pull

# 请求参数

# 示例

curl https://nbd-api.myscrm.cn/bff-nbd-qw-openapi/v1/chat-record/pull?app_id=xxx
&chat_id=xxx
&keyword=xxx
&start_time=1689732852000
&end_time=1689819252000
&type=text
&page_size=10
&cursor=
&thumb_option=image/resize,w_106
&asc=true
&sender_type=1

# 说明

❗️❗️❗️ 返回的文件地址均为临时地址,一小时内有效。
❗️❗️❗️ 强烈建议接入方实施登录态鉴权,数据对接请使用此接口

参数 类型 必须 说明
app_id string 企微中台应用 id
chat_id string 企微中台聊天 id
keyword string 消息文本搜索词
start_time uint64 搜索起始时间,毫秒时间戳
end_time uint64 搜索起始时间,毫秒时间戳
type string 消息类型,默认为所有消息类型,参见说明
thumb_option string 图片缩放参数,参见阿里云 OSS 文档 (opens new window)
page_size int 每页记录数
cursor string 下一页的游标,首次拉取传空
asc bool 是否按发送时间正序,默认为倒序
sender_type int 发送者类型:0-全部;1-员工;2-外部联系人

# 返回参数

# 示例

{
  "errcode": 0,
  "errmsg": "ok",
  "list": [
    {
      "chat_record_id": "3a0c793e-042b-228c-699d-7a5d84b41611",
      "qw_chat_record_id": "21904336554441465850_1689651309653_external",
      "action": "action",
      "sender_id": "woD2JCDwAAmWSuw2xAxWsV1Nmihz5Kdx",
      "receiver_ids": ["woD2JCDwAArHdkBUH9uyILlQs1RTyo9q"],
      "send_time": 1689651305443,
      "type": "text",
      "hit_keyword_rules": [
        // 实时计算出的本记录触发了哪些关键词规则列表
        {
          "rule_id": "4dddedd4-c5e7-436f-be4f-d58adc283a3b",
          "rule_name": "过度承诺",
          "keywords": ["保证", "一定"]
        }
      ],
      "is_recall": true,
      "recall_time": 1689651340643,
      "text": {
        "content": "您好,请问您有什么需要咨询的"
      },
      "image": {
        "oss_url": "string",
        "thumb_url": "string"
      },
      "video": {
        "oss_url": "string",
        "length": 0
      },
      "voice": {
        "oss_url": "string",
        "length": 0
      },
      "agree": {
        "user_id": "string",
        "agree_time": 0
      },
      "disagree": {
        "user_id": "string",
        "disagree_time": 0
      },
      "file": {
        "oss_url": "string",
        "filename": "string",
        "size": 0
      },
      "miniprogram": {
        "title": "string",
        "description": "string",
        "username": "string",
        "miniprogram_name": "string"
      },
      "redpacket": {
        "type": 0,
        "wish": "string",
        "count": 0,
        "total_amount": 0
      },
      "link": {
        "title": "string",
        "description": "string",
        "url": "string",
        "image_url": "string"
      },
      "card": {
        "corp_name": "string",
        "user_id": "string"
      },
      "location": {
        "longitude": 0,
        "latitude": 0,
        "address": "string",
        "title": "string",
        "zoom": 0
      },
      "docmsg": {
        "title": "string",
        "link_url": "string",
        "doc_creator": "string"
      },
      "emotion": {
        "type": 0,
        "width": 0,
        "height": 0,
        "oss_url": "string",
        "size": 0,
        "thumb_url": "string"
      }
    }
  ],
  "next_cursor": "xxxxxxxxxxxxx"
}