Number Check API callback - nxtele/http-api-document GitHub Wiki
概要
- 检测结果推送
请求URL
- 通过提交检测API的drUrl字段指定,或者在NXCLOUD平台配置
请求方式
- Method: POST
- Content-Type: application/json
重试规则
一般情况下,检测结果将在10秒-5分钟内推送回指定的API地址。收到HTTP 200 OK代表已接受NXCLOUD的回执推送,NXCLOUD将本次请求视为已完成。 如果收到HTTP ERROR信息,NXCLOUD将在60分钟内,每分钟重试推送。直到成功为止,如果超过60分钟仍然失败,则不再重复推送。
请求Body
基础版
{
"message": "请求成功",
"code": 0,
"batchNo": "901946960376",
"requestId": "9ddd1a8664124511bf28d3d280994961-250142",
"phone": "8613320xxxx",
"data": {
"numberType": "mobile",
"operator": "china union",
"country": "CN"
},
"cost": {
"price": 0.002,
"currency": "CNY"
}
}
HLR检测
{
"message": "请求成功",
"code": 0,
"batchNo": "901946960376",
"requestId": "9ddd1a8664124511bf28d3d280994961-000001",
"phone": "8613320xxxx",
"data": {
"numberType": "mobile",
"operator": "china union",
"mcc": "310",
"mnc": "10",
"ported": "YES",
"active": "YES",
"country": "CN"
},
"cost": {
"price": 0.002,
"currency": "CNY"
}
}
检测失败
{
"requestId": "cc5ef7d6-62be-42c9-abdf-b6ea9d6ed5e6-000003",
"code": 266,
"message": "subBalance failed",
"batchNo": "700337042751",
"phone": "86xxx3456",
"data": null,
"cost": {
"price": 0.002,
"currency": "CNY"
}
}
回执结果说明
参数名 | 类型 | 说明 |
---|---|---|
requestId | string | 消息id 最大长度为64位 |
code | integer | code=0表示成功 |
message | string | 返回结果说明 |
batchNo | string | 批次号 |
phone | string | 手机号 |
data | object | 检测信息,结构见下方说明 |
cost | object | 费用信息,结构见下方说明 |
基础检测返回的data内容
参数名 | 类型 | 说明 |
---|---|---|
country | string | 区号 iso |
numberType | string | 号码类型。mobile , others,invalid |
operator | string | 运营商 |
hlr检测返回的data内容
参数名 | 类型 | 说明 |
---|---|---|
country | string | 区号 iso |
numberType | string | 号码类型。mobile , others,invalid |
operator | string | 运营商 |
mcc | string | mcc |
mnc | string | mnc |
ported | string | 是否携号转网 "YES": 是; "NO": 否; "UNKNOWN": 未知 |
active | string | 是否活跃 "YES": 是; "NO": 否; "UNKNOWN": 未知 |
cost
参数名 | 类型 | 说明 |
---|---|---|
price | number | 费用。精确到四位小数 |
currency | string | 币种 |
回执错误代码
code | message | 解决方法 |
---|---|---|
0 | Success | |
-1 | Failure | 联系业务排查 |
261 | vendorRouter obtain fail | 线路不支持 |
262 | vendorAppInfo obtain fail | 线路配置不正确 |
263 | vendor api_class missed | 线路配置不正确 |
264 | vendor quotation missed | 线路不支持 |
265 | vendor new_code missed | 线路配置不正确 |
266 | subBalance failed | 余额不足 |
267 | dr data failed | 回执格式不正确 |
268 | bizApiDetect failed | 联系业务排查 |