API - it's a protocol between your software and our server.

API needed for automatization process sms receiving on your side

Our API is fully compatible with competitor sites

All requests should go to https://sms-activate.ru/stubs/handler_api.php

POST or GET request.

All requests must have an API key as a parameter "api_key"

Download implementation of the protocol in php

Activation API

Request the number of available phones:

https://sms-activate.ru/stubs/handler_api.php?api_key=$api_key&action=getNumbersStatus&country=$country&operator=$operator

Parameters

$api_key - API key

$country * - country numbers see table

* optional field. If not specified, then by default the quantity will be displayed in accordance with the setting in the left menu.

$operator * - сотовый оператор номера, можно указывать несколько через запятую (доступно только для **):

Russiamegafon, mts, beeline, tele2, rostelecom, any
Ukrainekyivstar, life, utel, mts, vodafone
Kazakhstantele2, beeline, aktiv, altel

* optional field. If not specified, then by default the quantity will be displayed in accordance with the setting in the left menu.

** available for $country = 0, $country = 1, $country = 2

ANSWER:

The response of the service will be in json format, example:

{"vk_0":119,"ok_0":177,"wa_0":176,"vi_0":10,"tg_0":57,"wb_0":152,"go_0":124,"av_0":120,"av_1":72,"fb_0":135}

Where to the dash is the name of the service, after the designation whether it is necessary to include redirection. 0 - no. 1 - yes.

Full list of services

Balance inquiry:

https://sms-activate.ru/stubs/handler_api.php?api_key=$api_key&action=getBalance

Request a balance with cashback account

https://sms-activate.ru/stubs/handler_api.php?api_key=$api_key&action=getBalanceAndCashBack

Parameters

$api_key - API key

ANSWER:

ACCESS_BALANCE:'account balance'

POSSIBLE MISTAKES:

BAD_KEY - Invalid API key

ERROR_SQL - SQL-server error

Order number

https://sms-activate.ru/stubs/handler_api.php?api_key=$api_key&action=getNumber&service=$service&forward=$forward&operator=$operator&ref=$ref&country=$country&phoneException=$phoneException

Parameters

$api_key - API key

$service - ordering service see table

$forward * - Do I need to request a redirected number

$phoneException * - исключающие префиксы для номеров России. Указывать через запятую. Формат записи: код страны и от 3 до 6 цифр маски ( например 7918,7900111). По умолчанию берётся значение, заданное в левом меню.

* optional parameter accepts  0(not perform , set by default),  1(perform)

$operator * - сотовый оператор номера, можно указывать несколько через запятую (доступно только для **):

Russiamegafon, mts, beeline,tele2,any
Ukrainekyivstar,life,utel,mts,vodafone
Kazakhstantele2,beeline,aktiv,altel

* optional field. If not specified, then by default the quantity will be displayed in accordance with the setting in the left menu.

** available for$country = 0, $country = 1, $country = 2

$ref - pass referral identifier. Read more

$country - country numbers see table

By getting the number through the API, you agree with the project rules project rules

ANSWERS:

NO_NUMBERS - no numbers

NO_BALANCE - balance ended

ACCESS_NUMBER:$id:$number , where ($id - id operations,$number - phone number)

POSSIBLE MISTAKES:

BAD_ACTION - incorrect action

BAD_SERVICE - incorrect service name

BAD_KEY - Invalid API key

ERROR_SQL - SQL-server error

BANNED:'YYYY-m-d H-i-s' - time for which the account is blocked

WRONG_EXCEPTION_PHONE - некорректные исключающие префиксы

Ordering a number for several services

https://sms-activate.ru/stubs/handler_api.php?api_key=$api_key&action=getMultiServiceNumber&multiService=$service&multiForward=$forward&operator=$operator&ref=$ref&country=$country

Parameters

$api_key - API key

$service - services for ordering. Specify separated by commas, for example "vk, ok, vi, av" see table

$forward * - Do I need to request a redirected number

* optional parameter, forwarding characters are specified separated by commas, the number of forwarding digits must match the number of services transmitted in the parameter $service It is allowed to transmit only 1 service with redirection, for example "0,1,0,0" - correct, "0,1,1,0" - incorrect. Accepts 0(not perform , set by default),  1(perform)

$operator * - сотовый оператор номера, можно указывать несколько через запятую (доступно только для **):

Russiamegafon, mts, beeline,tele2,any
Ukrainekyivstar,life,utel,mts,vodafone
Kazakhstantele2,beeline,aktiv,altel

* optional field. If not specified, then by default the quantity will be displayed in accordance with the setting in the left menu.

$ref - pass referral identifier. Read more

$country - country numbers see table

By getting the number through the API, you agree with the project rules project rules

ANSWERS:

NO_NUMBERS - no numbers

NO_BALANCE - balance ended

{{'phone':phone,'activation':activation,'service':service},{'phone':phone,'activation':activation,'service':service}}, where (phone - id operations,activation - phone number,service - service)

POSSIBLE MISTAKES:

BAD_ACTION - incorrect action

BAD_SERVICE - incorrect service name

BAD_KEY - Invalid API key

BAD_FORWARD - redirection specified incorrectly

NOT_AVAILABLE - для страны, которую вы используете, недоступна покупка мультисервисов

ERROR_SQL - SQL-server error

BANNED:'YYYY-m-d H-i-s' - time for which the account is blocked

Change of activation status

https://sms-activate.ru/stubs/handler_api.php?api_key=$api_key&action=setStatus&status=$status&id=$id&forward=$forward

Parameters

$api_key - API key

$id - activationID

$forward * - phone number to be redirected to

* Mandatory only if the parameter forward = 1 was passed with getNumber.

$status - activation status

1report the readiness of the number (SMS to the number sent)
3request another code (free)
6complete activation*
8report the number used and cancel the activation

* complete activation (if the status was "code received" - marks successfully and finishes, if there was "preparation" - deletes and marks the error, if it was status "waiting for repetition" - translates activation into waiting for sms)

Simple logic of api chronology:

Get the number using the getNumber method
after this, the following actions are available:
8 - Cancel the activation (if the number does not match you)
1 - Notify that SMS has been sent (optional)
To activation with status 1:
8 - Cancel activation
Immediately after receiving the code:
3 - Request another SMS
6 - Confirm SMS code and complete activation
To activation with status 3:
6 - Confirm SMS code and complete activation

ANSWERS:

ACCESS_READY - number readiness confirmed

ACCESS_RETRY_GET - waiting for a new sms

ACCESS_ACTIVATION - service successfully activated

ACCESS_CANCEL - activation canceled

POSSIBLE MISTAKES:

ERROR_SQL - SQL-server error

NO_ACTIVATION - activation id does not exist

BAD_SERVICE - incorrect service name

BAD_STATUS - incorrect status

BAD_KEY - Invalid API key

BAD_ACTION - incorrect action

Get activation status:

https://sms-activate.ru/stubs/handler_api.php?api_key=$api_key&action=getStatus&id=$id

Parameters

$api_key - API key

$id - activationID

ANSWERS:

STATUS_WAIT_CODE - waiting for sms

STATUS_WAIT_RETRY:'past, inappropriate code' - waiting for code clarification

STATUS_WAIT_RESEND - waiting for re-sending SMS *

* software should click send SMS again and change status to  6

STATUS_CANCEL - activation canceled

STATUS_OK:'activation code' - code received

POSSIBLE MISTAKES:

NO_ACTIVATION - activation id does not exist

ERROR_SQL - SQL-server error

BAD_KEY - Invalid API key

BAD_ACTION - incorrect action

Получить полный текст смс

https://sms-activate.ru/stubs/handler_api.php?api_key=$api_key&action=getFullSms&id=$id

Parameters

$api_key - API key

$id - activationID

ANSWERS:

STATUS_WAIT_CODE - waiting for sms

STATUS_CANCEL - activation canceled

FULL_SMS:полный текст получен

POSSIBLE MISTAKES:

NO_ACTIVATION - activation id does not exist

ERROR_SQL - SQL-server error

BAD_KEY - Invalid API key

BAD_ACTION - incorrect action

Get current prices by country

https://sms-activate.ru/stubs/handler_api.php?api_key=$api_key&action=getPrices&service=$service&country=$country

Parameters

$api_key - API key

$service - short name of the service (optional, by default all services) see table

$country - Country code name (Optional, defaults to all countries) see table

ANSWERS:

JSON - object in the format:

{"A country":{"Service":{"cost":Cost,"count":Quant}},"retry":Repeated SMS reception}

Получить список всех стран

https://sms-activate.ru/stubs/handler_api.php?api_key=$api_key&action=getCountries

Parameters

$api_key - API key

ANSWERS:

JSON - object в формате

{{'Страна':{'id':0,'rus':"Россия","eng:"Russia","chn":"俄罗斯","visible":1,"retry":1,"rent":1,"multiService":1}},
where (
id: id страны;
rus : наименование страны на русском;
eng : наименование страны на английском;
chn : наименование страны на китайском;
visible: 0 - страна не отображается на сайте, 1 - отображается;
retry: 0 - повторная смс НЕ доступна, 1 - доступна;
rent: 0-страны нет в аренде, 1 - есть в аренде;
multiService: 0-страна НЕ доступна для мультисервиса, 1- доступна.)

Get up-to-date top-up wallet for Qiwi

You can integrate this method with your payment API for qiwi wallet and top up your account on the site fully automatically

https://sms-activate.ru/stubs/handler_api.php?api_key=$api_key&action=getQiwiRequisites

Parameters

$api_key - API key

ANSWERS:

JSON - object в формате

{"status":"статус","wallet":"PAYMENT WALLET NUMBER","upToDate":"DATE UNTIL WHICH DETAILS ARE RELEVANT","comment":"COMMENT SPECIFIED ON PAYMENT"}

ATTENTION! Details sometimes change and are valid only until the date in upToDate, to update the details, request again.

The status can be:

successpayment can be made
falseqiwi payments not possible

Additional service for redirected numbers

Having received the first SMS for redirected numbers, you can buy other related services such as Yula, Yandex, Avito, Any other

The cost of additional service is only 5p

https://sms-activate.ru/stubs/handler_api.php?api_key=$api_key&action=getAdditionalService&service=$service&id=$id

Parameters

$api_key - API key

$service - short name of the service see table

$id - Parent Activation ID

ANSWERS:

ADDITIONAL:$id:$phone - Successfully created a new activation. Where ID - ID of additional activation, phone - phone number

POSSIBLE MISTAKES:

WRONG_ADDITIONAL_SERVICE - Invalid additional service (only services for redirection are allowed)

WRONG_ACTIVATION_ID - Invalid Parent Activation ID

WRONG_SECURITY - An error occurred while trying to transfer an activation ID without forwarding, or a completed / inactive activation

REPEAT_ADDITIONAL_SERVICE - An error occurs when trying to order a purchased service again

NO_BALANCE - Not enough money

ERROR_SQL - Database error, contact support

Rent Api

Request available countries and services

https://sms-activate.ru/stubs/handler_api.php?api_key=$api_key&action=getRentServicesAndCountries&rent_time=$time&operator=$operator&country=$country

Parameters

$api_key - API key

$time * - rental time

* optional parameter. If not specified, then the default will be 1 hour.

$operator * - сотовый оператор номера, можно указывать несколько через запятую

$country * - country (Default: Russia)

* optional parameter. If not specified, then by default will be any.

ANSWER:

The response of the service will be in json format, example:

{ "countries": { "0": 0 }, "operators": { "0": "aiva", "1": "any", "2": "beeline", ... "16": "yota" }, "services": { "full": { "cost": 42.93, "quant": 20 }, "vk": { "cost": 21.95, "quant": 20 }, "ok": { "cost": 7.68, "quant": 55 }, "ot": { "cost": 5.2, "quant": 42 } } }

POSSIBLE MISTAKES:

BAD_KEY - Invalid API key

Order number for rent:

https://sms-activate.ru/stubs/handler_api.php?api_key=$api_key&action=getRentNumber&service=$service&rent_time=$time&operator=$operator&country=$country&url=$url

Parameters

$api_key - API key

$service - service for which you need to get a number

$time * - rental time (Default: 1 hour)

$operator * - сотовый оператор номера, можно указывать несколько через запятую (По умолчанию: Любой)

$country * - country (Default: Russia)

$url * - link for webhook (Not considered by default)What is webHook?

* optional parameter. If not specified, the default option will be used.

ANSWER:

The response of the service will be in json format, example:

{ "status": "success", "phone": { "id": 1049, "endDate": "2020-01-31T12:01:52", "number": "79959707564" } }

POSSIBLE MISTAKES:

BAD_KEY - Invalid API key

Answer in json format:

{ "status": "error", "message": "*possible_answer*" }

Возможные ответы в поле "message":

BAD_SERVICE - service not specified or name is incorrect

NO_BALANCE - no money in the account

NO_NUMBERS - No numbers

ACCOUNT_INACTIVE - No numbers

SQL_ERROR - SQL-server error

Get status for Rent

https://sms-activate.ru/stubs/handler_api.php?api_key=$api_key&action=getRentStatus&id=$id

Parameters

$api_key - API key

$id - rental id received in the response when ordering a phone

ANSWER:

The response of the service will be in json format* :

{ "status": "success", "quantity": "2", "values": { "0": { "phoneFrom": "79180230628", "text": "5", "service": "ot", "date": "2020-01-30 14:31:58" }, "1": { "phoneFrom": "79180230628", "text": "4", "service": "ot", "date": "2020-01-30 14:04:16" } } }

* successful only if there is an SMS (field 'quantity'> 0).

POSSIBLE MISTAKES:

BAD_KEY - Invalid API key

Answer in json format:

{ "status": "error", "message": "*possible_answer*" }

Possible answers in the field "message":

NO_ID_RENT - Rent id not specified

INVALID_PHONE - number is not rented by you (wrong rental id)

STATUS_FINISH - rent paid and completed

STATUS_CANCEL - rent canceled with refund

STATUS_WAIT_CODE - waiting for the first sms

Rental Status Change

https://sms-activate.ru/stubs/handler_api.php?api_key=$api_key&action=setRentStatus&id=$id&status=$status

Parameters

$api_key - API key

$id - rental id received in the response when ordering a phone

$status - code for changing status (number)

The status can be:

1Finish
2Cancel

ANSWER:

The response of the service will be in json format:

{ "status": "success" }

POSSIBLE MISTAKES:

BAD_KEY - Invalid API key

Ответ в json формате:

{ "status": "error", "message": "*possible_answer*" }

Possible answers in the field "message":

NO_ID_RENT - Rent id not specified

INCORECT_STATUS - missing or incorrect status

CANT_CANCEL - it is impossible to cancel the rental (more than 20 minutes)

INVALID_PHONE - number is not rented by you (wrong rental id)

ALREADY_FINISH - rental is already completed

ALREADY_CANCEL - rent already canceled

SQL_ERROR - SQL-server error

Вывести список текущих активаций

http://sms-activate.ru/stubs/handler_api.php?api_key=$api_key&action=getRentList

Parameters

$api_key - API key

ANSWER:

The response of the service will be in json format:

{ "status": "success", "values": { "0": { "id": "123456", "phone": "79181234567" }, "1": { "id": "123457", "phone": "79181234568" } } }

POSSIBLE MISTAKES:

BAD_KEY - Invalid API key

BAD_ACTION - incorrect action

Ответ в json формате:

{ "status": "error", "message": "*possible_answer*" }

Possible answers in the field "message":

NO_NUMBERS - арендованных номеров нет

SQL_ERROR - SQL-server error

                    <?php
                    include_once ("smsactivateApi.php");//Inclusion of a class in a project

                        $sms = new SMSActivate($API_KEY);//Create class instance SMSActivate

$freeSlots = $sms->getNumbersStatus(0, 'tele2');//Get the number of available numbers for the country of Russia and the tele2 operator echo "Номеров Вконтакте: " . $freeSlots['vk']."\n";//Show for Vk
echo "Номеров Whatsapp: " . $freeSlots['wa']."\n";//Show for whatsapp
var_dump($freeSlots); //Show all services with quantity
$balance = $sms->getBalance();//Get balance echo "On the account " . $balance." rub.." ."\n";//Show balance
$balance = $sms->getBalanceAndCashBack();//Request a balance with cashback account echo "On the account " . $balance." rub.." ."\n";//Request a balance with cashback account
$number = $sms->getNumber('ok',0, 0, 'tele2');//Get Odnoklassniki number without forwarding echo "Activation № " . $number['id']. "phone ". $number['number'] \n";//Show id and activation number
try{ $newNumber = $sms->getNumber('vk',0, 1); echo $newNumber['number'] ."\n"; } catch (Exception $e) { echo $e->getResponseCode() ."\n"; }//Catch an error code (e.g. NO_BALANCE)
$number = $sms->getMultiServiceNumber('ok,vk,vi,av','0,0,0,1', 0, 'tele2');//Получить номер для сервисов Одноклассники, Вконтакте, Viber без переадресации и Авито с переадресацией foreach ($number as $value) { echo "Activation № " . $value['activation']. " для сервиса ". $value['service'] ."\n"; }
echo "Number " . $value['phone'] ."\n";//Показать id активаций и номер
$status = $sms->setStatus($number['id'], 3);//Change activation status by id (get 1 more code) try{ $status = $sms->getStatus($number['id']);//Get activation status by id if ($status['status'] === 'STATUS_OK' && $status['code']) echo "Ваш код: " .$status['code']; } catch (Exception $e) { echo $e->getResponseCode() ."\n"; }//Catch the error code $prices = $sms->getPrices(1, 'vk');//Get the actual price for the service echo "Price for VK (Ukraine) : " .$prices[1]['vk']['cost']."rub. quantity: ". $prices[1]['vk']['count'];//Show the result $newQiwi = $sms->getQiwiRequisites();//Get up-to-date top-up wallet for Qiwi if ($newQiwi['status'] === 'success') echo "Wallet № " . $newQiwi['wallet']."\n";//Show wallet number $getAvailableRentNumbers = $sms->getRentServicesAndCountries('2');//Request available countries for rent and services (for 2 hours for all operators) echo "Full rental - Cost:" . $getAvailableRentNumbers['services']['full']['cost'] . " Quant :" .$getAvailableRentNumbers['services']['full']['quant'] ." \n"; //Display full price information
foreach( $getAvailableRentNumbers['operators'] as $value) { echo " Operator " . $value ."\n"; }//List operators
$getRentNumber = $sms->getRentNumber('vk','10','0','yota');//Get a rental number for Vkontakte for 10 hours, the operator 'Yota', country - Russia if ($getRentNumber['status'] === 'success'){ echo "The rental was successful! Your phone number is: " . $getRentNumber['phone']['number']." \nLease expiration : ". $getRentNumber['phone']['endDate']." \nId numbers :" .$getRentNumber['phone']['id'] ; }//Display rental information
else echo "Код ошибки : " . $getRentNumber['message'];
$getRentStatus = $sms->getRentStatus($getRentNumber['phone']['id']);//Get the lease status with id from the received number if ($getRentStatus['status'] == 'success'){ foreach( $getRentStatus['values']as $index => $value) { echo " Message " . $index .": from the number - " . $value['phoneFrom'] . "Service - " . $value ['service'] . "Message text - " . $value['text'] . "дата - " . $value['date']; } }//display a list of messages received while renting a phone else echo "Error code : " . $getRentStatus['message']; $setRentStatus = $sms->setRentStatus($getRentNumber['phone']['id'],1);//Set rental status 'finish' with id from received number if ($setRentStatus['status'] == 'success') echo " Status change was successful! "; else echo "Error code : " . $setRentStatus['message']; $getRentList = $sms->getRentList();//Получить список арендованных номеров на данный момент if (getRentList['status'] == 'success') foreach( $getRentList['values'] as $value) { echo " ID " . $value["id"] . " Number " . $value["phone"] ."\n"; }//Вывести список номеров else echo "Error code : " . $getRentList['message'];
                    
                        <--Скоро-->