API: Factor/mobile_status - 運(yùn)營商在網(wǎng)狀態(tài)
概覽
Factor/mobile_status
是submail的運(yùn)營商在網(wǎng)狀態(tài)API,輸入手機(jī)號,返回手機(jī)號在網(wǎng)狀態(tài)。
URL
<主> http://tpa.mysubmail.com/factor/mobile_status
<備> https://tpa.mysubmail.com/factor/mobile_status
http 請求方式
請求方式 | content-type 設(shè)置 |
---|---|
http post | multipart/form-data 、x-www-form-urlencoded 、application/json |
signature創(chuàng)建規(guī)則
1. 請將以下參數(shù)按照字段升序(A-Z)排列 appkey 、mobile 、timestamp
2. 創(chuàng)建簽名字符串 :以"key=value" + "&"(連接符)+ "key=value" 的方式連接所有參數(shù)
3. 創(chuàng)建簽名:拼接簽名字符串示例string = "appkey=xxxx&mobile=xxxx×tamp=xxxxxxxxxx",然后使用sha256(string)創(chuàng)建簽名
注:中文需要使用urlencode處理后再參與創(chuàng)建簽名
請求參數(shù)
參數(shù) | 類型 | 是否必需 | 默認(rèn) | 描述 |
---|---|---|---|---|
appid | string | 必需 | 無 | 在 SUBMAIL 身份認(rèn)證服務(wù)中創(chuàng)建并且認(rèn)證通過的應(yīng)用 ID |
timestamp | string | 必需 | 無 | UNIX 時間戳 |
signature | string | 必需 | 無 | 簽名,詳細(xì)規(guī)則看下方介紹 |
mobile | string | 必需 | 無 | 電話號碼 |
返回參數(shù)格式
jsonString
代碼示例
詳情請查詢demo示例文檔
響應(yīng)消息
API請求失敗
{
// 狀態(tài)描述
'status' : 'error' ,
// API流水號
'send_id' : "********************************",
// API返回的狀態(tài)碼 詳情查看 API錯誤代碼與描述 文檔
'code' : 1201 ,
// API返回的描述
'msg' : 'Incorrect APP ID.' ,
}
{
"status": "error",
"send_id": "********************************",
"code": "1217",
"msg": "API Gateway Error:手機(jī)號碼格式錯誤(*****)"
}
API請求成功
{
"status": "success",
"send_id": "********************************",
"result": {
//狀態(tài)碼 1:正常, 2:單停/停機(jī)/預(yù)銷號, 3:未啟用/在網(wǎng)不可用, 4:銷號/未啟用/不在網(wǎng)
"status": 1,
//結(jié)果描述
"msg": "正常",
//運(yùn)營商中文名稱
"provider": "中國移動",
//運(yùn)營商代碼 1移動 2聯(lián)通 2電信
"ope_type": 1
}
}