所有api接口都需要鉴权规则,具体详情前往新平台鉴权规则查看

1.查询会话列表

  • 请求路径 /openapi/im-center/webchat/v1/list
  • 请求参数
字段名称 字段类型 是否必传 字段描述 示例 备注
createTime string[] 会话创建时间 ['2021-01-04 00:00:00', '2021-01-05 00:00:00'] 数组元素最大为2,最小为1
visitorName string 访客昵称 'mqqqiioepyaSa'
sessionId string 会话ID 'c2bd32e3-b1e2-4589-b5bb-70a7ab625533'
agentId string 坐席ID '5fd86ab7cde3f40e6a47f8a7'
platform string 渠道 'pc'
accessId string 接入号ID 'c2bd32e3-b1e2-4589-b5bb-70a7ab625533'
peerId string 技能组ID '2000113'
convertManualTime string[] 转人工时间 ['2021-01-04 00:00:00', '2021-01-05 00:00:00'] 数组元素最大为2,最小为1
manualTime string[] 转人工成功时间 ['2021-01-04 00:00:00', '2021-01-05 00:00:00'] 数组元素最大为2,最小为1
endTime string[] 会话结束时间 ['2021-01-04 00:00:00', '2021-01-05 00:00:00'] 数组元素最大为2,最小为1
createTagentFirstReplyTimeime string[] 坐席首次响应时间 ['2021-01-04 00:00:00', '2021-01-05 00:00:00'] 数组元素最大为2,最小为1
totalMessageCount number 总消息数 10
visitorMessageCount number 访客消息数 2
agentReplyMessageCount number 坐席消息数 4
seoSource string 搜索来源 '百度'
seoKeywords string 搜索关键词 '七陌'
finishKey string 结束类型 'session_to_leave_finish' enum: ['system_error_finish', 'system_process_finish', 'queue_give_up', 'agent_finish', 'visitor_finish', 'system_auto_finish_session', 'session_to_leave_finish']
area string 地域 '中国 北京 北京' 必须是 国家+空格+省份+空格+城市 的格式
ip string ip '172.16.88.204'
limit number 限制条数 10 最大不超过50
page number 查询页 1
  • 请求示例
curl -X POST \
  https://152.136.72.209:5100/openapi/im-center/webchat/v1/list \
  -H 'Content-Type: application/json' \
  -d '{
      "limit": 10,
      "page": 1,
      "createTime": [
        "2021-01-04 00:00:00"
      ],
      "visitorName": "mqqqiioepyaSa",
      "sessionId": "c2bd32e3-b1e2-4589-b5bb-70a7ab625533",
      "agentId": "5fd86ab7cde3f40e6a47f8a7",
      "platform": "pc",
      "accessId": "c2bd32e3-b1e2-4589-b5bb-70a7ab625533",
      "peerId": "2000113",
      "convertManualTime": [
        "2021-01-04 00:00:00"
      ],
      "manualTime": [
        "2021-01-04 00:00:00"
      ],
      "endTime": [
        "2021-01-04 00:00:00"
      ],
      "agentFirstReplyTime": [
        "2021-01-04 00:00:00"
      ],
      "totalMessageCount": 2,
      "visitorMessageCount": 3,
      "agentReplyMessageCount": 1,
      "seoSource": "百度",
      "seoKeywords": "七陌",
      "finishKey": "session_to_leave_finish",
      "area": "中国 北京 北京",
      "ip": "172.16.88.204"
}'
  • 返回参数
字段名称 字段类型 字段描述
createTime string[] 会话创建时间
visitorId string 访客ID
_id string 会话ID
agentId string 坐席ID
platform string 渠道
accessId string 接入号ID
convertManualTime string[] 转人工时间
manualTime string[] 转人工成功时间
endTime string[] 会话结束时间
createTagentFirstReplyTimeime string[] 坐席首次响应时间
totalMessageCount number 总消息数
visitorMessageCount number 访客消息数
agentReplyMessageCount number 坐席消息数
seoSource string 搜索来源
seoKeywords string 搜索关键词
finishKey string 结束类型
area string 地域
ip string ip
  • 返回示例
{
    "success":true,
    "message":"200 ok!",
    "list": [
      {
        "_id": "30c472b2-df52-4002-b1eb-b92c510a83cb",
        "visitorId": "2000113@bBbkkQehbqFFpBiw@wPdzTth9@web",
        "account": "2000113",
        "createTime": "2021-01-06 14:00:46",
        "createTimestamp": 1609912846676,
        "accessId": "bBbkkQehbqFFpBiw",
        "platform": "pc",
        "visitorName": "mqqqiioj4rLzt",
        "status": "deal",
        "ip": null,
        "totalMessageCount": 2,
        "toPeer": "11000019",
        "agentId": "5fe18dbcd1ead75436b3dfbe",
        "agentReplyMessageCount": 1
      }
    ]
}

2.查询会话详情

  • 请求路径 /openapi/im-center/webchat/v1/info
  • 请求参数
字段名称 字段类型 是否必传 字段描述 示例
sessionId string 会话Id 'c2bd32e3-b1e2-4589-b5bb-70a7ab625533'
  • 请求示例
curl -X POST \
  https://152.136.72.209:5100/openapi/im-center/webchat/v1/info \
  -H 'Content-Type: application/json' \
  -d '{
      "sessionId": "c2bd32e3-b1e2-4589-b5bb-70a7ab625533"
}'
  • 返回参数

chatSession

字段名称 字段类型 字段描述
_id string 会话ID
userIds string[] 处理过该会话的坐席
autoClaimVersions string[] 自动领取会话版本号
visitorId string 访客ID
accountId string 账户编号
createTime string 会话创建时间
createTimestamp number 会话创建时间戳
accessId string 接入号ID
platform string 渠道
autoClaimVersion string 自动领取会话版本号
visitorName string 访客名称
isNewVisitor boolean 是否为新访客
status string 会话状态
isInvite boolean 是否为邀请会话
isNewSession boolean 是否为新会话
processNodeId string 流程ID
currentNodeId string 当前节点ID
processName string 流程名称
isVisitorBreak boolean 访客是否离线
ip string ip
lastMessageTimestamp number 最后一条消息时间戳
lastMessage object 最后一天消息
leakNum string 未读消息数
totalMessageCount number 总消息数
toPeer string 技能组ID
serviceMan string 人工/机器人
agentId string 坐席ID
agentClaimTimestamp number 坐席领取会话时间戳
lastVisitorMessageTimestamp number 访客最后一条消息时间戳
visitorStartWaitTimestamp number 访客等待时间戳
agentReplyMessageCount number 坐席回复消息数
lastAgentMessageTimestamp number 坐席最后一天消息时间戳
accessName string 接入号名称
inviteTimes number 邀请会话次数
dialogueTimes number 总会话次数
convertManualTime string[] 转人工时间
manualTime string[] 转人工成功时间
endTime string[] 会话结束时间
finishKey string 结束类型

scheduleHistory

字段名称 字段类型 字段描述
dateTime string 节点时间
processNodeType string 节点类型
processNodeId string 节点ID
processNodeName string 节点名称
  • 返回示例
{
    "success":true,
    "message":"200 ok!",
    "chatSession": {
      "_id": "30c472b2-df52-4002-b1eb-b92c510a83cb",
      "userIds": [
        "5fe18dbcd1ead75436b3dfbe"
      ],
      "autoClaimVersions": [],
      "visitorId": "2000113@bBbkkQehbqFFpBiw@wPdzTth9@web",
      "accountId": "2000113",
      "createTime": "2021-01-06 14:00:46",
      "createTimestamp": 1609912846676,
      "accessId": "bBbkkQehbqFFpBiw",
      "platform": "pc",
      "autoClaimVersion": "0.3247433251134335_1609912846676",
      "visitorName": "mqqqiioj4rLzt",
      "isNewVisitor": false,
      "status": "deal",
      "isInvite": false,
      "isNewSession": false,
      "processNodeId": "5dc0d5419740472c53b6088e",
      "currentNodeId": "7f8aeb724a8b4ab3b27a2d2989c7bf0c",
      "processName": "网站测试流程",
      "redisRecordDelayTimestamp": 1609912846696,
      "isVisitorBreak": false,
      "ip": null,
      "lastMessageTimestamp": 1609912875644,
      "lastMessage": {
        "contentType": "text",
        "content": "1233",
        "lastMessageFrom": "agent"
      },
      "leakNum": 1,
      "totalMessageCount": 2,
      "toPeer": "11000019",
      "serviceMan": "manual",
      "agentId": "5fe18dbcd1ead75436b3dfbe",
      "agentClaimTimestamp": 1609912857511,
      "lastVisitorMessageTimestamp": 1609912857511,
      "visitorStartWaitTimestamp": 1609912857511,
      "agentReplyMessageCount": 1,
      "lastAgentMessageTimestamp": 1609912875644,
      "accessName": "123",
      "inviteTimes": 0,
      "dialogueTimes": 2
    },
    "scheduleHistory": [
      {
        "dateTime": "2021-01-06 14:00:46",
        "processNodeType": "im-node-start",
        "processNodeId": "startNode",
        "processNodeName": "开始节点"
      },
      {
        "dateTime": "2021-01-06 14:00:46",
        "processNodeType": "im-node-date",
        "processNodeId": "5d442f0efefc4418bc2c92d3362696be",
        "processNodeName": "时间条件"
      },
      {
        "dateTime": "2021-01-06 14:00:46",
        "processNodeType": "im-node-date",
        "processNodeId": "5d442f0efefc4418bc2c92d3362696be-0",
        "processNodeName": "工作时间"
      },
      {
        "dateTime": "2021-01-06 14:00:46",
        "processNodeType": "im-node-menu",
        "processNodeId": "ac714693522d42f69fc09528917ef7b8",
        "processNodeName": "引导菜单"
      },
      {
        "dateTime": "2021-01-06 14:00:57",
        "processNodeType": "im-node-menu",
        "processNodeId": "ac714693522d42f69fc09528917ef7b8-0",
        "processNodeName": "售前咨询"
      },
      {
        "dateTime": "2021-01-06 14:00:57",
        "processNodeType": "im-node-transfer",
        "processNodeId": "7f8aeb724a8b4ab3b27a2d2989c7bf0c",
        "processNodeName": "转人工"
      }
    ]
}

3.查询消息列表

  • 请求路径 /openapi/im-center/webchat/v1/history
  • 请求参数
字段名称 字段类型 是否必传 字段描述 示例
visitorId string 访客Id '68faa192-a2b1-406c-b877-eda927a64f75'
sessionId string 会话Id 'c2bd32e3-b1e2-4589-b5bb-70a7ab625533'
dateTime number 时间 1609230072740
limit number 限制条数 10
page number 限制页数 1
  • 请求示例
curl -X POST \
  https://152.136.72.209:5100/openapi/im-center/webchat/v1/info \
  -H 'Content-Type: application/json' \
  -d '{
      "visitorId": "68faa192-a2b1-406c-b877-eda927a64f75",
      "dateTime": 1609230072740,
      "sessionId": "68faa192-a2b1-406c-b877-eda927a64f75",
      "limit": 10,
      "page": 1
}'
  • 返回参数
字段名称 字段类型 字段描述
_id string 消息ID
flowList string 列表消息
contentList string 答案列表
accountId string 账户
visitorId string 访客ID
contentType string 消息类型
content string 消息内容
platform string 渠道
createTimestamp number 创建时间戳
createTime string 创建时间
type string 类型 in/out
accessId string 接入号ID
isShowHtml boolean 是否展示Html
isHide boolean 是否隐藏本条消息
dealCustomerMsg boolean 访客发的消息是否被坐席阅读
dealUserMsg boolean 坐席发的消息是否被访客阅读
sessionId string 会话ID
  • 返回示例
{
    "success":true,
    "message":"200 ok!",
    "messageList": [
      {
        "_id": "fhuehuhf89e74y33e86589",
        "flowList": [],
        "contentList": [],
        "accountId": "2000113",
        "visitorId": "2000113@pRSCklwD6TZKRVXT@wS0sCnQt@web",
        "contentType": "text",
        "content": "售前咨询",
        "platform": "pc",
        "createTimestamp": 1609210318941,
        "createTime": "2020-12-29 10:51:58",
        "type": "in",
        "accessId": "ehE2k1KpaVOL4MHU",
        "isShowHtml": true,
        "isHide": false,
        "isExistFocusWords": false,
        "dealCustomerMsg": false
      }
    ]
}