# 拉取统计规则的触发记录

# 请求方式

GET

# 请求地址

https://nbd-api.myscrm.cn/open-nbd-qw-msgaudit/v1/rule-trigger-record/pull

# 请求参数

# 示例

https://nbd-api.myscrm.cn/open-nbd-qw-msgaudit/v1/rule-trigger-record/pull?app_id=xxx&start_time=1653898875000&end_time=1654071675000&chat_id=xxxxx&data_type=1&page_size=10&cursor=

# 说明

参数 类型 必须 说明
app_id string 企微中台应用 id
start_time uint64 拉取起始时间,毫秒时间戳,默认为拉取近 3 天的触发记录数据,与拉取结束时间间隔不能超过 3 天
end_time uint64 拉取结束时间,毫秒时间戳
chat_id string 企微中台聊天 id
data_type int 数据类型:0-所有(默认),1-员工,2-客户
asc bool 是否按发送时间正序,默认为倒序
page_size uint32 每页记录数,默认为 10,不超过 1000
cursor string 游标,开始拉取时为空

# 返回参数

# 示例

{
  "errcode": 0,
  "errmsg": "ok",
  "encrypted": "加密内容",
  "next_cursor": "xxxxxxxxxxxxxxx"
}

# 说明

参数 类型 说明
encrypted string 加密的触发记录列表,解密方式与企微回调信息的解密方式 (opens new window)一致,加解密使用的 key 是对应企业的会话存档能力的回调 encoding_aes_key。解密后得到的是对象数组 json 字符串
next_cursor string 下一页游标,没有更多数据时为空

encrypted 解密后的结构:

[
  {
    "app_id": "xxxx",
    "chat_id": "xxxx",
    "chat_record_id": "xxxx",
    "classification_id": "xxxx",
    "classification_name": "xxxx",
    "content": "xxxx",
    "e_id": "xxxx",
    "from_user_id": "xxxx",
    "from_user_name": "xxxx",
    "hit_key_word": "xxxx",
    "msg_id": "xxxx",
    "msg_time": 1653985275589,
    "projects": [
      {
        "organ_proj_id": "xxxx",
        "organ_proj_name": "xxxx"
      }
    ],
    "record_id": "xxxx",
    "rule_id": "xxxx",
    "rule_name": "1",
    "to_user_id": "xxxx",
    "to_user_name": "xxxx",
    "to_user_type": 1
  }
]
参数 类型 说明
app_id string 企微中台应用 id
chat_id string 企微中台聊天 id
chat_record_id string 企微中台聊天消息 id
classification_id string 触发的统计规则分类 id
classification_name string 触发的统计规则分类名称
content string 触发记录对应的企微文本消息内容
e_id string 企微中台企业 id
from_user_id string 发送者 id,企微员工 id 或外部联系人 id
from_user_name string 发送者名称
hit_key_word string 命中的关键词
msg_id string 触发记录对应的企微消息 id
msg_time uint64 触发记录对应的企微消息发送的毫秒时间戳
projects.organ_proj_id string 触发记录归属的项目 id
projects.organ_proj_name string 触发记录归属的项目名称
record_id string 触发记录 id
rule_id string 触发的统计规则 id
rule_name string 触发的统计规则名称
to_user_id string 接受者 id,to_user_type=1 时为企微员工 id 或外部联系人 id,to_user_type=2 时为企微群聊 id
to_user_name string 接受者名称
to_user_type int 聊天类型:1-单聊,2-群聊