Rent API
API is the protocol for communication between your software and our number rental server.
API Protocol Description
All requests must go to https://api.sms-man.com/rent-api/ GET request. All requests must include the API key as a parameter token All answers are in json format.
Balance request
Parameters
Parameter | Type | Required | Value |
|---|---|---|---|
token | String | Yes | Your API key |
Result
{
"balance": "799.70"
}Possible errors
{
"success": false,
"error_code": "wrong_token",
"error_msg": {"token":"Wrong token!"}
}Get limits
Parameters
Parameter | Type | Required | Value |
|---|---|---|---|
token | String | Yes | Your API key |
country_id | Integer | Yes | |
type | String | Yes | hour / day / week / month |
time | String | Yes | Rental Time |
Result
{
"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"}
]
}Possible errors
{
"success": false,
"error_code": "wrong_token",
"error_msg": {"token":"Wrong token!"}
}Ordering a number to rent
Parameters
Parameter | Type | Required | Value |
|---|---|---|---|
token | String | Yes | Your API key |
country_id | Integer | Yes | |
type | String | Yes | hour / day / week / month |
time | String | Yes | Rental Time |
Result
{
"request_id": 1,
"country_id": 1,
"number": "79002415539"
}Possible errors
{
"success": false,
"error_code": "wrong_token",
"error_msg": {"token":"Wrong token!"}
}Ordering a partial number for rent
Parameters
Parameter | Type | Required | Value |
|---|---|---|---|
token | String | Yes | Your API key |
country_id | Integer | Yes | |
application_id | Integer | Yes | |
type | String | Yes | hour / day / week / month |
time | String | Yes | Rental Time |
Result
{
"request_id": 1,
"country_id": 1,
"application_id": 1,
"number": "79002415539"
}Possible errors
{
"success": false,
"error_code": "wrong_token",
"error_msg": {"token":"Wrong token!"}
}Change status
Parameters
Parameter | Type | Required | Value |
|---|---|---|---|
token | String | Yes | Your API key |
request_id | Integer | Yes | Request ID |
status | String | Yes | close - terminate the rent |
Result
{
"request_id": 1,
"success": true
}Possible errors
{
"success": false,
"error_code": "wrong_token",
"error_msg": {"token":"Wrong token!"}
}Receive the last text message
Parameters
Parameter | Type | Required | Value |
|---|---|---|---|
token | String | Yes | Your API key |
request_id | Integer | Yes | Request ID |
Result
{
"request_id": "10",
"country_id": 1,
"number": "79633002801",
"sms": {"message":"message","code":"code","time":"2020-12-12 14:50:31"}
}Possible errors
{
"success": false,
"error_code": "wrong_token",
"error_msg": {"token":"Wrong token!"}
}Receive all sms
Parameters
Parameter | Type | Required | Value |
|---|---|---|---|
token | String | Yes | Your API key |
request_id | Integer | Yes | Request ID |
Result
{
"request_id": "10",
"country_id": 1,
"number": "79633002801",
"sms": [
{"message":"message","code":"code","time":"2020-12-12 14:50:31"}
]
}Possible errors
{
"success": false,
"error_code": "wrong_token",
"error_msg": {"token":"Wrong token!"}
}Get a list of all numbers
Parameters
Parameter | Type | Required | Value |
|---|---|---|---|
token | String | Yes | Your API KEY |
Result
[
{"id":1,"country_id":1,"number":"79002415539","status":"cancel"}
]Possible errors
{
"success": false,
"error_code": "wrong_token",
"error_msg": {"token":"Wrong token!"}
}