SMS Activate
Virtual numbers
Free
Get it

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 * - mobile operator numbers, you can specify several numbers separated by commas (available only for **):

Russia megafon, 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":242,"ok_0":183,"wa_0":24,"vi_0":219,"tg_0":99,"wb_0":122,"go_0":27,"av_0":70,"av_1":6,"fb_0":210}

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

Request for top countries by service

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

Parameters

$api_key - API key

$service * - service see table

* optional parameter. If not specified, the top countries for all services will be displayed by default.

$freePrice * - optional parameter. If true, the quantity and price will be transferred according to the Free Price **:

ANSWER:

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

{ 0: { "freePriceMap": { "15.00": 43242, "18.00": 333 }, "country: 0, "count": 43575, "price": 15.00 }... }

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

* returns the balance, taking into account the accumulated cashback, if the checkbox is checked in the cashback account settings  "Spend activation cashback"

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&freePrice=$freePrice&maxPrice=$maxPrice

Parameters

$api_key - API key

$service - ordering service see table

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

$freePrice * - buy a number using Free Price.

* optional parameter accepts  true(use Free Price). You also need to pass the parameter$maxPrice

$maxPrice * - indicate the maximum price at which you are ready to buy a room at Free Price.

* optional parameter, specified only if$freePrice = true

$phoneException * - excluding prefixes for Russian numbers. Specify with commas. Recording format: country code and 3 to 6 digits of the mask (for example 7918,7900111). The default is the value set in the left menu.

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

$operator * - mobile operator numbers, you can specify several numbers separated by commas (available only for **):

Russiamegafon, mts, beeline,tele2,any
Ukraine kyivstar,life,utel,mts,vodafone
Kazakhstan tele2,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 - invalid exclusion prefixes

NO_BALANCE_FORWARD - insufficient funds to buy call forwarding

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 * - mobile operator numbers, you can specify several numbers separated by commas (available only for **):

Russia megafon, mts, beeline,tele2,any
Ukraine kyivstar,life,utel,mts,vodafone
Kazakhstan tele2,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 - multiservice purchase is not available for the country you are using

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_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

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}

Get a list of all countries

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: country id;
rus : country name in Russian;
eng : country name in English;
chn : country name in Chinese;
visible: 0 - country is not displayed on the site, 1 - displayed;
retry: 0 - repeated SMS is NOT available, 1 - available;
rent: 0-country not on rent, 1 - on rent;
multiService: 0-country is NOT available for multiservice, 1- available.)

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:

success payment can be made
false qiwi 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 * - mobile operator numbers, you can specify several numbers separated by commas

$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: 4 hours)

$operator * - mobile operator numbers, you can specify several numbers separated by commas (Default: Any)

$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:

1 Finish
2 Cancel

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

List current activations

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 - no rented numbers

SQL_ERROR - SQL-server error

Renew rent

http://sms-activate.ru/stubs/handler_api.php?api_key=$api_key&action=continueRentNumber&id=$id&rent_time=$time

* Rent extension is available only for MTT operator. The life of the number is 3 months from the date of the first purchase.

Parameters

$api_key - API key

$id - id Rent

$time * - rental time (Default: 4 hours)

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

ANSWER:

The response of the service will be in json format:

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

POSSIBLE MISTAKES:

BAD_KEY - Invalid API key

BAD_ACTION - incorrect action

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

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

Possible answers in the field "message":

NO_ID_RENT - no rental id

NO_BALANCE - insufficient funds

RENT_DIE - rent cannot be extended because the number has expired

INVALID_PHONE - invalid rent id

WRONG_OPERATOR - rent transferred operator not MTT

INVALID_TIME - wrong time. Available number of hours from 4 to 1344

SQL_ERROR - SQL-server error

Get the cost of rent renewal

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

* this method is only available for rent with MTT operator.

Parameters

$api_key - API key

$id - id Rent

ANSWER:

The response of the service will be in json format:

{ "status": "success", "price": 6.33 }

POSSIBLE MISTAKES:

BAD_KEY - Invalid API key

BAD_ACTION - incorrect action

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

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

Possible answers in the field "message":

NO_ID_RENT - no rental id

RENT_DIE - rent cannot be extended because the number has expired

INVALID_PHONE - invalid rent id

WRONG_OPERATOR - rent transferred operator not MTT

SQL_ERROR - SQL-server error

Java API

Beginning of work

Include the library in maven

<dependecy>
  <groupId>ru.sms-activate</groupId>
  <artifactId>SMSActivateApi</artifactId>
  <version>1.0</version>
</dependecy>

Пример оформления вы можете посмотреть по ссылке на MavenRepository

Import the main class to interact with the sms-activate API.

import ru.sms_activate.SMSActivateApi;

Для использования библитеки вам необходим API ключ, его можно получить на данной странице и по ссылке ниже.

SMS-Activate API-Key

An example of working with balance

Для получения текущего баланса на вашем аккаунте используйте метод getBalance. Если вас интересует помимо баланса кэшбэк, то вызовите метод getBalanceAndCashBack.


Метод getBalanceAndCashBack возращает объект класса SMSActivateGetBalanceAndCashBack.

getBalance: Get the current account balance

Accepted parameters:отсутствуют

Return type:

BigDecimal

getBalanceAndCashBack: Get balance and cashback sum as full balance

Accepted parameters:отсутствуют

Return type:

SMSActivateGetBalanceAndCashBack

getNumber: get activation

Accepted parameters:

countryId(Integer) - Country identifier.

service(String) - Service short name.

forward*(boolean) - Do I need to request a redirected number

operatorSet*(Set) - A set of operators.

phoneException*(Set) - Exclusive prefixes for Russia only, a set of numbers from 3 to 6 (7918.7900111).

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

Return type:

SMSActivateActivation

Get information about available services

Accepted parameters:

countryId(Integer) - Country identifier.

operatorSet(Set) - Set of operators that are available to the service.

Return type:

SMSActivateGetNumbersStatus

getAdditionalService: Returns additional service for the forwarding number.

Accepted parameters:

activationId(Integer) - Activation ID.

service(String) - Service short name.

Return type:

SMSActivateGetNumbersStatus

* Instead of an activation identifier, you can pass the received SMSActivateActivation class object after using the getNumber method, or one of the activations after using getMultiServiceNumber .

getMultiServiceNumber: get activation for multiple services

Accepted parameters:

countryId(Integer) - Country identifier.

serviceMap(Set) - The set of services for which the acquisition is activated.

multiForwardList(List) - List of services with forwarding.

operatorSet(Set) - A set of operators.

Return type:

SMSActivateGetMultiServiceNumberResponse

getAllPrices: Get the complete list of activation prices

Accepted parameters:Отсутствуют

Return type:

SMSActivateGetPriceInfo

getPricesByCountryIdAndServiceShortName: get a list of activation prices by country and service

Accepted parameters:

countryId(Integer) - Country identifier.

serviceShortName(String) - Service short name

Return type:

SMSActivateGetPriceInfo

getPricesAllServicesByCountryId: Get a list of activation prices by country

Accepted parameters:

countryId(Integer) - Country identifier.

Return type:

SMSActivateGetPriceInfo

getPricesAllServicesByCountryId: get a list of prices for activations by service

Accepted parameters:

serviceShortName(String) - Service short name

Return type:

SMSActivateGetPriceInfo

getStatus: get activation status

Accepted parameters:

activationId(Integer) - Activation ID.

Return type:

SMSActivateGetStatusResponse

* Instead of an activation identifier, you can pass the received SMSActivateActivation class object after using the getNumber method, or one of the activations after using getMultiServiceNumber .

setStatus: set activation status

Accepted parameters:

activationId(Integer) - Activation ID.

status(SMSActivateClientStatus) - The status to set the activation.

Return type:

SMSActivateSetStatusResponse

* Instead of an activation identifier, you can pass the received SMSActivateActivation class object after using the getNumber method, or one of the activations after using getMultiServiceNumber .

Algorithm for receiving the full text of SMS with activation

Get the number using the getNumber method
after this, the following actions are available:
CACNEL - Cancel activation (if the number did not suit you)
MESSAGE_WAS_SENT - Notify that SMS has been sent (Mandatory to receive the full text of the sms)

After the mandatory setting of the MESSAGE_WAS_SENT status, set the variable to receive SMS using the waitSMS method with the activation parameters and the time to wait for the SMS.
After receiving the SMS, you can get it using the getFullSMS method and then display the full text using the getText () method
After that, you can set the activations to the following statuses:

CANCEL - Cancel activation
Immediately after receiving the code:
REQUEST_ONE_MORE_CODE - Request another SMS
FINISH - Confirm SMS code and complete activation
To activate with the REQUEST_ONE_MORE_CODE status:
FINISH - Confirm SMS code and complete activation

getCountries: get country information

Accepted parameters:Отсутствуют

Return type:

SMSActivateGetCountriesResponse

getQiwiRequisites: get information about Qiwi-requisites

Accepted parameters:Отсутствуют

Return type:

SMSActivateGetQiwiRequisitesResponse

getFullSms: get full text of sms from number

Accepted parameters:

activationId(Integer) - Activation ID.

Return type:

SMSActivateGetFullSmsResponse

* Instead of an activation identifier, you can pass the received SMSActivateActivation class object after using the getNumber method, or one of the activations after using getMultiServiceNumber .

getRentNumber: get a rental number

Accepted parameters:

countryId(Integer) - Country identifier.

service(String) - Service short name

hours(Integer)* - Rental time.

operator(String)* - The name of the mobile operator.

urlWebhook(String)* - link for webhook (Not considered by default)What is webHook?

Return type:

SMSActivateRentActivation

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

GetRentServicesAndCountriesRun: get services and countries for rent

Accepted parameters:

countryId(Integer) - Country identifier.

operatorSet(Set) - Set of cellular operators

hours(Integer)* - rental time

Return type:

SMSActivateGetRentServicesAndCountriesResponse

GetRentStatusJava: get status for rent

Accepted parameters:

rentId(Integer) - The identifier of the rented number.

Return type:

SMSActivateRentStatus

* Instead of rentId, you can pass the received object of the SMSActivateRentActivation class after using the getRentNumber method

Для большего числа примеров воспользуйтесь документацией на GitHub

                    <?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');//Get a number for services Odnoklassniki, Vkontakte, Viber without call forwarding and Avito with call forwarding foreach ($number as $value) { echo "Activation № " . $value['activation']. "for service ". $value['service'] ."\n"; }
echo "Number " . $value['phone'] ."\n";//Show activation id and number
$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']." \nRent expiration : ". $getRentNumber['phone']['endDate']." \nId numbers :" .$getRentNumber['phone']['id'] ; }//Display rental information
else echo "Код ошибки : " . $getRentNumber['message'];
$getRentStatus = $sms->getRentStatus($getRentNumber['phone']['id']);//Get the rent 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();//Get a list of currently rented numbers if (getRentList['status'] == 'success') foreach( $getRentList['values'] as $value) { echo " ID " . $value["id"] . " Number " . $value["phone"] ."\n"; }//List numbers else echo "Error code : " . $getRentList['message'];
                    
                        <--Скоро-->
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        


                        
                        
                        
                        
                        
                        

                    
                
                    
                        
                            import ru.sms_activate.SMSActivateApi;//Inclusion of a class in a project
SMSActivateApi smsActivateApi = new SMSActivate("API_KEY");//Create an instance of the SMSActivate class
BigDecimal balance = smsActivateApi.getBalance();//Get the current account balance System.out.println("Balance: "+ balance)//Withdraw the received balance SMSActivateGetBalanceAndCashbackResponse smsActivateGetBalanceAndCashbackResponse = smsActivateApi.getBalanceAndCashback();//Get current balance and cashback System.out.println("Cashback + balance: "+ smsActivateGetBalanceAndCashbackResponse.getBalanceAndCashback());//Withdraw the amount of balance and cashback SMSActivateActivation activation=smsActivateApi.getNumber(0,"vk")//Get activation for the Vkontakte service in Russia System.out.println(activation);//Withdraw the received activation SMSActivateGetNumbersStatusResponse smsActivateGetNumbersStatusResponse= smsActivateApi.getNumberStatus(0,null);//Get information about available services for Russia
SMSActivateServiceInfo go = smsActivateGetNumbersStatusResponse.getSMSActivateServiceInfoByShortName("go");//Getting information about numbers for the Google service
System.out.println("Short name service: " + go.getShortName();//Get the short name of the service System.out.println("count phone numbers: "+ go.getCountPhoneNumber();//Get the number of numbers for the service System.out.println(""Forwarding is available: "+ go.isForward() ? "yes" : "no"//Find out if the service has a redirect
SMSActivateActivation activation=smsActivateApi.getNumbersStatus(0,"ot",true);//Activations
smsActivateApi.setStatus(activation, SMSActivateClientStatus.MESSAGE_WAS_SENT);//Setting the MESSAGE_WAS_SENT status after sending SMS for the number
SMSActivateActivation childActivation =smsActivateApi.getAdditionalService(activation,"av");//Requesting a new activation for an additional service
System.out.println(childActivation);//Displaying information about additional activation
Set<String>operatorSet= new HashSet<>(); operatorSet.add("mts");//Adding an MTS operator to the set of operators Map<String,Boolean>serviceMap= new HashMap<>(); serviceMap.put("av",false);//Adding the Avito service to the list of services (specify true if you need a service with redirection)
SMSActivateGetMultiServiceNumberResponse multiServiceNumberResponse=smsActivateApi.getMultiServiceNumber(0, serviceMap, operatorSet);//Getting activation for multiple services
multiServiceNumberResponse.getSMSActivateActivationList().forEach(activation->{ System.out.println("Id: " + activation.getId()); System.out.println("Number: " + activation.getNumber()); System.out.println("Service name: " + activation.getShortName()); } //Displaying information about received activations
SMSActivateGetPricesResponse smsActivateGetPricesResponse=smsActivateApi.getPricesByCountryIdAndServiceShortName(0, "vk");//Obtaining a list of prices for Russia on the Vkontakte service. For a complete list of prices, use the getAllPrices () method;
SMSActivateGetPriceInfo vk=smsActivateGetPricesResponse.getPriceInfo(0, "vk");//Getting information about the Vkontakte service for Russia
System.out.println(">>> Cost: "+ vk.getCost());//Get a price for the service System.out.println(">>> count phone numbers: " + vk.getCountPhoneNumbers());//Get the number of numbers for the service
SMSActivateActivation activation=smsActivateApi.getNumber(0,"vk")//Get activation for the Vkontakte service in Russia System.out.println(activation);//Withdraw the received activation SMSActivateGetStatusResponse getResponse = smsActivateApi.getStatus(activation);//Getting a status for activation
System.out.println(getResponse.getSMSActivateGetStatus());//Displaying information about the activation status
smsActivateApi.setStatus(activation, SMSActivateClientStatus.MESSAGE_WAS_SENT);//Setting the MESSAGE_WAS_SENT status after receiving SMS for the number
smsActivateApi.setStatus(activation, SMSActivateClientStatus.FINISH);//Setting the FINISH status after receiving SMS for the number
SMSActivateGetCountriesResponse smsActivateGetCountriesResponse =smsActivateApi.getCountries();//Getting a list of countries with information SMSActivateCountryInfo countryInfo = smsActivateGetCountriesResponse.get(0)//Getting information about the first country on the list
System.out.println("Russian name: "+countryInfo.getRussianName();//Display the Russian name of the country System.out.println("English name: "+countryInfo.getEnglishName();//Display the Russian name of the country System.out.println("Support multi-service: "+ countryInfo.isSupportMultiService() ? "yes" : "no"//Show if the country supports multi-services
SMSActivateGetQiwiRequisitesResponse smsActivateGetQiwiRequisitesResponse=smsActivateApi.getQiwiRequisites();//Getting information about Qiwi System.out.println("Comment: "+smsActivateGetQiwiRequisitesResponse.getComment()//Displaying a comment to the details System.out.println("Wallet: "+smsActivateGetQiwiRequisitesResponse.getWallet());//Wallet withdrawal System.out.println("Up to date: "+smsActivateGetQiwiRequisitesResponse.getUpToDate());//Replenishment date display SMSActivateActivation activation=smsActivateApi.getNumber(0,"vk")//Get activation for the Vkontakte service in Russia smsActivateApi.setStatus(activation, SMSActivateClientStatus.MESSAGE_WAS_SENT);//Setting the MESSAGE_WAS_SENT status after sending SMS for the number String code=smsActivateApi.waitSms(activation,2)//Set receiving sms within 2 minutes if(code == null) { smsActivateApi.setStatus(activation, SMSActivateClientStatus.CANCEL);//Setting the CANCEL status if sms has not arrived }
else{
SMSActivateGetFullSmsResponse smsActivateGetFullSmsResponse=smsActivateApi.getFullSms(activation)//Receiving sms text System.out.println("Full SMS: "+smsActivateGetFullSmsResponse.getText());//SMS text output }
SMSActivateRentActivation rentActivation= smsActivateApi.getRentNumber(0, "vk", 6);//Getting a number with rent System.out.println(">> ID: "+rentActivation.getId());//Activation ID withdrawal System.out.println(">> Number: "+rentActivation.getId());//Displaying the activation number System.out.println(">> End date: "+rentActivation.getId());//Displaying the activation expiration date SMSActivateGetRentServicesAndCountriesResponse smsActivateGetRentServicesAndCountriesResponse= smsActivateApi.getRentServicesAndCountries(0, null, 4);//Obtaining information on services and countries that support rental
smsActivateGetRentServicesAndCountriesResponse.getAllRentServices().forEach((serviceShortName, smsActivateRentService)->{ System.out.println("Service shortname: " + serviceShortName);
System.out.println(" count phone numbers: " + smsActivateRentService.getCountPhoneNumbers());
System.out.println(">> Cost: " + smsActivateRentService.getCost()); }
//Displaying information about received services
SMSActivateRentActivation rentActivation= smsActivateApi.getRentNumber(0, "vk");//Getting a number with rent SMSActivateGetRentStatusResponse smsActivateGetRentStatusResponse= smsActivateApi.getRentStatus(rentActivation);//Getting activation status System.out.println(">> Count sms: "+ smsActivateGetRentStatusResponse.getCountSms());//Displaying the number of sms on the rented number