友米聚合 - 开放API
  1. ChatMess
友米聚合 - 开放API
  • 应用场景
    • 自有订单系统 嵌入 企客聊侧边栏
  • v1
    • 文档
      • 介绍
        • 开发文档阅读说明
        • 错误码返回说明
      • 入门说明
        • 生成signature
        • 获取TOKEN方法
        • 请求Headers说明
      • 接口详情
        • 基础数据类接口
        • 数据读取类接口
        • 行为操作类接口
        • 回调数据
  • v2
    • 事件发布格式说明
    • ChatMess
      • 发送消息
        POST
      • 申请接管
        POST
      • 终止接管
        POST
      • 激活会话
        POST
      • 发送通知
        POST
      • 读取聊天记录
        POST
    • Report
      • 获取员工客服统计
      • 获取员工激活客户数统计
    • System
      • 获取部门列表
      • 根据部门获得组
      • 根据组获得员工
      • 获得员工列表
    • Friend
      • 读取粉丝列表
      • 读取粉丝总数
    • Todo
      • 新增待办记录
      • 新增待办记录(返回编号)
      • 获取待办列表
      • 获取待办列表总数
    • Ad
      • 读取广告列表
      • 读取广告条数
    • BulkSend
      • 保存RPA群发
      • 删除RPA群发
    • 注册回调地址
      POST
    • 订阅事件
      POST
    • 获取商户TOKEN
      POST
  1. ChatMess

读取聊天记录

POST
/v2/ChatMess/GetChat
ChatMess
消息类型含义ad_chatting_content格式ad_chatting_resvred格式(urlDecode解码)
1文本
2/3/4图片imgs[图片KEY];需要查看大图时:key_hd,助手必须打开自动查看原图或客户端发送查看大图的任务
4/34语音audio[语音KEY]或audioT[语音KEY]{"downloadKey":"语音文件","type":-1,"videoLen":语音长度(秒)}
42名片MP[联系人昵称]{"nickname":"名片名称"}
48位置a(位置链接){"desc":"详细地址","thumbUrl":"缩略图","title":"位置标题","url":"位置链接"}
49链接a(链接地址){"title":"链接标题","url":"链接地址"}
50视频聊天
495群聊邀请{"desc":"邀请描述","thumbUrl":"缩略图","title":"邀请标题","url":"邀请链接"}
496文件file[文件KEY]{"title":"文件名称","totalLen":文件大小,"url":""}
1001分享名片
4919聊天记录转发
4933小程序{"appIconUrl":"小程序小图标","displayName":"小程序名称","downloadKey":"小程序封面KEY","title":"小程序标题"}
4362群收款,群红包,红包
7549视频号{"avatar":"视频号头像","description":"视频号描述","nickname":"视频号名称","thumbUrl":"封面缩略图"}
8220引用{"type":"消息类型,与原有消息类型一致,代表引用的是什么类型的消息","content":"引用的消息的文本内容","title":"文件和链接消息的标题","downloadKey":"需要下载资源的消息(图片视频文件)","url":"链接消息的url"}
9730直播{"avatar":"直播头像","description":"直播描述","nickname":"直播名称","thumbUrl":"封面缩略图"}
10000系统消息
10001标识符更新
10002好友验证
10003好友申请
10004异常通知
10005实名信息
11001待办消息
12001托管消息{"key":"托管标识","name":"申请人昵称","reason":"申请理由"}

请求参数

Header 参数
Authorization
可选
授权TOKEN,Bearer
TenantId
可选
租户ID,仅限代理商使用
Body 参数application/json
object  | null 
可选
startTimestamp
integer 
开始时间戳(秒)
可选
可选
endTimestamp
integer 
结束时间戳(秒)
可选
可选
fansKey
string 
粉丝标识
必需
wechatId
integer 
运营号ID
必需
wechatKey
string 
运营号标识
可选
minChattingId
integer 
最小聊天ID
可选
用于增量同步
pageSize
string 
必需
pageIndex
string 
必需
示例
{
  "startTimestamp": 0,
  "endTimestamp": 0,
  "fansKey": "string",
  "wechatId": 0,
  "wechatKey": "string",
  "minChattingId": 0,
  "pageSize": "string",
  "pageIndex": "string"
}

示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST '/v2/ChatMess/GetChat' \
--header 'Authorization;' \
--header 'TenantId;' \
--header 'Content-Type: application/json' \
--data-raw '{
    "startTimestamp": 0,
    "endTimestamp": 0,
    "fansKey": "string",
    "wechatId": 0,
    "wechatKey": "string",
    "minChattingId": 0,
    "pageSize": "string",
    "pageIndex": "string"
}'

返回响应

🟢200Success
application/json
Body
requestId
null 
必需
errmsg
integer 
必需
succeed
boolean 
必需
msgTime
string 
必需
values
array [object {17}] 
必需
ad_chatting_id
integer 
聊天ID
必需
ad_chatting_talter
string 
粉丝标识
必需
ad_chatting_issend
integer 
运营号发送
必需
1=运营号发送;0=粉丝发送
ad_chatting_resvred
string  | null 
附加数据
必需
ad_wechat_id
integer 
运营号ID
必需
merchantid
string 
租户ID
必需
ad_chatting_updatetime
string 
聊天更新时间
必需
ad_chatting_sate
integer 
消息类型
必需
ad_sermsgid
string 
消息ID
必需
ad_chatting_time
string 
聊天时间
必需
ad_chatting_content
string 
聊天内容
必需
ad_staff_code
string  | null 
操作员工
必需
ad_voice_txt
null 
语音转文字
必需
ad_friend_photo
string 
粉丝头像
必需
ad_friend_name
string 
粉丝昵称
必需
ad_expand
string 
聊天归属
必需
ad_wechat_nober
string 
运营机微信号
必需
errdesc
null 
必需
示例
{
  "requestId": null,
  "errmsg": 0,
  "succeed": true,
  "msgTime": "string",
  "values": [
    {
      "ad_chatting_id": 0,
      "ad_chatting_talter": "string",
      "ad_chatting_issend": 0,
      "ad_chatting_resvred": "string",
      "ad_wechat_id": 0,
      "merchantid": "string",
      "ad_chatting_updatetime": "string",
      "ad_chatting_sate": 0,
      "ad_sermsgid": "string",
      "ad_chatting_time": "string",
      "ad_chatting_content": "string",
      "ad_staff_code": "string",
      "ad_voice_txt": null,
      "ad_friend_photo": "string",
      "ad_friend_name": "string",
      "ad_expand": "string",
      "ad_wechat_nober": "string"
    }
  ],
  "errdesc": null
}
上一页
发送通知
下一页
获取员工客服统计
Built with