Skip to content

Number Check API callback

GiuFLim edited this page Sep 14, 2023 · 16 revisions

概要

  • 检测结果推送

请求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-250142",
    "phone": "8613320xxxx",
    "data": {
        "numberType": "mobile",
        "operator": "china union",
        "mcc": "310",
        "mnc": "10",
        "ported": "yes",
        "active": "yes",
        "country": "CN"
    },
    "cost": {
        "price": 0.002,
        "currency": "CNY"
    }
}

呼叫版

{
    "message": "请求成功",
    "code": 0,
    "batchNo": "901946960376",
    "requestId": "9ddd1a8664124511bf28d3d280994961-250142",
    "phone": "8613320xxxx",
    "data": {
        "numberType": "mobile",
        "country": "CN",
        "operator": "china union",
        "ring": "yes",
        "answer": "no",
        "responseStatus": "voicemail"
    },
    "cost": {
        "price": 0.002,
        "currency": "CNY"
    }
}

检测失败

{
    "requestId": "cc5ef7d6-62be-42c9-abdf-b6ea9d6ed5e6",
    "code": 266,
    "message": "numbercheck biz subBalance failed",
    "batchNo": "700337042751",
    "phone": "8613320xxxx",
    "data":{},
    "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
active string 是否活跃 yes no

呼叫检测返回的data内容

参数名 类型 说明
country string 区号 iso
numberType string 号码类型。mobile , others,invalid
operator string 运营商
ring string 是否响铃 yes no
answer string 是否接听 yes no
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 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

简介

短信

语音

云呼叫中心(NXLink)

云呼叫中心(AI自动外呼)

Flash Call

短链

邮件验证码

DID号码

通用

号码检测

WhatsApp

Viber

Zalo ZNS

Super Message API

隐私号(旧)

PNS

坐席(旧版)

AI Agent

Clone this wiki locally