number‐check‐get - 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 请求检测的号码,需要带国码,只能填一个号码
batchNo string 标识号 用户主动输入或者系统自动生成 如果没有则自动生成12位随机码,长度不可超过64位
checkLevel integer 检测类型 不填默认为基础版; 1: 基础版 ;
appkey string 应用appkey

请求示例

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

返回参数说明

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

data

参数名 类型 说明
requestId string 业务id 唯一标识该条检测任务 长度不超过64位
batchNo string 标识号 用户主动输入或者系统自动生成
cost object 费用信息,结构见下方说明
basic object 基础检测结果信息,结构见下方说明

cost

参数名 类型 说明
price number 费用。精确到四位小数
currency string 币种

basic

参数名 类型 说明
phone string 手机号
country string 区号 iso
numberType string 号码类型。mobile , others,invalid
operator string 运营商
failReason string 检测失败的原因

成功返回 不存在错误号码

{
    "code": 0,
    "message": "Success",
    "data": {
        "requestId": "d62beedc7f4f47fabbbda5de68a5e67c",
        "batchNo": "401593206904",
        "basic": {
            "phone": "133xxx",
            "country": "US",
            "numberType": "mobile",
            "operator": "xxx Telecom",
            "failReason": null
        },
        "cost": {
            "price": 2.0000,
            "currency": "USD"
        }
    }
}

成功返回 存在错误号码

{
    "code": 209,
    "message": "Phone number is invalid"
}

成功返回 同步检测只支持单个号码

{
    "code": 220,
    "message": "Only one phone number is supported for detection"
}

失败返回

{
    "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
208 Customer app does not have quotation
209 Phone number is invalid
210 Phone number repeat
220 Only one phone number is supported for detection
-1 Failure