查询商户号码的calling能力
使用此接口查询商户号码的calling能力。
接口
- URL:
https://api2.nxcloud.com/api/wa/calling/get
- Method:
POST
- Content-Type:
application/json
- 需要鉴权:
是
鉴权机制
鉴权规则请参考地址:API接口调用约定
请求参数
header参数:
| 参数名 |
类型 |
必选 |
示例值 |
说明 |
| accessKey |
String |
是 |
fme2na3kdi3ki |
用户身份标识 |
| ts |
String |
是 |
1655710885431 |
当前请求的时间戳(单位是毫秒),牛信服务端允许用户端请求最大时间误差为60秒 |
| bizType |
String |
是 |
2 |
WhatsApp业务类型,取固定值“2” |
| action |
String |
是 |
mt |
WhatsApp业务操作,取固定值“mt” |
| sign |
String |
是 |
6e9506557d1f289501d333ee2c365826 |
API入参参数签名,签名算法 |
body参数:
| 参数名 |
类型 |
必选 |
示例值 |
说明 |
| appkey |
String |
是 |
pem28kje |
应用appkey |
| business_phone |
String |
是 |
xxx |
商户的WhatsApp号码,需要带国码。如86158xxxx1795 |
请求示例1
{
"appkey": "xxx",
"business_phone": "xxx"
}
响应参数
| 参数名 |
类型 |
示例值 |
说明 |
| code |
String |
0 |
|
| message |
String |
Success |
|
| data |
Object |
|
|
data Object
| 参数名 |
类型 |
示例值 |
说明 |
| status |
Integer |
1 |
0=calling能力禁用 1=calling能力启用 2=欠费中 |
| business_phone |
String |
86133xxx |
商户的WhatsApp号码,需要带国码。如86158xxxx1795 |
| region |
String |
SG |
语音服务器的国家/地区 |
| icon_status |
Integer |
1 |
是否显示通话图标 1=显示 0=隐藏 |
| permission_status |
Integer |
1 |
是否允许用户请求回电未接来电[如果你无法接听通话,可以让对方请求你回电] 1启用, 0禁用 |
| recording_status |
Integer |
0 |
是否启用录音 1启用, 0禁用 |
| hours_status |
Integer |
0 |
是否定制业务时间 1启用 0禁用 |
| hours_customize |
Object |
|
定制业务时间 |
| customer_sip_addr |
Array[Object] |
[{"host":"34.56.78.90","port":8080,"type":1}] |
客户SIP servers信息 |
| nx_sip_addr |
Array[Object] |
[{"region":"SG","ip_list":["34.92.169.217:6030","34.92.169.218:6030"],"fqdn":["ivp-cli-cluster.nxcloud.com"]}] |
nx sip对接信息 |
customer_sip_addr Array[Object]
| 参数名 |
类型 |
示例值 |
说明 |
| host |
String |
4.4.4.4 |
服务器ip地址/域名地址 |
| port |
String |
8080 |
ip地址时必须指明端口 |
| type |
Integer |
1 |
1=呼入&呼出 2=呼入 3=呼出 |
nx_sip_addr Array[Object]
| 参数名 |
类型 |
示例值 |
说明 |
| ip_list |
Array[String] |
["34.92.169.217:6030","34.92.169.218:6030"] |
IP地址列表 |
| fqdn |
Array[String] |
["ivp-cli-cluster.nxcloud.com"] |
FQDN列表 |
| region |
String |
SG |
语音站点 |
响应示例1 禁用配置
{
"code": 0,
"message": "Success",
"data": {
"status": 0,
"business_phone": "xxx",
"region": "",
"icon_status": null,
"hours_status": null,
"hours_customize": null,
"permission_status": null,
"recording_status": null,
"customer_sip_addr": null,
"nx_sip_addr": null
},
"traceId": "c05f8a2664e3484480e452b279d88d96"
}
响应示例2 启用配置且未定制业务时间
{
"code": 0,
"message": "Success",
"data": {
"status": 1,
"business_phone": "xxx",
"region": "SG",
"icon_status": 1,
"hours_status": 0,
"hours_customize": null,
"permission_status": 0,
"recording_status": 1,
"nx_sip_addr": [
{"region":"SG","ip_list":["34.92.169.217:6030","34.92.169.218:6030"],"fqdn":["ivp-cli-cluster.nxcloud.com"]}
],
"customer_sip_addr": [
{
"host": "34.56.78.90",
"port": 8080,
"type": 1
},
{
"host": "4.4.4.4",
"port": 3390,
"type": 2
}
]
},
"traceId": "6ec91c2f05cd4e50b021594e98b31c32"
}
响应示例3 启用配置且定制业务时间
{
"code": 0,
"message": "Success",
"data": {
"status": 1,
"business_phone": "xxx",
"region": "SG",
"icon_status": 1,
"hours_status": 1,
"hours_customize": "{\"status\":\"ENABLED\",\"timezone_id\":\"Etc/GMT-8\",\"weekly_operating_hours\":[{\"day_of_week\":\"MONDAY\",\"open_time\":\"0400\",\"close_time\":\"1020\"},{\"day_of_week\":\"TUESDAY\",\"open_time\":\"0108\",\"close_time\":\"1020\"},{\"day_of_week\":\"THURSDAY\",\"open_time\":\"0108\",\"close_time\":\"1020\"}],\"holiday_schedule\":[{\"date\":\"2025-10-01\",\"start_time\":\"0000\",\"end_time\":\"0259\"},{\"date\":\"2025-10-01\",\"start_time\":\"0400\",\"end_time\":\"0559\"},{\"date\":\"2025-10-01\",\"start_time\":\"0800\",\"end_time\":\"1759\"},{\"date\":\"2025-10-01\",\"start_time\":\"2000\",\"end_time\":\"2359\"}]}",
"permission_status": 0,
"recording_status": 1,
"customer_sip_addr": [
{
"host": "34.56.78.90",
"port": 8080,
"type": 1
},
{
"host": "4.4.4.4",
"port": 3390,
"type": 2
}
],
"nx_sip_addr": [
{"region":"SG","ip_list":["34.92.169.217:6030","34.92.169.218:6030"],"fqdn":["ivp-cli-cluster.nxcloud.com"]}
],
},
"traceId": "4b46b48f4e4d4d49b2a171c128d69ed7"
}
响应码说明
| code |
message |
含义/解决办法 |
| 0 |
Success |
|
| -1 |
Failure |
请联系技术人员排除问题 |
| 1000~100X |
Authentication failed |
详情查看API鉴权部分 |
| 1100 |
Customer does not exist / Status is unavailable |
账号状态异常,联系业务人员处理账号问题 |
| 1102 |
Insufficient balance |
账号余额不足,请联系业务人员充值 |
| 9000 |
Request parameter error |
参数缺失,请检查必须的参数 |
| 9001 |
System business error |
系统业务错误,请联系技术人员排除问题 |
| 9002 |
Phone number error |
非法号码,请检查号码正确性 |
| 9003 |
Customer APP does not exist / Status is unavailable |
应用状态异常(不存在/禁用),联系业务人员处理云平台应用创建/禁用问题 |
| 10003 |
WhatsApp business phone is not bind app |
该whatsapp号码未绑定应用,请联系业务人员处理应用和手机号绑定操作 |
| 10009 |
Calling line setting not exist |
calling线路配置出现异常 |
| 10010 |
Business phone no calling quotation |
商户号未配置calling报价 |
| 10011 |
Get business phone sip password fail |
获取商户号sip信息异常 |
| 10012 |
Calling setting fail {0} |
Calling配置出现异常 |
| 10013 |
Calling setting not exist |
Calling配置不存在 |
| 10015 |
{0} not in (0, 1) |
参数不正确 |
| 10016 |
{0} has error |
参数不合法 |