Skip to content

PNS BIND XYB

kangt edited this page Jun 17, 2025 · 11 revisions

接口说明: 绑定xyb模式

概述

  • 发起绑定时主叫号码a是未知的, 将形成xyb关系,x号码将被锁定,其他号码无法绑定x。
  • 号码a呼入x时,xyb将变成axyb,此时x号码将被释放,允许其他号码绑定
  • 适用场景:无法知道真实号码的情况下,如快递场景,快递员用号码m在快递app里注册,但实际拨打用号码n。快递app在发起绑定时,无法预知快递员会用什么号码呼入x。

请求方式

  • URL: https://api.nxcloud.com/v1/pns/bind/xyb
  • Method: POST
  • Content-Type: application/json
  • 是否需要鉴权:

鉴权机制

请求参数说明

  • Header参数

参数名 类型 必填 说明 示例值
accessKey string 用户的accessKey fme2na3kdi3ki
action string 请求方法 bindXYB
bizType string [业务类型] 固定值 用来标识隐私号服务 5
ts string 当前请求的时间戳(单位是毫秒),牛信服务端允许用户端请求最大时间误差为60秒 1655710885431
sign string API入参参数签名,签名算法
  • Body 参数

参数名 必填 类型 说明
phoneB string B的号码
didX string 预期绑定的X号码,有值时选择固定DID,无值时随机选择DID
didY string 预期绑定的y号码,有值时选择固定DID,无值时随机选择DID
customerBindId string 客户自定义的绑定id(由客户决定,需要保证唯一)
delayedGetY boolean 延迟分配y号码,默认false
customerUserId string 客户的用户唯一标识或用户的设备id
businessId string 应用key
recording boolean 其他标识,比特组合,默认false
bindExpireSecond int api绑定过期时间,单位秒,默认7200s
bindExpireStrategy int api绑定过期策略,0:默认,1:重置, 2:顺延。缺省值为0
callInExpireSecond int 号码a呼入绑定过期时间,单位秒
callInExpireStrategy int 号码a呼入绑定过期策略,0:默认,1:重置,2:顺延。缺省值为0
ext string 自定义字段,会在话单时透传
iso2X string didX的iso2, 当didX没有传时,该值可以指定didX的方向
iso2Y string didY的iso2, 当didY没有传时,该值可以指定didY的方向

返回参数说明

参数名 类型 说明
code int 返回码,0代表成功,其他失败
msg string 返回码描述
requestId string 请求id
data Object 请求数据id

data返回参数详情:

参数名 类型 说明
bindId string 绑定id
didX string 绑定的x号码
didY string 绑定的y号码

请求示例

  • CURL 格式
curl --location --request POST 'https://api.nxcloud.com/v1/pns/bind/xyb' \
--header 'action: bindXYB' \
--header 'bizType: 5' \
--header 'accessKey: yyds' \
--header 'Content-Type: application/json' \
--header 'ts: 1728368629937' \
--header 'sign: e4a337239860e155c9c7667ef7f921c2' \
--data-raw '{
    "phoneA": "85254987987",
    "phoneB": "85264654798",
    "bindExpireSecond": 300,
    "bindExpireStrategy": 1, 
    "callInExpireSecond": 3000,
    "callInExpireStrategy": 1,
    "customerBindId": "fertertrytry89798798dsfs97dfsdf5tyt",
    "ext": "it is ext",
    "recording": true,
    "customerUserId": "devId+dsfewfe56465"
}'

返回示例

{
    "code": 0,
    "msg": "success",
    "requestId": "1843537768371720192",
    "data": {
        "bindId": "5a9b5a7a0090dc44f1e6b0fc92462251",
        "didX": "85213135313",
        "didY": "85213135356"
    }
}

简介

短信

语音

云呼叫中心(NXLink)

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

Flash Call

短链

邮件验证码

DID号码

通用

号码检测

WhatsApp

Viber

Zalo ZNS

Super Message API

隐私号(旧)

PNS

坐席(旧版)

AI Agent

Clone this wiki locally