Skip to content

NXCC API Webhook

henryou edited this page Aug 10, 2023 · 5 revisions

通话记录回调

请求URL

  • 通话记录推送的Http接口地址(在呼叫中心设置中配置)
  • 例如: http://you.domain/cc/callback

请求方式

  • POST

  • Method:POST

  • Content-Type:application/json

  • 需要鉴权:

参数

参数名 类型 说明
agentName String 客服账号,可能为空
agentNickName String 客服昵称,可能为空
answered Boolean 是否接听
answerTime Long 呼叫接通时间(时间戳 毫秒)
callDuration Integer 通话时长
callee String 被叫号码
caller String 主叫号码
callId String 通话 id
direction Integer 呼叫方向,0:呼入,1:呼出,2:AICC
dtmfKeys String dtmf 按键,多个时候使用英文逗号分割
endTime Long 呼叫结束时间(时间戳 毫秒)
hangupBy Integer 挂断方,挂断方,0:客服挂断,1:用户挂断,2:未知
hangupCode Integer 挂断原因码
callStatus String 通话状态
hangupReason String 挂断原因说明
inQueueTime Long 入队时间戳(时间戳 毫秒)
leaveMsgUrl String 留言 url
orderId String 订单 id
other String 透传信息
intent String 意图名称
outQueueTime Long 出队时间戳(时间戳 毫秒)
queueDuration Integer 排队时长(单位 秒)
recordUrl String 录音 url
ringDuration Integer 响铃时长(单位 秒)
ringTime Long 呼叫响铃时间(时间戳 毫秒)
startTime Long 呼叫开始时间(时间戳 毫秒)
taskId String 任务 ID,direction=2时展示的AICC任务信息
totalCustomerPrice Double 费用

推送示例

curl POST '<client_server_address>/callback' \
--header 'token: <token>' \
--header 'Content-Type: application/json' \
--data-raw '{"agentName":"[email protected]","answerTime":1691372192000,"callDuration":7,"callId":"b1920376-5e15-4f22-9996-6233f297685e","callee":"[email protected]:5060","caller":"85235757581","direction":2,"endTime":1691372213000,"intent":"转人工-成功","orderId":"ORDER_ID","other":"OTHER","startTime":1691372191000,"taskId":"1688363452814331904"}'

用户返回值

程序按照客户服务返回 HTTP response status code 来确定推送是否成功。 成功: 200 OK 失败: Others

简介

短信

语音

云呼叫中心(NXLink)

云呼叫中心(AI自动外呼)

Flash Call

短链

邮件验证码

DID号码

通用

号码检测

WhatsApp

Viber

Zalo ZNS

Super Message API

隐私号(旧)

PNS

坐席(旧版)

AI Agent

Clone this wiki locally