
API KoalaSMS
Activations API 
Activation API: Request a number
Activation API: Activation status changes
Activation API: Get the activation status
Activation API: Balance Request
Activation API: Get current prices by country
Rental API 
Rent API: request a number
Rent API: continue rent
Rent API: history rent
Rent API: rent status changes
Rent API: get the activation status
Rent API: get current prices by country
Tables 
API: Country codes
API: Service codes
API is a protocol of interaction between your software and our activation server. API is needed to automate the process of receiving SMS messages on your side
All requests must contain
the API key in the form of the api_key parameter
the API key in the form of the api_key parameter

Activation API: Request a number
https://api.koalasms.com/stubs/handler_api.php?api_key=$api_key&action=getNumber&service=$service&country=$country
&action=getNumber
$api_key — your API key (Settings);
$service — service code;
$country — country code.
$maxPrice — the maximum price for which you are ready to buy a number.
Possible errors:
BAD_KEY — check your API key;
NO_NUMBERS — repeat a request or choose another country.
the number has not been issued — repeat the request or select another country
The example of successful answer:
ACCESS_NUMBER:38496653:66846426435
Where 38496653 is activation id. 66846426435 is a phone number.
Activation API: Activation status changes
https://api.koalasms.com/stubs/handler_api.php?api_key=$api_key&action=setStatus&status=$status&id=$id
&action=setStatus
$api_key — your API key (Settings);
$id — activation id;
$status — activation status:
-1 — cancel activation
1 — inform about the readiness of the number (sms sent to the number);
3 — wait for the next code on the same number;
6 — complete activation;
8 — cancel activation.
Service responses:
ACCESS_READY — the availability of the number has been confirmed
ACCESS_RETRY_GET — waiting for a new sms
ACCESS_ACTIVATION — the service has been activated successfully
ACCESS_CANCEL — activation canceled
Possible errors:
ERROR_SQL — SQL server error
NO_ACTIVATION — the activation id does not exist
BAD_SERVICE — incorrect service name
BAD_STATUS — incorrect status
BAD_KEY — Invalid API key
BAD_ACTION — incorrect action
Activation API: Get the activation status
https://api.koalasms.com/stubs/handler_api.php?api_key=$api_key&action=getStatus&id=$id
&action=getStatus
$api_key — your API key (Settings);
$id — activation id.
Service responses:
STATUS_WAIT_CODE — waiting for sms
STATUS_WAIT_RETRY:$lastcode — waiting for code refinement (where $lastcode is the last, unsuitable code)
STATUS_WAIT_RESEND — waiting for the sms to be sent again (the software must click re-send sms and perform a status change to 6)
STATUS_CANCEL — activation canceled
STATUS_OK:$code — code received (where $code is the activation code).
Possible errors:
NO_ACTIVATION — the activation id does not exist
BAD_KEY — Invalid API key
BAD_ACTION — incorrect action
Activation API: Balance Request
https://api.koalasms.com/stubs/handler_api.php?api_key=$api_key&action=getBalance
&action=getBalance
$api_key — your API key (Settings);
Service response:
ACCESS_BALANCE:$balance (where $balance is the account balance)
Possible errors:
BAD_KEY — Invalid API key
Activation API: Get current prices by country
https://api.koalasms.com/stubs/handler_api.php?api_key=$api_key&action=getPrices&service=$service&country=$country
&action=getPrices
$api_key — your API key (Settings);
$service — service code;
$country — country code.
Service responses in the format
For example, a request of the form https://api.grizzlysms.com/stubs/handler_api.php?api_key=YOURKEY&action=getPrices&country=0
{
"Country": {
"Service": {
"cost": Cost,
"count": Quantity
}
}
}
Rent API: request a number
https://api.koalasms.com/stubs/handler_api.php?api_key=$api_key&action=getRentNumber&service=$service&country=$country&rent_time=$time
$api_key – your API-key (Settings);
$service – service code;
$country – country code;
$time – rental time (min. of 4 hours).
Service response will be in json format:
{
"status": "status",
"phone": {
"id": ”id rent”,
“endDate”: ”rent expiration date”,
“number”:”phone number”
}
}
The example of successful answer:
{
"status": "success",
"phone": {
"id": ”38496653”,
“endDate”: ”2023-12-31T19:30:52”,
“number”: ”66846426435”
}
}
Example of an answer with an error:
{
"status": "error",
"error": "BAD_KEY"
}
Possible errors:
BAD_KEY – check your API-key;
BAD_COUNTRY – check country code;
BAD_SERVICE – check service code;
INVALID_TIME – check count hours;
NO_BALANCE – insufficient funds in the account;
NO_NUMBERS – repeat a request or choose another country;
SERVER_ERROR – server error, repeat request later.
Rent API: continue rent
https://api.koalasms.com/stubs/handler_api.php?api_key=$api_key&action=continueRentNumber&id=$id&rent_time=$time
$api_key – your API-key (Settings);
$time - rental time (min. of 4 hours).
Service response will be in json format:
{
"status": "status",
"phone": {
"id": "id rent",
"endDate": "rent expiration date",
"number": "phone number"
}
}
The example of successful answer:
{
"status": "success",
"phone": {
"id": "38496653",
"endDate": "2023-12-31T19:30:52",
"number": "66846426435"
}
}
Example of an answer with an error:
{
"status": "error",
"error":"BAD_KEY"
}
Possible errors:
BAD_KEY – check your API-key;
INVALID_TIME – check count hours;
NO_ID_RENT – check id rent;
NO_BALANCE – insufficient funds in the account;
RENT_DIE – this number is no longer available, select a new number;
SERVER_ERROR – server error, repeat request later.
Rent API: history rent
https://api.koalasms.com/stubs/handler_api.php?api_key=$api_key&action=getRentHistory&id=$id
$api_key – your API-key (Settings);
$id – id rent;
Service response will be in json format:
{
"status": "status",
"quantity": "number of times rented",
"values": {
“1”: {
“date”: ”rent commencement date”,
“price”: rentalCost,
“hours”:rentDuration
}
}
The example of successful answer:
{
"status": "success",
"quantity": ”2”,
"values": {
“1”: {
“date”: ”2023-10-26 11:03:39”,
“price”: 3.6,
“hours”: 4
},
“2”: {
“date”:” 2023-10-25 11:02:31”,
“price”: 4,
“hours”: 5
}
}
}
An example of a successful response with an empty number:
{
"status": "success",
"values": {}
}
Example of an answer with an error:
{
"status": "error",
"error": "SQL_ERROR"
}
Possible errors:
BAD_KEY – check your API-key;
NO_ID_RENT – check id rent;
SQL_ERROR – SQL server error, repeat request later.
Rent API: rent status changes
https://api.koalasms.com/stubs/handler_api.php?api_key=$api_key&action=setRentStatus&id=$id&status=$status
$api_key – your API-key (Settings);
$id – id rent;
$status – rent status:
1 – finish rent;
2 – cancel rent.
Service response will be in json format:
{
"status": "статус"
}
The example of successful answer:
{
"status": "success"
}
Example of an answer with an error:
{
"status": "error",
"error": "CANT_CANCEL"
}
Possible errors:
BAD_KEY – check your API-key;
NO_ID_RENT – check id rent;
INVALID_PHONE – id rent nonexistent;
INCORECT_STATUS – check rent status;
ALREADY_FINISH – rent has already been finalized;
ALREADY_CANCEL – rent has already been canceled;
CANT_CANCEL – cannot be canceled (SMS received or 20 minutes have passed);
SQL_ERROR – SQL server error, repeat request later;
SERVER_ERROR – server error, repeat request later.
Rent API: get the activation status
https://api.koalasms.com/stubs/handler_api.php?api_key=$api_key&action=getRentStatus&id=$id
$api_key – your API-key (Settings);
$id – id rent.
Service response will be in json format:
{
"status": "status",
"quantity": "number of codes",
"values": {
"0": {
"phoneFrom": "phone number",
"service": "service code",
"text": "sms code",
"date": "date of SMS receipt"
}
}
}
The example of successful answer:
{
"status": "success",
"quantity": "2 ",
"values": {
"0 ": {
"phoneFrom": "66846426435",
"service": "tg",
"test": "123456",
"date": "2023-10-26 11:03:39"
},
"1": {
"phoneFrom ": "66846426435",
"service": "tg",
"test": "224444",
"date": "2023-10-26 11:02:31"
}
}
}
Example of a successful response with an empty list of codes:
{
"status": "success",
"values":{}
}
Example of an answer with an error:
{
"status": "error",
"error": "NO_ID_RENT"
}
Possible errors:
BAD_KEY – check your API-key;
NO_ID_RENT – check id rent;
INVALID_PHONE – id rent nonexistent;
SERVER_ERROR – server error, repeat request later.
Rent API: get current prices by country
https://api.koalasms.com/stubs/handler_api.php?api_key=$api_key&action=getRentPrices&service=$service&country=$country&rent_time=$time
$api_key – your API-key (Settings);
$service – service code;
$country – country code;
$time - rental time (min. of 4 hours).
Service response will be in json format:
{
"status": "status",
"values": {
"Country": {
"Service": {
"cost": cost,
"count": number,
"max_hours": maximumRentalHours
}
}
}
}
The example of successful answer:
{
"status": "success",
"values": {
"0": {
"tg": {
"cost": 12,
"max_hours": 10,
"count": 15
}
}
}
}
Example of an answer with an error:
{
"status": "error",
"error": "INVALID_TIME"
}
Possible errors:
BAD_KEY – check your API-key;
BAD_COUNTRY – check country code;
BAD_SERVICE – check service code;
INVALID_TIME – check count hours;
NO_NUMBERS – repeat a request or choose another country;
SERVER_ERROR – server error, repeat request later.