Skip to content

PNS API webhook

justin4515 edited this page Sep 2, 2024 · 13 revisions

概要

  • 通话结果推送

请求URL

  • 通过提供URL,给研发人员进行配置

请求方式

  • Method: POST
  • Content-Type: application/json

重试规则

一般情况下,话单信息将在通话结束后推送回指定的地址。收到HTTP 200 OK代表已接受回执推送,本次请求将视为已完成。 如果收到HTTP ERROR信息,NXCLOUD将在60分钟内,每分钟重试推送。直到成功为止,如果超过60分钟仍然失败,则不再重复推送。

请求Body

{
  "bindId": "d8670xxxxxxxxxx28e4b",
  "customerBindId": "123xxxxxxxxxxxxSA2",
  "callId": "180xxxxxxxxxxx448",
  "caller": "852xxxxxx34",
  "did": "",
  "didX": "852xxxxxxxxxx2",
  "didY": "8523xxxxxxxxx3",
  "extensionX": "1x3",
  "callee": "852xxxxxxx33",
  "pnsType": "axeyb",
  "callStatus": "1",
  "callStatusMsg": "Call Connected",
  "ext":"xxx1",
  "legList": [
    {
      "callType": 1,
      "caller": "852xxxxxxx4",
      "callee": "852xxxxxxx2",
      "callStartAt": 1719652247,
      "callAnswerAt": 1719652247,
      "callFinishAt": 1719652258,
      "duration": 11,
      "callRecordFile": "https://nxai-xxxxxxxxxxxxxxxxxxxxd17.mp3",
      "hangupType": 1,
      "hangupCause": "NORMAL_CLEARING",
      "hangupCode": 16,
      "uuid": "559xxxxxxxxxxxxxxxxxxxxxx7",
      "ringDuration": 0,
      "fsCallStatus": 0,
      "fsCallStatusMsg": ""
    },
    {
      "callType": 2,
      "caller": "852xxxxxxx3",
      "callee": "852xxxxxxx3",
      "callStartAt": 1719652252,
      "callAnswerAt": 1719652254,
      "callFinishAt": 1719652258,
      "duration": 4,
      "callRecordFile": "https://xxxxxxxxxxxxxxxd17.mp3",
      "hangupType": 0,
      "hangupCause": "NORMAL_CLEARING",
      "hangupCode": 16,
      "uuid": "bxxxxxxxxxxxxx5d",
      "ringDuration": 2,
      "fsCallStatus": 0,
      "fsCallStatusMsg": ""
    }
  ]
}

回执结果说明

参数名 类型 说明
bindId string 系统绑定id
customerBindId string 客户绑定id
callId string 呼叫id
caller string 通话双方-主叫号码
did string did号码
didX string AXYB中的X号码
didY string AXYB中的Y号码
extensionX string AXEYB中的E分机号码
callee string 通话双方-被叫号码
pnsType string 绑定类型描述,axb;ax;axyb;axeb;anxbm;axeyb
callStatus string 通话状态码
callStatusMsg string 通话状态具体描述
ext string 客户扩展字段
legList object 单边通话具体信息

legList的具体结构如下:

参数名 类型 说明
callType int64 呼叫方向,1:呼入,2:呼出
caller string 该次呼叫的主叫号码
callee string 该次呼叫的被叫号码
callStartAt int64 通话开始时间戳,单位为秒
callAnswerAt int64 通话接听时间戳,单位为秒
callFinishAt int64 通话挂断时间戳,单位为秒
duration int64 通话耗时,单位为秒
callRecordFile string 通话状态录音文件
hangupType int64 挂断方 0-主叫挂断,1-被叫挂断
hangupCode int64 错误原因的q850描述。参考 https://www.nxcloud.com/document/nxphone/hang-up-explained
hangupCause string 挂断原因。参考 https://www.nxcloud.com/document/nxphone/hang-up-explained
uuid string 通话唯一标识
ringDuration int64 响铃时长,单位为秒
fsCallStatus int64 通话状态码
fsCallStatusMsg string 通话状态具体描述

call_status和call_status_msg的说明如下:

call_status call_status_msg
1 拨打成功
2 拨打失败
3 其他
4 主叫取消
5 响铃无人接听
6 被叫忙
7 用户拒接
8 线路原因或被叫原因临时不可达
9 绑定接口返回失败
10 分机号输入错误(三次未输入或输入错误都算分机号输入错误)
11 被叫号码异常 (axb中的b错误,既:没有b)

简介

短信

语音

云呼叫中心(NXLink)

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

Flash Call

短链

邮件验证码

DID号码

通用

号码检测

WhatsApp

Viber

Zalo ZNS

Super Message API

隐私号(旧)

PNS

坐席(旧版)

AI Agent

Clone this wiki locally