API v2.0
API是你的软件和我们的激活服务器之间的互动协议。为了使您的SMS接收过程自动化,需要API。要使用API,你必须使用你的API密钥,你可以通过进入个人资料页面获得。我们的软件与竞争对手的网站完全兼容
API协议描述
所有的请求必须进入https://api.sms-man.com/control/ POST或GET请求。所有的请求中必须含有 token参数形式的API密钥
查询余额请求
参数
字段 | 类型 | 需要 | 值 |
|---|---|---|---|
token | String | yes | 您的API密钥 |
结果
{
"balance": "799.70"
}可能的错误
{
"success": false,
"error_code": "wrong_token",
"error_msg": "Wrong token!"
}获取限制
参数
字段 | 类型 | 需要 | 值 |
|---|---|---|---|
token | String | yes | 您的API密钥 |
country_id | Integer | no | |
application_id | Integer | no |
结果
[
{"application_id":"1","country_id":"1","numbers":"32302"},
{"application_id":"1","country_id":"2","numbers":"3494"}
]可能的错误
{
"success": false,
"error_code": "wrong_token",
"error_msg": {"token":"Wrong token!"}
}请求号码
参数
要随机选择一个国家,请使用 country_id=0
字段 | 类型 | 需要 | 值 |
|---|---|---|---|
token | String | yes | 您的API密钥 |
country_id | Integer | no | |
application_id | Integer | yes | |
maxPrice | Integer | no | 您期望的价格 |
currency | String | no | RUB/USD/EUR |
ref | String | no | 传递推荐ID |
hasMultipleSms | String | no | True/False |
结果
{
"request_id": 1,
"country_id": 1,
"application_id": 1,
"number": "79002415539"
}可能的错误
{
"success": false,
"error_code": "wrong_token",
"error_msg": {"token":"Wrong token!"}
}获取SMS
参数
字段 | 类型 | 需要 | 值 |
|---|---|---|---|
token | String | yes | 您的API密钥 |
request_id | Integer | yes | 请求ID |
结果
{
"request_id": 1,
"country_id": 1,
"application_id": 1,
"number": "79002415539",
"sms_code": "1243"
}可能的错误
{
"request_id": 1,
"country_id": 1,
"application_id": 1,
"number": "79002415539",
"error_code": "wait_sms",
"error_msg": "Still waiting..."
}更改请求状态
参数
字段 | 类型 | 需要 | 值 |
|---|---|---|---|
token | String | yes | 您的API密钥 |
request_id | Integer | yes | 请求ID |
status | String | yes | ready / close / reject / used |
结果
{
"request_id": 1,
"success": true
}可能的错误
{
"success": false,
"error_code": "wrong_token",
"error_msg": "Wrong token!"
}
{
"success": false,
"error_code": "wrong_status",
"error_msg": "Status $status does not exists"
}取得当前价格
参数
字段 | 类型 | 需要 | 值 |
|---|---|---|---|
token | String | yes | 您的API密钥 |
country_id | Integer | no |
结果
{
"0": {"1":{"cost":"15","count":6455},"2":{"cost":"50","count":124}},
"1": {"3":{"cost":"6","count":1000}}
}可能的错误
{
"success": false,
"error_code": "wrong_token",
"error_msg": {"token":"Wrong token!"}
}获取所有国家的列表
参数
字段 | 类型 | 需要 | 值 |
|---|---|---|---|
token | String | yes | 您的API密钥 |
结果
[
{"id":0,"title":"Russia"},
{"id":3,"title":"China"}
]可能的错误
{
"success": false,
"error_code": "wrong_token",
"error_msg": "Wrong token!"
}获取所有服务的列表
参数
字段 | 类型 | 需要 | 值 |
|---|---|---|---|
token | String | yes | 您的API密钥 |
结果
[
{"id":"1","name":"Vkontakte","code":"vk"},
{"id":"2","name":"WeChat","code":"wb"},
{"id":"3","name":"Telegram","code":"tg"}
]可能的错误
{
"success": false,
"error_code": "wrong_token",
"error_msg": "Wrong token!"
}