Number Check API callback old - 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
基础版
{
"messageId": "83ac9512-3c47-495d-a3c4-6d77a9f1149c",
"code": 0,
"msg": "success",
"batchNo": "700337042751",
"phone": "234800001xxxxx",
"data": {
"basic": {
"preCheck": "YES",
"regionCode": "CN",
"countryCode": "86",
"nationalNumber": "800001xxxxx",
"standNumber": "234800001xxxxx",
"numberType": 2,
"carrier": "China Telecom"
}
},
"cost": {
"price": 0.1912,
"currency": "USD"
}
}
HLR检测
{
"messageId": "83ac9512-3c47-495d-a3c4-6d77a9f1149c",
"code": 0,
"msg": "success",
"batchNo": "700337042751",
"phone":"234800001xxxxx",
"data": {
"basic": {
"preCheck": "YES",
"regionCode": "CN",
"countryCode": "86",
"nationalNumber": "800001xxxxx",
"standNumber": "234800001xxxxx",
"numberType": 2,
"carrier": "China Telecom"
},
"live": {
"validity": "YES",
"reachable": "UNKNOWN",
"roaming": "UNKNOWN"
}
},
"cost": {
"price": 0.9230,
"currency": "USD"
}
}
呼叫版
{
"messageId": "83ac9512-3c47-495d-a3c4-6d77a9f1149c",
"code": 0,
"msg": "success",
"batchNo": "700337042751",
"phone": "234800001xxxxx",
"data": {
"basic": {
"preCheck": "YES",
"regionCode": "CN",
"countryCode": "86",
"nationalNumber": "800001xxxxx",
"standNumber": "234800001xxxxx",
"numberType": 2,
"carrier": "China Telecom"
},
"dial": {
"early": "NO",
"answered": "NO",
"response": "invalid_number"
}
},
"cost": {
"price": 1.0231,
"currency": "USD"
}
}
检测失败
{
"messageId": "cc5ef7d6-62be-42c9-abdf-b6ea9d6ed5e6",
"code": 114,
"msg": "号码格式有误",
"batchNo": "700337042751",
"phone":"18617"
}
回执结果说明
参数名 | 类型 | 说明 |
---|---|---|
messageId | string | 消息id 最大长度为64位 |
code | integer | code=0表示成功 |
msg | string | 返回结果说明 |
batchNo | string | 批次号 |
phone | string | 手机号 |
basic | object | 基础版信息,结构见下方说明 |
live | object | 高级版信息,结构见下方说明 |
dial | object | 呼叫版信息,结构见下方说明 |
cost | object | 费用信息,结构见下方说明 |
basic
参数名 | 类型 | 说明 |
---|---|---|
preCheck | string | 格式检查是否通过。 YES:通过; NO:未通过 |
regionCode | string | 区号 iso |
countryCode | string | 国码 |
nationalNumber | string | 本地格式 |
standNumber | string | 标准格式 |
numberType | integer | 号码类型。0: 其它类型1: 固定电话2: 移动号码3: 免费电话4: VOIP号码5: 机构/企业电话6: 特殊私人号码7: 语音信箱8: 特殊限制号码 |
carrier | string | 运营商 |
live
参数名 | 类型 | 说明 |
---|---|---|
validity | string | 号码是否有效。 "YES": 是; "NO": 否; "UNKNOWN": 未知 |
reachable | string | 设备是否在线。 "YES": 是; "NO": 否; "UNKNOWN": 未知 |
roaming | string | 是否漫游中。 "YES": 是; "NO": 否; "UNKNOWN": 未知 |
dial
参数名 | 类型 | 说明 |
---|---|---|
early | string | 是否响铃 "YES": 是; "NO": 否; "UNKNOWN": 未知 |
answered | string | 是否接听 "YES": 是; "NO": 否; "UNKNOWN": 未知 |
response | string | 响应状态。bell: 响铃music: 彩铃busy: 用户忙no_response: 用户无应答invalid_number: 空号not_available: 号码不可用number_paused: 暂停使用power_off: 关机power_off_or_out_of_service: 关机或不在服务区voicemail: 语音信箱others: 暂时无法接通 |
cost
参数名 | 类型 | 说明 |
---|---|---|
price | number | 费用。精确到四位小数 |
currency | string | 币种 |
回执错误代码
code | msg |
---|---|
0 | 成功 |
103 | 内部服务器错误 |
108 | 请求的值不合法 |
112 | 后端服务调用失败 |
114 | 号码格式有误 |
120 | 不支持非移动号码检测 |
121 | 未知错误 |
122 | 无法检测到信息 |