forked from nxtele/http-api-document
-
Notifications
You must be signed in to change notification settings - Fork 1
发起号码检测
ben.zhuang edited this page Oct 14, 2022
·
1 revision
接口描述:
- 通过api接口方式发起号码检测业务
请求URL: http://api2.nxcloud.com/api/number/check
请求方式: |Method: POST | Content-Type: application/json |
鉴权机制
鉴权规则请参考地址:API接口调用约定

调用API接口时请求头Header中必须传入的参数:
| 参数名称 | 参数类型 | 是否必填 | 示例值 | 参数描述 |
|---|---|---|---|---|
| accessKey | String | 是 | fme2na3kdi3ki | 用户身份标识 |
| ts | String | 是 | 1655710885431 | 当前请求的时间戳(单位是毫秒),牛信服务端允许用户端请求最大时间误差为60秒 |
| bizType | String | 是 | 1 | [业务类型] 固定值 用来标识号码检测 |
| action | String | 是 | numbercheck | 固定值 用来标识号码检测 |
| sign | String | 是 | 6e9506557d1f289501d333ee2c365826 | API入参参数签名,签名算法 |
请求Body:
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| phone | 是 | string | 请求检测的号码,需要带国码,例如: 852xxxxxxxxx |
| batchNo | 否 | string | 批次号 标识同一批检测中的不同号码 如果没有按照当前日期生成 格式: yyyyMMdd |
| checkLevel | 否 | integer | 检测类型 不填默认为基础版; 1: 基础版; 2: 高级版; 4: 呼叫版 |
| drUrl | 否 | string | 检测结果回调地址 不填默认使用appkey对应的应用配置的回调地址,若应用也未配置回调地址,则不回调检测结果 |
| appkey | 是 | string | 应用appkey |
请求示例
{
"phone": "234800001xxxxx",
"batchNo": "20220901",
"checkLevel": 1,
"drUrl": "http://my.callback.url/test",
"appkey": "a1b2c3d4"
}返回成功示例
{
"msg": "success",
"code": 0,
"data": {
"messageId": "301ef45b8de54d8aad95c5264c3756be"
}
}返回参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| data | json | 请求结果 |
| messageId | string | 消息id 唯一标识该条检测任务 长度不超过64位 |
| msg | string | 请求结果说明 |
| code | integer | 结果编码 |
请求失败返回示例
{
"msg": "应用不可用或appkey错误",
"code": 202,
"data": {
"messageId": ""
}
}错误代码
| code | msg |
|---|---|
| 0 | 成功 |
| 201 | 参数错误或为空 |
| 202 | 应用不可用或appkey错误 |
| 203 | 该号码未识别出国家运营商信息 |
| 204 | 客户扣费接口异常 |
| 205 | 未查询到应用报价 |
| 206 | 请求检测业务接口异常 |
| 207 | 检测类型不合法 |
| 210 | 鉴权机制对应的客户信息与appkey对应的客户信息不一致 |
| 211 | 客户余额不足 |
| 212 | 批次号长度不能超过64位 |
| 288 | 请求失败 |
| 299 | 系统错误 |
基础版
{
"messageId": "83ac9512-3c47-495d-a3c4-6d77a9f1149c",
"code": 0,
"msg": "success",
"batchNo": "8ec7304b42784c6c98638fca164cd132",
"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"
}
}高级版
{
"messageId": "83ac9512-3c47-495d-a3c4-6d77a9f1149c",
"code": 0,
"msg": "success",
"batchNo": "8ec7304b42784c6c98638fca164cd132",
"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": "8ec7304b42784c6c98638fca164cd132",
"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": "78f71df450b94a2caf49b753cc7714c2",
"phone":"8617"
}回执结果说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| 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 | 无法检测到信息 |
Introduction
- Send Message
- Mark Incoming Message as Read
- Upload Media File
- Get Media File
- Delete Media File
- Webhook
- Query Number Information
- Query Message Template
- Create Message Template
- Edit Message Template
- Delete Message Template
- Upload Template Example File
- Embedded Page Login
- Create Client Application
- List of Phone Numbers for Client Application
- Get Verification Code
- Verify Verification Code
- Create Local Client
Short message
Voice
Call Center(NXLink)
- Web Iframe
- Manual Dial Record
- Manual Dial Record Query By orderId
- List Agent Information
- List Agent Status
- List Queue
- List Agents In Queue
- List Agent Efficiency
- Update Queue Agents
- Create AutoDial Task
- Webhook - Manual Dial
AI Agent(NXLink)
- AI Agent Task List
- Query Call Records
- Append Contacts to an Existing Task
- Delete Contacts
- Call Record Callback
Call Center(Callbot)
- Callbot API Summary
- Callbot API Authorization
- Callbot API Ping
- Create Auto Dial Task
- Add Contact List To Task
- Create Task And Add Contact
- Start Or Pause Task
- Update Task Parameters
- Get List Task
- List Call
- List Task Orders
- Stop Order
- Get Call Detail By Order
- Webhook - By Call
- Webhook - By Order
- Webhook - Task Status
Flash Call
Short links
邮件验证码
DID号码
通用
号码检测