number sync - nxtele/http-api-document GitHub Wiki

概要

  • 号码检测提交同步接口
单次请求一个号码 同步获取检测结果

请求URL

http://api2.nxcloud.com/api/number/check/get

请求方式

  • Method: POST
  • Content-Type: application/json

鉴权机制

鉴权规则请参考地址:API接口调用约定

image

请求Header

参数名称 参数类型 是否必填 示例值 参数描述
accessKey String fme2na3kdi3ki 用户身份标识
ts String 1655710885431 当前请求的时间戳(单位是毫秒),牛信服务端允许用户端请求最大时间误差为60秒
bizType String 1 [业务类型] 固定值 用来标识号码检测
action String numbercheck 固定值 用来标识号码检测
sign String 6e9506557d1f289501d333ee2c365826 API入参参数签名,签名算法

请求Body

参数名 必选 类型 说明
phone string 请求检测的号码,需要带国码,例如: 852xxxxxxxxx,8527xxxxxxx [多个号码通过,分隔;并且同一批次中可检测不同国家的号码]
batchNo string 批次号 标识同一批检测中的不同号码 如果没有则自动生成12位随机码,长度不可超过64位
checkLevel integer 检测类型 不填默认为基础版; 1: 基础版 ;
appkey string 应用appkey

请求示例

{
    "phone": "234800001xxxxx",
    "batchNo": "700265316182",
    "checkLevel": 1,
    "appkey": "a1b2c3d4"
}

成功返回 不存在错误号码

{
    "code": 0,
    "message": "Success",
    "data": {
        "requestId": "03afb3160b974b8f848f1162512de05f",
        "batchNo": "801954138129",
        "basic": {
            "phone": "8523xxx83",
            "country": "HK",
            "numberType": "others",
            "operator": "US OP"
        },
        "cost": {
            "price": 2.12,
            "currency": "USD"
        }
    }
}

成功返回 存在错误号码

{
    "code": 0,
    "message": "Success",
    "data": {
        "requestId": "dc99712066bd483b84b3641c787dab33",
        "batchNo": "100999527241",
        "failNumber": [
            {
                "number": "999***6789",
                "code": 209
            }
        ]
    },
    "traceId": "186c82b63eb449bb9d07866c042e88dd"
}

返回参数说明

参数名 类型 说明
data object 请求结果
message string 请求结果说明
code integer 结果编码

data

参数名 类型 说明
requestId string 业务id 唯一标识该条检测任务 长度不超过64位
batchNo string 批次号 用户主动输入或者系统自动生成
failNumber array 错误号码及其错误对应的code

failNumber

参数名 类型 说明
number string 错误号码
code integer 错误号码对应的错误原因code

失败返回

{
    "code": 203,
    "message": "Appkey not available or incorrect"
}

错误代码

code message
0 Success
201 Appkey missed
202 Phone missed
203 Appkey not available or incorrect
204 CheckLevel illegal
205 DrUrl length beyond the limit 255
206 BatchNo length beyond the limit 64
207 Phone count beyond the limit 5000
208 Customer app does not have quotation
209 Phone number is invalid
210 Phone number repeat
-1 Failure