Skip to content

NXCC API Webhook

aofei edited this page Feb 19, 2025 · 5 revisions

通话记录回调

请求URL

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

请求方式

  • POST

  • Method:POST

  • Content-Type:application/json

  • 需要鉴权:

鉴权方式

  • API key方式:

    采用的是token方式。

  • Digest auth

参数名称 参数类型 是否必填 示例值 参数描述
accessKey String fme2na3kdi3ki 用户身份标识
ts String 1655710885431 当前请求的时间戳(单位是毫秒),牛信服务端允许用户端请求最大时间误差为60000毫秒
bizType String 8 业务类型
action String callback API接口方法,参数值参照各API接口文档中的说明
sign String 6e9506557d1f289501d333ee2c365826 API入参参数签名,签名算法
algorithm String md5 签名哈希算法,可用md5,sha256(默认md5)

参数

参数名 类型 说明
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 BigDecimal 费用
lineIp String 线路IP
mediaIp String 预留,目前为空值
termSipCode Integer 线路返回的sipcode
hangupCause String 线路返回的hangupCause
mos BigDecimal 语言质量mos值,值越大语言质量越好

推送示例

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"}'
curl POST '<client_server_address>/callback' \
--header 'accessKey: <accessKey>' \
--header 'ts: <ts>' \
--header 'bizType: <bizType>' \
--header 'action: <action>' \
--header 'sign: <sign>' \
--header 'algorithm: <algorithm>' \
--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"}'

hangupCode含义

挂断码 类型 说明
1000 呼入 正常结束
1001 呼入 正常结束-坐席挂断
1002 呼入 正常结束-用户挂断
1003 呼入 正常结束-留言信箱
1004 呼入 正常结束-网络中断
10031 呼入 正常结束-留言信箱-坐席全忙
10032 呼入 正常结束-留言信箱-无坐席在线
1101 呼入 呼入未接-坐席速挂
1102 呼入 呼入未接-用户速挂
1103 呼入 呼入未接-用户排队放弃
11031 呼入 呼入未接-用户排队放弃-坐席全忙
11032 呼入 呼入未接-用户排队放弃-无坐席在线
1104 呼入 呼入未接-用户排队超时
11041 呼入 呼入未接-用户排队超时-坐席全忙
11042 呼入 呼入未接-用户排队超时-无坐席在线
1105 呼入 呼入未接-无坐席在线
1106 呼入 呼入未接-坐席全忙
1107 呼入 呼入未接-黑名单号码
1108 呼入 呼入未接-用户取消
1109 呼入 呼入转外部号码-外线挂断
1110 呼入 呼入转外部号码-无法接通
1111 呼入 呼入转外部号码-用户挂断
2000 呼出 正常结束
2001 呼出 正常结束-坐席挂断
2002 呼出 正常结束-用户挂断
2003 呼出 正常结束-坐席取消
2004 呼出 正常结束-网络中断
2101 呼出 呼出未接-坐席速挂
2102 呼出 呼出未接-用户速挂
2103 呼出 呼出未接-用户响铃拒接
2104 呼出 呼出未接-超时未接
2105 呼出 呼出未接-黑名单号码
2106 呼出 呼出未接-呼叫限制号码
2107 呼出 呼出未接-呼叫限制(体验次数)
2201 呼出 无法接通-呼叫拒绝
2202 呼出 无法接通-暂时无法接通
2203 呼出 无法接通-线路繁忙
2204 呼出 无法接通-呼叫异常
2205 呼出 无法接通-无法接通
2206 呼出 无法接通-坐席取消
3000 AICC 正常结束
3001 AICC 转人工成功-坐席挂断
3002 AICC 转人工成功-用户挂断
3003 AICC 转人工成功-网络中断
3101 AICC 转人工失败-坐席速挂
3102 AICC 转人工失败-用户速挂
3103 AICC 转人工失败-用户排队放弃
3104 AICC 转人工失败-用户排队超时
31041 AICC 转人工失败-用户排队超时-坐席全忙
31042 AICC 转人工失败-用户排队超时-无坐席在线
3105 AICC 转人工失败-无坐席在线
3106 AICC 转人工失败-坐席全忙
3107 AICC 转人工失败-用户取消

推送返回规范

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

简介

短信

语音

云呼叫中心(NXLink)

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

Flash Call

短链

邮件验证码

DID号码

通用

号码检测

WhatsApp

Viber

Zalo ZNS

Super Message API

隐私号(旧)

PNS

坐席(旧版)

AI Agent(对外api)

Clone this wiki locally