租号API
API是你的软件和我们的号码租赁服务器之间的通信协议
API协议描述
所有的请求必须进入https://api.sms-man.com/rent-api/GET请求。所有的请求中必须要包含API密钥参数token所有的响应结果为json格式。
查询余额请求
参数
参数 | 类型 | 需要 | 值 |
|---|---|---|---|
token | String | 是 | 您的API密钥 |
结果
{
"balance": "799.70"
}可能的错误
{
"success": false,
"error_code": "wrong_token",
"error_msg": {"token":"Wrong token!"}
}获取限制
参数
参数 | 类型 | 需要 | 值 |
|---|---|---|---|
token | String | 是 | 您的API密钥 |
country_id | Integer | 是 | |
type | String | 是 | hour / day / week / month |
time | String | 是 | 租用时间 |
结果
{
"type": "hour",
"time": "4",
"limits": [
{"country_id":"1","count":"127","cost":"151.68"},
{"country_id":"2","count":"49","cost":"113.56"},
{"country_id":"4","count":"0","cost":"151.68"}
]
}可能的错误
{
"success": false,
"error_code": "wrong_token",
"error_msg": {"token":"Wrong token!"}
}请求租号
参数
参数 | 类型 | 需要 | 值 |
|---|---|---|---|
token | String | 是 | 您的API密钥 |
country_id | Integer | 是 | |
type | String | 是 | hour / day / week / month |
time | String | 是 | 租用时间 |
结果
{
"request_id": 1,
"country_id": 1,
"number": "79002415539"
}可能的错误
{
"success": false,
"error_code": "wrong_token",
"error_msg": {"token":"Wrong token!"}
}订购部分号码进行租用
参数
参数 | 类型 | 需要 | 值 |
|---|---|---|---|
token | String | 是 | 您的API密钥 |
country_id | Integer | 是 | |
application_id | Integer | 是 | |
type | String | 是 | hour / day / week / month |
time | String | 是 | 租用时间 |
结果
{
"request_id": 1,
"country_id": 1,
"application_id": 1,
"number": "79002415539"
}可能的错误
{
"success": false,
"error_code": "wrong_token",
"error_msg": {"token":"Wrong token!"}
}更改状态
参数
参数 | 类型 | 需要 | 值 |
|---|---|---|---|
token | String | 是 | 您的API密钥 |
request_id | Integer | 是 | 请求ID |
status | String | 是 | close - 停止租用 |
结果
{
"request_id": 1,
"success": true
}可能的错误
{
"success": false,
"error_code": "wrong_token",
"error_msg": {"token":"Wrong token!"}
}接收最新短信
参数
参数 | 类型 | 需要 | 值 |
|---|---|---|---|
token | String | 是 | 您的API密钥 |
request_id | Integer | 是 | 请求ID |
结果
{
"request_id": "10",
"country_id": 1,
"number": "79633002801",
"sms": {"message":"message","code":"code","time":"2020-12-12 14:50:31"}
}可能的错误
{
"success": false,
"error_code": "wrong_token",
"error_msg": {"token":"Wrong token!"}
}接收所有SMS
参数
参数 | 类型 | 需要 | 值 |
|---|---|---|---|
token | String | 是 | 您的API密钥 |
request_id | Integer | 是 | 请求ID |
结果
{
"request_id": "10",
"country_id": 1,
"number": "79633002801",
"sms": [
{"message":"message","code":"code","time":"2020-12-12 14:50:31"}
]
}可能的错误
{
"success": false,
"error_code": "wrong_token",
"error_msg": {"token":"Wrong token!"}
}获取所有号码的列表
参数
参数 | 类型 | 需要 | 值 |
|---|---|---|---|
token | String | 是 | Your API KEY |
结果
[
{"id":1,"country_id":1,"number":"79002415539","status":"cancel"}
]可能的错误
{
"success": false,
"error_code": "wrong_token",
"error_msg": {"token":"Wrong token!"}
}