API protocol para sa pakikipagtulungan sa SMS-Activate
Ang API ay isang protocol sa pagitan ng iyong software at aming server
Kailangan ang API para sa awtomatisasyon ng proseso ng pagtanggap ng sms, otp, at pva sa iyong panig
Ang aming API ay ganap na compatible sa mga website ng kakumpitensya
Lahat ng kahilingan ay dapat ipadala sa https://api.sms-activate.ai/stubs/handler_api.php
POST o GET request.
Dapat maglaman ang lahat ng kahilingan ng API key sa anyo ng api_key GET parameter
I-download ang implementasyon ng protocol sa php I-download ang handa nang implementasyon ng protocol sa PythonActivation API
Mga Parameter:
$api_key - API key
$country * - numero ng bansa tingnan ang talahanayan
$operator * mga numero ng mobile operator, maaari kang magtakda ng ilang numero na hiwalay ng kuwit (available lamang para sa:
** available for $country = 0, $country = 1, $country = 2
SAGOT:
Ang tugon ng serbisyo ay nasa json format, halimbawa:
{"vk_0":76,"ok_0":139,"wa_0":90,"vi_0":223,"tg_0":158,"wb_0":106,"go_0":182,"av_0":244,"av_1":211,"fb_0":107}
Kung saan ang dash ay pangalan ng serbisyo, pagkatapos ng designation kung kinakailangan ba ang redirection. 0 - hindi. 1 - oo.
Mga Parameter:
$api_key - API key
$service * - Serbisyo tingnan ang talahanayan
* optional na parameter. Kung hindi tinukoy, ang mga top country para sa lahat ng serbisyo ay ipapakita bilang default.
$freePrice * - optional na parameter. Kung ibinigay true, ang dami at presyo ay ibibigay ayon sa Free Price
SAGOT:
Ang tugon ng serbisyo ay nasa json format, halimbawa:
{
0: {
"country: 0,
"count": 43575,
"price": 15.00,
"retail_price": 30.00
}, ...
}
$freePrice = true:
{
0: {
"country: 0,
"count": 43575,
"price": 15.00,
"retail_price": 30.00,
"freePriceMap": {
"15.00": 43242,
"18.00": 333
}
}, ...
}
Balance request with cashback account:
* ibinabalik ang balance kasama ang naipong cashback, kung may check mark ang checkbox sa cashback account settings na 'Gumamit ng cashback para sa activation'
Mga Parameter:
$api_key - API key
SAGOT:
ACCESS_BALANCE: 'account balance'
POSSIBLE MISTAKES:
BAD_KEY - invalid API key
ERROR_SQL - sql-server error
* ibinabalik ang lahat ng operators na available para sa ipinadaling country, kung walang ipinadalang country - ibinabalik ang lahat ng operators na available para sa bawat country
Mga Parameter:
$api_key - API key
$country - country code
SAGOT:
Ang tugon ng serbisyo ay nasa json format:
{"status":"success", "countryOperators": {
"Country1Code": ["operator1Name","operator2Name","operator3Name", ...],
"Country2Code": ["operator1Name","operator2Name","operator3Name", ...],
...
}}
Halimbawa:
{"status":"success", "countryOperators": {
"0": ["beeline","megafon","mts", ...],
"1": ["life","mts","kyivstar","utel" ...],
...
}}
* sa loob ng 'countryOperators' - ang key ay magiging country code
POSSIBLE MISTAKES:
BAD_KEY - invalid API key
ERROR_SQL - sql-server error
OPERATORS_NOT_FOUND - walang nahanap na records (hal. non-existent country ang ipinadala)
Mga Parameter:
$api_key - API key
SAGOT:
Ang tugon ng serbisyo ay nasa json format:
{"status":"success", "activeActivations": [
{
"activationId" : "635468021",
"serviceCode" : "vk",
"phoneNumber" : "79********1",
"activationCost" : "12.50",
"activationStatus" : "4",
"smsCode" : ["CODE"],
"smsText" : "[Your CODE registration code]",
"activationTime" : "2022-06-01 16:59:16",
"discount" : "0.00",
"repeated" : "0",
"countryCode" : "0",
"countryName" : "Russia",
"canGetAnotherSms" : "1",
}]
POSSIBLE MISTAKES:
BAD_KEY - invalid API key
ERROR_SQL - sql-server error
NO_ACTIVATIONS - walang nahanap na entries (walang active activations)
Mga Parameter:
$api_key - API key
$service - serbisyo para sa pag-order tingnan ang talahanayan
$forward * - kailangan bang humiling ng number na may forwarding
* optional na parameter, tumatanggap ng 0 (huwag isagawa, set by default), 1 (isagawa)
$maxPrice * - ang maximum na presyo kung saan handa kang bumili ng number sa Free Price
* optional na parameter, kung hindi ito tinukoy, ang pagbili ay gagawin sa regular na presyo
$phoneException * - excluding prefixes para sa Russian numbers. I-enter gamit ang comma. Format ng record: country code at 3 hanggang 6 digits ng mask (hal. 7918, 7900111). Ang default value ay ang value na nakatakda sa account.
$operator* ay ang mobile operator ng numero, maaari kang magtukoy ng ilang mga ito gamit ang kuwit (available lamang para sa **)
$activationType - uri ng aktibasyon: 0 - may SMS (default), 1 - may numero, 2 - may boses
$language - wika ng parsing (kinakailangan para sa aktibasyon na may boses) tingnan ang talahanayan
$userId * - ID ng user na ipagbabawal dahil sa mahinang istatistika ng aktibasyon, ngunit hindi apektado ang sariling account ng reseller.
* opsyonal na field
** available for $country = 0, $country = 1, $country = 2
$ref - ilipat ang referral ID.
$country - numero ng bansa tingnan ang talahanayan
$useCashBack* - tumatanggap ng boolean value; kung ang parameter ay 'true', ang pagbili ng numero ay gagamitin ang cashback. Kapag naubos na ang pondo sa cashback balance, ang lahat ng susunod na pagbili ay gagamitin ang main balance. MAHALAGA na tandaan na ang lahat ng susunod na pagbili ay unahing gagamitin ang cashback, at pagkatapos ay ang main balance (kahit ipasa ang parameter na 'false' pagkatapos).
* opsyonal na parameter, tumatanggap ng 'true'
Sa pamamagitan ng pagkuha ng numero sa pamamagitan ng API, sumasang-ayon ka sa mga patakaran ng proyekto mga patakaran ng proyekto
POSSIBLE MISTAKES:
MALING_MAX_PRICE:$min- ang tinukoy na maximum na presyo ay mas mababa sa pinapayagan
$min - minimum na pinapayagang presyo
BAD_ACTION - maling aksyon
BAD_SERVICE - maling pangalan ng serbisyo
BAD_KEY - invalid API key
ERROR_SQL - sql-server error
BANNED:'YYYY-m-d H-i-s' - oras kung kailan naka-block ang account
WRONG_EXCEPTION_PHONE - maling exclusion prefixes
NO_BALANCE_FORWARD - kulang sa pondo upang bilhin ang call forwarding
CHANNELS_LIMIT - naka-block ang account
NO_NUMBERS - walang mga numero
Kung subukan mong kunin ang numero ng tiyak na operator na hindi operatibo sa napiling bansa o walang napiling serbisyo, ibabalik ang numero ng unang operator na tugma sa mga parameter ng kahilingan
gumagana ang method na katulad ng method getNumber, tumatanggap ng parehong mga parameter at karagdagang mga inilarawan sa ibaba, ngunit nagbabalik ng karagdagang impormasyon sa aktibasyon
Mga Parameter:
$orderId- activation id mula sa system ng reseller. Sa pagbili, ihahambing ang data na ito sa activation id at isang reseller sa aming system. Ganito, nais naming makamit ang idempotence (hindi ipoproseso muli ang parehong order).
SAGOT:
Kung matagumpay ang kahilingan, nasa sumusunod na format ang tugon:
{
"activationId": 635468024,
"phoneNumber": "79584******",
"activationCost": "12.50",
"countryCode": "0",
"canGetAnotherSms": "1",
"activationTime": "2022-06-01 17:30:57",
"activationOperator": "mtt"
}
Kung subukan mong kunin ang numero ng tiyak na operator na hindi operatibo sa napiling bansa o walang napiling serbisyo, ibabalik ang numero ng unang operator na tugma sa mga parameter ng kahilingan
POSSIBLE MISTAKES:
ORDER_ALREADY_EXISTS- ang order ay nagawa na
Kapag nakatanggap ka ng SMS sa isang numero, kung pinagana mo ang Webhooks functionality sa iyong mga setting, ipapadala namin ang impormasyon tungkol sa SMS sa mga address na itinakda mo gamit ang POST request
SAGOT:
Ang format ng tugon ay magiging ganito:
{
"activationId": 635468024,
"service": "go",
"text": "Your sms text",
"code": "Your sms code",
"country": 0,
"receivedAt": "2022-06-01 17:30:57",
}
Kapag nagpapadala ng kahilingan, hihintayin namin ang tugon mula sa iyong script na may HTTP status 200. Kung hindi tumugon ang iyong script, magpapadala kami ng kahilingan sa loob ng 2 oras, ngunit hindi hihigit sa 8 beses.
Maaari mong paganahin ang functionality na ito sa mga setting ng profile
Mga Parameter:
$api_key - API key
$service - serbisyo para sa pag-order tingnan ang talahanayan
$forward * - kailangan bang humiling ng number na may forwarding
* opsyonal na parameter, ang mga forwarding character ay hiwalay ng kuwit, ang bilang ng mga forwarding digit ay dapat tumugma sa bilang ng mga serbisyo na ipinadala sa parameter $service. Pinapayagan lamang ang pagpapadala ng 1 serbisyo na may redirection, halimbawa "0,1,0,0" - tama, "0,1,1,0" - mali. Gumagamit ng 0 (huwag gawin, default), 1 (gawin)
$operator * - mobile operator ng numero, maaari kang magtakda ng ilang numero na hiwalay ng kuwit (available lamang para sa **):
$ref - ilipat ang referral ID.
$country - numero ng bansa tingnan ang talahanayan
Sa pamamagitan ng pagkuha ng numero sa pamamagitan ng API, sumasang-ayon ka sa mga patakaran ng proyekto mga patakaran ng proyekto
SAGOT:
NO_NUMBERS - walang mga numero
NO_BALANCE - naubos na ang balanse
{{'phone':phone,'activation':activation,'service':service},
{'phone':phone,'activation':activation,'service':service}}, kung saan (phone - id ng operasyon, activation - Numero ng telepono, service - Serbisyo)
POSSIBLE MISTAKES:
BAD_ACTION - maling aksyon
BAD_SERVICE - maling pangalan ng serbisyo
BAD_KEY - invalid API key
ERROR_SQL - sql-server error
BANNED:'YYYY-m-d H-i-s' - oras kung kailan naka-block ang account
Mga Parameter:
$api_key - API key
$id - Activation ID
$forward * - numero ng telepono kung saan gusto mong i-forward
* kinakailangan lamang kung may parameter na ipinadala na may getNumber forward=1.
$status - status ng activation
1 - ipaalam ang availability ng numero (ipinadala ang sms sa numero)
3 - humingi ng isa pang code (libre)
6 - tapusin ang activation *
8 - iulat na ginamit na ang numero at kanselahin ang activation
* kung may status na 'natanggap ang code' - markahan ito bilang matagumpay at tapusin, kung may 'preparation' - burahin at markahan bilang error, kung may status na 'awaiting retry' - ilipat ang activation sa SMS pending
** Hindi posible baguhin ang status ng activation kung saan napili ang verification method via call kung dumating na ang numero
Ang simpleng lohika ng kronolohiya ng pagtatrabaho sa API:
Pagkuha ng numero gamit ang getNumber method, pagkatapos available ang mga sumusunod na aksyon:
8 - kanselahin ang activation (kung hindi angkop ang numero para sa iyo)
1 - ipaalam na naipadala ang SMS (opsyonal)
Para sa activation na may status 1:
8 - kanselahin ang activation
Agad pagkatapos matanggap ang code:
3 - humingi ng isa pang SMS
6 - kumpirmahin ang SMS-code at tapusin ang activation
Para sa activation na may status 3:
6 - kumpirmahin ang SMS-code at tapusin ang activation
SAGOT:
ACCESS_READY - kumpirmado ang readiness ng mga numero
ACCESS_RETRY_GET - naghihintay para sa bagong SMS
ACCESS_ACTIVATION - matagumpay na na-activate ang serbisyo
ACCESS_CANCEL - kinansela ang aktibasyon
POSSIBLE MISTAKES:
EARLY_CANCEL_DENIED - hindi pinapayagan ang pagkansela ng numero sa loob ng unang 2 minuto
ERROR_SQL - sql-server error
NO_ACTIVATION - wala o hindi umiiral ang activation ID
BAD_SERVICE - maling pangalan ng serbisyo
BAD_STATUS - maling status
BAD_KEY - invalid API key
BAD_ACTION - maling aksyon
WRONG_ACTIVATION_ID - maling ID o ang ID ay hindi isang numero.
Mga Parameter:
$api_key - API key
$id - Activation ID
SAGOT:
STATUS_WAIT_CODE - naghihintay para sa SMS
STATUS_WAIT_RETRY: 'nakaraan, hindi tugmang code' - naghihintay para sa paglilinaw ng code
STATUS_WAIT_RESEND - naghihintay para sa muling pagpapadala ng SMS *
* kailangang pindutin ng software ang muling pagpapadala ng SMS at baguhin ang status sa 6
STATUS_CANCEL - kinansela ang aktibasyon
STATUS_OK: 'activation code' - natanggap ang code
POSSIBLE MISTAKES:
NO_ACTIVATION - wala o hindi umiiral ang activation ID
ERROR_SQL - sql-server error
BAD_KEY - invalid API key
BAD_ACTION - maling aksyon
Mga Parameter:
$api_key - API key
$id - Activation ID
SAGOT:
Ang format ng tugon ay magiging ganito:
{
"verificationType": 2,
"sms": {
"dateTime": "0000-00-00 00:00:00",
"code": "code",
"text": "sms text",
},
"call": {
"from": "phone",
"text": "voice text",
"dateTime": "0000-00-00 00:00:00",
"url": "voice file url",
"parsingCount": 1,
}
}
STATUS_CANCEL - kinansela ang aktibasyon
POSSIBLE MISTAKES:
NO_ACTIVATION - wala o hindi umiiral ang activation ID
ERROR_SQL - sql-server error
BAD_KEY - invalid API key
BAD_ACTION - maling aksyon
Mga Parameter:
$api_key - API key
$start - timestamp sa format ng Unix Timestamp (opsyonal) - mula sa anong petsa isasaalang-alang ang mga aktibasyon
$end - timestamp sa format ng Unix Timestamp (opsyonal) - hanggang sa anong petsa isasaalang-alang ang mga aktibasyon
$offset - offset ng unang elementong ibinalik sa response. Ang default ay 0
$limit - maximum na bilang ng mga naitalang record. Ang maximum ay 100. Ang default ay 50.
SAGOT:
Ang format ng tugon ay magiging ganito:
[{
"id": 635468024,
"date": "2022-11-12 15:58:39",
"phone": "79918529716",
"sms": "sms":"["Your sms code"]",
"cost": 100 //Если активация не завершена, то cost = 0,
"status": "4",
}]
POSSIBLE MISTAKES:
ERROR_SQL - sql-server error
BAD_KEY - invalid API key
BAD_ACTION - maling aksyon
Mga Parameter:
$api_key - API key
$service - pangalan ng serbisyo
SAGOT:
Ang format ng tugon ay magiging ganito:
[{
"country": 0,
"share": 50 - // (Purchases of the chosen service by country as a percentage of the total quantity of purchases at our service),
"rate": 50 - // (% of successful activations among the total number of activations by the country)
}]
POSSIBLE MISTAKES:
ERROR_SQL - sql-server error
BAD_KEY - invalid API key
WRONG_SERVICE - maling serbisyo
BAD_ACTION - maling aksyon
Mga Parameter:
$api_key - API key
$id - Activation ID
SAGOT:
Ang tugon ng serbisyo ay nasa json format, halimbawa:
{"status":"2","phone":false}
POSSIBLE STATUSES:
2 - bagong aktibasyon
3 - matagumpay na natapos
4 - kinansela
5 - ibinalik
POSSIBLE MISTAKES:
BAD_KEY - invalid API key
INVALID_ACTIVATION_ID - Di-wastong ID ng aktibasyon
Mga Parameter:
$api_key - API key
$serviceMaikling pangalan ng serbisyo (Opsyonal, default ay lahat ng serbisyo) tingnan ang talahanayan
$countryPangalan ng country code (Opsyonal, default ay lahat ng bansa) tingnan ang talahanayan
SAGOT:
JSON - object sa format
{"Country":{"Service":{"cost":Cost,"count":Count}}}
Mga Parameter:
$api_key - API key
$serviceMaikling pangalan ng serbisyo (Opsyonal, default ay lahat ng serbisyo) tingnan ang talahanayan
SAGOT:
JSON - object sa format
{"Service":{"Country":{"count":Quantity,"price":"Price"}}}
Mga Parameter:
$api_key - API key
SAGOT:
JSON - object sa format {{'Страна':{'id':0,'rus':"Россия","eng:"Russia","chn":"俄罗斯","visible":1,"retry":1,"rent":1,"multiService":1}},
kung saan (
id : id ng bansa;
rus : pangalan ng bansa sa Russian;
eng : pangalan ng bansa sa English;
chn : pangalan ng bansa sa Chinese;
visible : 0 - hindi ipinapakita ang bansa sa site, 1 - ipinapakita;
retry : 0 - HINDI available ang paulit-ulit na SMS, 1 - available;
rent : 0 - hindi inuupahan ang bansa, 1 - inuupahan;
multiService : 0 - HINDI available ang bansa para sa multiservice, 1 - available.)
Mga Parameter:
$api_key- API key
$country *- ID ng Bansa. Kung ipinasa mo ang bansa, ibabalik namin ang mga serbisyo na may presyo para sa napiling bansa
$lang *- aling wika ang gagamitin para sa `name`. Mga posibleng halaga: 'ru', 'en', 'es', 'cn'. Ang default ay 'en'
* optional na parameter
SAGOT:
JSON - object sa format { "status": "success", "services": [ { "code": "aoo", "name": "Pegasus Airlines" } ] }
Pagkatapos makatanggap ng unang SMS para sa mga redirected na numero, maaari kang bumili ng iba pang kaugnay na serbisyo tulad ng Yula, Yandex, Avito, at iba pa.
Ang halaga ng karagdagang serbisyo ay 5p lamang
Mga Parameter:
$api_key - API key
$service - para sa maikling pangalan ng serbisyo, tingnan ang talahanayan tingnan ang talahanayan
$id - Parent Activation ID
SAGOT:
ADDITIONAL:$id:$phone - matagumpay na nalikha ang bagong aktibasyon. Kung saan ang ID ay ID ng karagdagang aktibasyon, ang phone ay isang numero ng telepono
POSSIBLE MISTAKES:
WRONG_ADDITIONAL_SERVICE - Di-wastong karagdagang serbisyo (tanging mga serbisyo para sa forwarding ang pinapayagan)
WRONG_ACTIVATION_ID - Maling parental activation ID
WRONG_SECURITY - nagkaroon ng error habang sinusubukang ipasa ang activation ID nang walang redirection, o isang nakumpleto/hindi aktibong aktibasyon
REPEAT_ADDITIONAL_SERVICE - nagkakaroon ng error kapag sinusubukang order muli ang biniling serbisyo NO_BALANCE - Hindi sapat ang pondo
ERROR_SQL- error sa database, makipag-ugnayan sa customer service
Kung nakapag-activate ka nang matagumpay sa numero, maaari mo itong gawin muli.
Ang halaga ng karagdagang aktibasyon ay nakadepende sa bansa at serbisyo. Ang tiyak na halaga ay maaaring makuha mula sa .
Mga Parameter:
$api_key - API key
$activationId - Parent Activation ID
SAGOT:
ACCESS_NUMBER:$id:$phone - matagumpay na nalikha ang bagong aktibasyon. Kung saan ang $id ay ID ng karagdagang aktibasyon, ang $phone ay isang numero ng telepono
POSSIBLE MISTAKES:
RENEW_ACTIVATION_NOT_AVAILABLE- hindi available ang numero para sa karagdagang aktibasyon
WRONG_ACTIVATION_ID - Maling parental activation ID
ERROR_SQL- error sa database, makipag-ugnayan sa customer service
NEW_ACTIVATION_IMPOSSIBLE- hindi posible ang gumawa ng karagdagang aktibasyon
NO_BALANCE - walang pera sa account
Maaari mong alamin kung available ang numero para sa karagdagang aktibasyon at malaman ang halaga nito
Mga Parameter:
$api_key - API key
$activationId - Parent Activation ID
SAGOT:
JSON - object sa format {'status': 'success', 'cost':200,"service":"tw","phone":777777777,"country":14},
POSSIBLE MISTAKES:
RENEW_ACTIVATION_NOT_AVAILABLE- hindi available ang numero para sa karagdagang aktibasyon
WRONG_ACTIVATION_ID - Maling parental activation ID
SIM_OFFLINE - Offline ang SIM card
Mga Parameter:
$api_keyapi key
$id - Activation ID
$newLang - bagong wika ng parsing tingnan ang talahanayan
SAGOT:
Ang format ng tugon ay magiging ganito:
{
"result": "OK"
}
STATUS_CANCEL - kinansela ang aktibasyon
NO_CALL- walang natanggap na tawag
PARSE_COUNT_EXCEED- limitasyon sa bilang ng mga pagtatangkang mag-parse (maximum ay 4)
POSSIBLE MISTAKES:
WRONG_ACTIVATION_ID - hindi wastong ID, wala ang aktibasyon
ERROR_SQL - sql-server error
BAD_KEY - invalid API key
BAD_ACTION - maling aksyon
API para sa Pag-upa
Mga Parameter:
$api_key - API key
$time* - oras ng pag-upa (default: 4 na oras)
$operator* - mobile operator ng numero, maaari kang magtukoy ng ilang operator na hiwalay ng kuwit (default: Anuman)
$country* - bansa (default: Russia)
$incomingCall * - kung inilipat "true"kumuha ng numerong sumusuporta sa function para tumanggap ng tawag
SAGOT:
Ang tugon ng serbisyo ay nasa json format, halimbawa:
{ "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
OUT_OF_STOCK - hindi available ang mga numero para sa bansang iyon
Mga Parameter:
$api_key - API key
$service - ang serbisyo kung saan kailangan mong kumuha ng numero
$time* - oras ng pag-upa sa loob ng mga oras (default: 4 na oras). Ang susunod na available na panahon ay 12 oras, pagkatapos ay 24 oras. Kapag nagre-request ng pag-upa para sa isang araw o higit pa, kailangan mong ilipat: 24, 48, 72, atbp.
$operator* - mobile operator ng numero, maaari kang magtukoy ng ilang operator na hiwalay ng kuwit (default: Anuman)
$country* - bansa (default: Russia)
$url * - link para sa webhook (hindi itinuturing default)
$incomingCall * - kung inilipat "true"kumuha ng numerong sumusuporta sa function para tumanggap ng tawag
* opsyonal na parameter. Kung hindi itinakda, gagamitin ang default na parameter.
SAGOT:
Ang tugon ng serbisyo ay nasa json format, halimbawa:
{ "status": "success", "phone": { "id": 1049, "endDate": "2020-01-31T12:01:52", "number": "79959707564" } }
POSSIBLE MISTAKES:
BAD_KEY - invalid API key
Sagot sa json format:
{ "status": "error", "message": "*possible_answer*" }
Mga posibleng sagot sa field "message":
BAD_SERVICE - hindi tinukoy ang serbisyo o mali ang pangalan
NO_BALANCE - walang pera sa account
NO_NUMBERS - walang mga numero
ACCOUNT_INACTIVE - walang mga numero
SERVER_ERROR - error sa server
CHANNELS_LIMIT - naka-block ang account
Mga Parameter:
$api_key - API key
$id - ID ng pag-upa na natanggap sa reply kapag umorder ng numero
$page* - numero ng pahina kung saan nagsisimula ang pagpili (nagsisimula ang numbering ng pahina mula 0, mula bago hanggang luma; default ay 0)
$size* - laki ng pahina (default 10)
* opsyonal na parameter. Kung hindi itinakda, gagamitin ang default na parameter.
SAGOT:
Ang tugon ng serbisyo ay nasa json format, halimbawa:
{ "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" } } }
* matagumpay lamang kapag mayroong sms (kahon 'quantity' > 0).
POSSIBLE MISTAKES:
BAD_KEY - invalid API key
Sagot sa json format:
{ "status": "error", "message": "*possible_answer*" } Mga posibleng sagot sa field "message": NO_ID_RENT - hindi tinukoy ang ID ng pag-upa INVALID_PHONE - ang numero ay inupahan hindi ng iyong sarili (hindi wastong rent ID) STATUS_FINISH - bayad na at natapos ang pag-upa STATUS_CANCEL - kinansela ang pag-upa na may refund STATUS_WAIT_CODE - naghihintay para sa unang SMS STATUS_REVOKE - Na-block ang numero, ibinalik na ang iyong pondo
Mga Parameter:
$api_key - API key
$id - ID ng pag-upa na natanggap sa reply kapag umorder ng numero
$status - code para baguhin ang status (numero)
Maaaring maging ang status:
SAGOT:
Ang tugon ng serbisyo ay nasa json format:
{ "status": "success" }
POSSIBLE MISTAKES:
BAD_KEY - invalid API key
Sagot sa json format:
{ "status": "error", "message": "*possible_answer*" }
Mga posibleng sagot sa field "message":
NO_ID_RENT - hindi tinukoy ang ID ng pag-upa
INCORECT_STATUS - nawawala o mali ang itinakdang status
CANT_CANCEL - hindi maikakansela ang lease (mahigit 20 min.)
INVALID_PHONE - ang numero ay inupahan hindi ng iyong sarili (hindi wastong rent ID)
ALREADY_FINISH - tapos na ang lease
ALREADY_CANCEL - nakansela na ang lease
SERVER_ERROR - error sa server
👉Paalala! Ang method na ito ay nagpapakita lamang ng huling 10 numero. Kung kailangan mo ng higit pang numero, gamitin ang getRentStatus method upang suriin ang mga status.
Mga Parameter:
$api_key - API key
SAGOT:
Ang tugon ng serbisyo ay nasa json format:
{ "status": "success", "values": { "0": { "id": "12345", "phone": "79181234567" }, "1": { "id": "12345", "phone": "79181234568" } } }
POSSIBLE MISTAKES:
BAD_KEY - invalid API key
BAD_ACTION - maling aksyon
Sagot sa json format:
{ "status": "error", "message": "*possible_answer*" }
Mga posibleng sagot sa field "message":
NO_NUMBERS - walang inuupahang numero
SERVER_ERROR - error sa server
Mga Parameter:
$api_key - API key
$id - id ng pag-upa
$rent_time- oras ng pag-upa (default: 4 na oras)
SAGOT:
Ang tugon ng serbisyo ay nasa json format:
{ "status": "success", "phone": { "id": 1049, "endDate": "2020-01-31T12:01:52", "number": "79959707564"} }
Kapag pinahaba ang tapos nang pag-upa, ito ay iire-order muli at bibigyan ng bagong id
POSSIBLE MISTAKES:
BAD_KEY - invalid API key
BAD_ACTION - maling aksyon
SERVER_ERROR - error sa server
Sagot sa json format:
{ "status": "error", "message": "*possible_answer*", "info": "*details*" }
Mga posibleng sagot sa field "message":
NO_ID_RENT - walang rent ID
INVALID_TIME - maling oras. Ang available na bilang ng oras ay mula 4 hanggang 1344
MAX_HOURS_EXCEED - Lumampas sa maximum na available na oras
max - maximum na available na oras
INVALID_PHONE - maling rent ID
RENT_DIE - hindi ma-extend ang pag-upa dahil napaso na ang numero
NO_BALANCE - kulang sa pondo
CHANNELS_LIMIT - naka-block ang account
* ang paraang ito ay available lamang para sa pag-upa gamit ang operator na MTT.
Mga Parameter:
$api_key - API key
$id - id ng pag-upa
$rent_time - oras ng pag-upa
SAGOT:
Ang tugon ng serbisyo ay nasa json format:
{ "status": "success", "price": 6.33 }
POSSIBLE MISTAKES:
BAD_KEY - invalid API key
BAD_ACTION - maling aksyon
SERVER_ERROR - error sa server
Sagot sa json format:
{ "status": "error", "message": "*possible_answer*" }
Mga posibleng sagot sa field "message":
NO_ID_RENT - walang rent ID
INVALID_PHONE - maling rent ID
INVALID_TIME - maling setting ng oras
RENT_DIE - hindi ma-extend ang pag-upa dahil napaso na ang numero
MAX_HOURS_EXCEED - Lumampas sa maximum na available na oras
max - maximum na available na oras
CHANNELS_LIMIT - naka-block ang account
API JAVA
Isama ang library sa maven
<artifactId>SMSActivateApi</artifactId>
<version>1.0</version>
</dependency>
Makikita mo ang halimbawa ng pagpaparehistro sa pamamagitan ng link sa MavenRepository
I-import ang pangunahing class upang makipag-ugnayan sa SMS-Activate API.
Upang magamit ang library, kailangan mo ng API key, maaari mong makuha ito sa pahinang ito at sa link sa ibaba.
SMS-Activate API-KeyUpang makuha ang kasalukuyang balanse sa iyong account, gamitin ang method getBalance... Kung interesado ka sa cashback bukod sa balanse, tawagin ang method getBalanceAndCashBack.
Paraan getBalanceAndCashBack nagbabalik ng object ng classSMSActivateGetBalanceAndCashBack.
Mga Parameter:
WALA
URI NG BALIK:
BigDecimal
Mga Parameter:
WALA
URI NG BALIK:
Mga Parameter:
countryId(Integer) - identifier ng bansa.
service(String) - maikling pangalan ng serbisyo.
forward*(boolean) -kung hihingin ang numerong may call forwarding.
operatorSet*(Set) - set ng mga operator.
phoneException*(Set) - hindi kasama ang mga prefix para sa Russia lamang, isang set ng mga numero mula 3 hanggang 6 (7918,7900111).
* optional na kahon. Kung walang tinukoy, ang default na dami ay ibibigay ayon sa setting sa profile.
URI NG BALIK:
Mga Parameter:
countryId(Integer) - identifier ng bansa.
operatorSet*(Set) - set ng mga operator na available para sa serbisyo
URI NG BALIK:
Mga Parameter:
id(Integer) - identifier ng activation
service(String) - maikling pangalan ng serbisyo.
Sa halip na activation identifier, maaari mong ipasa ang natanggap na class object SMSActivateActivation pagkatapos gamitin ang method getNumber o isa sa mga activation pagkatapos gamitin getMultiServiceNumber.
URI NG BALIK:
Mga Parameter:
countryId(Integer) - identifier ng bansa.
serviceMap(Set) - set ng mga serbisyo kung saan binili ang activation
multiForwardList(List) - listahan ng mga serbisyo na may available na call forwarding
operatorSet(Set) - set ng mga operator.
URI NG BALIK:
Mga Parameter:
WALA
URI NG BALIK:
Mga Parameter:
countryId(Integer) - identifier ng bansa.
service(String) - maikling pangalan ng serbisyo.
URI NG BALIK:
Mga Parameter:
countryId(Integer) - identifier ng bansa.
URI NG BALIK:
Mga Parameter:
activationId(Integer) - identifier ng activation
Sa halip na activation identifier, maaari mong ipasa ang natanggap na class object SMSActivateActivation pagkatapos gamitin ang method getNumber o isa sa mga activation pagkatapos gamitin getMultiServiceNumber.
URI NG BALIK:
Mga Parameter:
id(Integer) - identifier ng activation
status(SMSActivateClientStatus) - ang status na itatakda para sa activation
Sa halip na activation identifier, maaari mong ipasa ang natanggap na class object SMSActivateActivation pagkatapos gamitin ang method getNumber o isa sa mga activation pagkatapos gamitin getMultiServiceNumber.
URI NG BALIK:
Mga Parameter:
WALA
URI NG BALIK:
Mga Parameter:
activationId(Integer) - identifier ng activation
Sa halip na activation identifier, maaari mong ipasa ang natanggap na class object SMSActivateActivation pagkatapos gamitin ang method getNumber o isa sa mga activation pagkatapos gamitin getMultiServiceNumber.
URI NG BALIK:
Algorithm para sa pagkuha ng buong teksto ng SMS na may activation
Pagkuha ng numero gamit ang getNumber method, pagkatapos available ang mga sumusunod na aksyon:
CANCEL - 8 - Kanselahin ang activation (kung hindi tugma ang numero sa iyo)
MESSAGE_WAS_SENT - Ipahiwatig na naipadala na ang SMS (Kinakailangan upang makuha ang buong teksto ng SMS)
Pagkatapos itakda ang status na MESSAGE_WAS_SENT bilang kinakailangan, i-set ang variable upang tumanggap ng SMS gamit ang waitSMS method kasama ang mga parameter ng activation at ang oras ng paghihintay para sa SMS.
Pagkatapos matanggap ang SMS, maaari mo itong kunin gamit ang getFullSMS method at ipakita ang buong teksto gamit ang getText() method.
Pagkatapos nito, maaari mong itakda ang mga activation sa mga sumusunod na status:
Upang i-activate gamit ang status na MESSAGE_WAS_SENT:
CANCEL - Kanselahin ang activation
Agad pagkatapos matanggap ang code:
REQUEST_ONE_MORE_CODE - Humiling ng isa pang SMS
FINISH - Kumpirmahin ang code ng SMS at tapusin ang activation
Upang i-activate gamit ang status na REQUEST_ONE_MORE_CODE:
FINISH - Kumpirmahin ang code ng SMS at tapusin ang activation
Mga Parameter:
countryId(Integer) - identifier ng bansa.
service(String) - maikling pangalan ng serbisyo.
hours(Integer)* - tagal ng pag-upa
operator(String)* - pangalan ng mobile operator
urlWebhook(String)* - link para sa webhook (Hindi isinasama sa default)
Ano ang webHook?* optional na parameter. Kung hindi tinukoy, ang default ay gagamitin
URI NG BALIK:
Mga Parameter:
countryId(Integer) - identifier ng bansa.
operatorSet(Set) - set ng mga mobile operator
hours(Integer)* - tagal ng pag-upa
* optional na parameter. Kung hindi tinukoy, ang default ay gagamitin
URI NG BALIK:
Mga Parameter:
rentId(Integer) - identifier ng inupahang numero
Sa halip na rentId, maaari mong ipasa ang resulting class object SMSActivateRentActivation pagkatapos gamitin ang method getRentNumber
URI NG BALIK:
Email API
Paglalarawan ng mga API status
3 - Naghihintay
4 - Kinansela
5 - Tagumpay
DESKRIPSYON:
Mas mahigpit na pagsunod sa mga prinsipyo ng REST API at tumaas na bilang ng mga gmail.com mailbox para sa pagrehistro ng mga Telegram account.
Mga Parameter:
$api_key - API key
$site- Ang site na kailangan mo ng email
SAGOT:
Ang tugon ng serbisyo ay nasa json format, halimbawa:
{
"status":"OK",
"response":{
"zones":[
{
"name":"info",
"cost":2.5
},
...
],
"popular":[
{
"name":"mail.ru",
"cost":6,
"count":159008
},
...
]
}
}
POSSIBLE MISTAKES:
BAD_SITE- Hindi tinukoy ang site
BAD_KEY - invalid API key
BAD_ACTION - maling aksyon
Mga Parameter:
$api_key - API key
$site - ang site na kailangan mo ng email
$mail_type - uri ng mail: popular na domain o zone (1 - zones 2 - popular)
$mail_domain - napiling zone o domain
SAGOT:
Ang tugon ng serbisyo ay nasa json format, halimbawa:
{
"status":"OK",
"response":{"email":"[email protected]","id":241}
}
POSSIBLE MISTAKES:
BAD_KEY - invalid API key
BAD_ACTION - maling aksyon
MAIL_TYPE_ERROR - walang ganitong domain para sa tinukoy na site
CHANNELS_LIMIT - naka-block ang account
Mga Parameter:
$api_key - API key
$id- ID ng email na kailangang muling i-activate
SAGOT:
Ang tugon ng serbisyo ay nasa json format, halimbawa:
{
"status": "OK",
"response": {
"email": "[email protected]",
"id": 360
}
}
POSSIBLE MISTAKES:
BAD_KEY - invalid API key
BAD_ACTION - maling aksyon
BLOCKED_SITE - naka-block na website
BAD_BALANCE - kulang sa pondo
ACTIVATION_NOT_FOUND - hindi natagpuan ang activation
CHANNELS_LIMIT - naka-block ang account
Mga Parameter:
$api_key - API key
$page- numero ng pahina
$per_page- bilang ng mga pagbili sa bawat pahina
$search- search bar
$sort- direksyon ng pag-aayos. (desc, asc)
SAGOT:
Ang tugon ng serbisyo ay nasa json format, halimbawa:
{
"status":"OK",
"response":{
"list":[
{
"id":"241",
"site":"apple.com",
"email":"[email protected]",
"status":"3",
"value":null,
"cost":"6.00",
"date":"2023-10-06 14:24:13",
"full_message":""
}
],
"pages":1,
"count":1
}
}
Mga Parameter:
$api_key - API key
$id- purchase id
SAGOT:
Ang tugon ng serbisyo ay nasa json format, halimbawa:
{
"status":"OK",
"response":true
}
POSSIBLE MISTAKES:
EARLY_CANCEL_DENIED - Hindi mo maaring kanselahin ang email sa unang 2 minuto.
Mga Parameter:
$api_key - API key
$id- id ng biniling email, ibinabalik ito pagkatapos bumili ng email
SAGOT:
Ang tugon ng serbisyo ay nasa json format, halimbawa:
{
"status":"OK",
"response":{
"value":"Содержания письма"
}
}
Software ng API Partner
Mga Parameter:
$api_key - API key
$id- Id ng software na kailangan mong bilhin
SAGOT:
Ang tugon ng serbisyo ay nasa json format, halimbawa:
{
"status": "success",
"key": "F5qrzFoY6afj3zrEq7SeMplbx",
"manual": "Software download link:"
}
POSSIBLE MISTAKES:
BAD_DATA - Maling ID o ang ID ay hindi numero
BAD_ACTION - di-wastong aksyon o hindi na-verify ang reseller.
<?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
$array=$activate->getTopCountriesByService(); //Get an array whose elements contain information for each country
$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
$operators = $sms->getOperators();
//Get operators for all countries
if (in_array('mts', $operators['countryOperators'][0])) {
//check if 'mts' is available for Russia
//perform an action
}
if (in_array('chinamobile', $operators['countryOperators'][3])) {
//check if 'chinamobile' is available for China
//perform an action
}
$activations = $sms->getActiveActivations();
$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
$result = $sms->getNumber('vk', 0 , 1);
if (!is_array($result)) {
echo 'Ошибка: ' . $result . '\n';//If an error occurs, a string will be returned, if successful, an array will be returned.
} else {
echo 'Id: ' . $result['id'] ."\n";
echo 'Номер: ' . $result['number'] ."\n";
}
$result = $sms->getNumberV2('vk', 0 , 1);
$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)
$status = $sms->getStatus($number['id']);//Get activation status by id
if (is_array($status) {
echo "статус : " . $status['status'];//Can be STATUS_OK or STATUS_WAIT_RETRY, otherwise a line with error text will be returned
echo "код: " . $status['code'];
} else {
echo $status ."\n";
}
$incomingCall = $sms->getIncomingCallStatus($id);//Get activation data by call
echo $incomingCall['phone'] //Show incoming number
$prices = $sms->getPrices(1, 'vk');//Get the current price for the service
echo "Price for VK (Ukraine) : " .$prices[1]['vk']['cost']." rub. quantity: ". $prices[1]['vk']['count'];//Show the result
$countries = $sms->getCountries();//Get a list of all countries
$additional = $sms->getAdditionalService('fx', $id);//Get additional activation for PGbonus service based on id activation
echo "Activation no.: " . $additional[id] . " Telephone: " . $additional[number];//Show the result
$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 number for rent for Vkontakte for 10 hours, 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 "Error code : " . $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'] . "Date - " . $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'];
$result = $sms->continueRentNumber($id);//Extend the lease of activation id for 4 hours (by default)
if ($result['status'] == 'success') {
echo "Number: " . $result['phone']['number']"//Display number
echo "id: " . $result['phone']['id']"//Display activation id
echo "The lease is valid until: " . $result['phone']['endDate']"//Display the date and time of the end of the lease
} else {
echo "Error code : " . $result['msg'];
}
$result = $sms->getContinueRentPriceNumber($id, 12);//Get the cost of renewing the lease to activate the id for 12 hours
if ($result['status'] == 'success') {
echo " Renewal cost " . $result['price'];//Withdraw the cost
} else {
echo "Error code: " . $result['message']; //Display error code
}
from sms-activate.fun import SMSActivateAPI
# SMSActivateAPI Contains all basic tools for working with the SMSActivate API
sa = SMSActivateAPI(API_KEY)
sa.debug_mode = True
# Used for debugging. When debug_mode is active, all responses from the server and class will be output to the console
print(sa.version())
# Returns the current version of the library
status = sa.getNumbersStatus(country=0, operator='tele2')
try:
print(status['vk_0']) # 274789
except:
print(status['message']) # Error text
result = sa.getTopCountriesByService('vk')
try:
print(result[0]['count']) # 2350
except:
print(result['message']) # Error text
balance = sa.getBalance() # {'balance': '100.00'}
try:
print(balance['balance']) # 100.00
except:
print(balance['message']) # Error text
balance = sa.getBalanceAndCashBack() # {'balance': '100.00'}
try:
print(balance['balance']) # 100.00
except:
print(balance['message']) # Error text
operators = sa.getOperators(country=0)
try:
print(operators['countryOperators']['0'])
except:
print(operators['error']) # Error status
activations = sa.getActiveActivations()
try:
print(activations['activeActivations'])
except:
print(activations['error']) # Error status
number = sa.getNumber(service='vk', operator='tele2', country=0, verification="true") # {'activation_id': 000000000, 'phone': 79999999999}
try:
print(number['phone']) # 79999999999
except:
print(number['message']) # Error text
number = sa.getNumberV2(service='vk', country=0)
try:
print(number['phoneNumber']) # 79999999999
except:
print(number['message']) # Error text
multinumber = sa.getMultiServiceNumber(service='fb,ig', operator='tele2', country=0) # [{'phone': '79999999999', 'activation': 000000000, 'service': 'fb'}, {'phone': '79999999999', 'activation': 000000001, 'service': 'ig'}]
try:
print(multinumber[0]['phone']) # 79999999999
except:
print(multinumber['message']) # Error text
status = sa.setStatus(id=000000000, status=1) # ACCESS_READY
try:
print(status) # ACCESS_READY
except:
print(status['message']) # Error text
status = sa.getStatus(id=000000000) # STATUS_WAIT_CODE
try:
print(sa.activationStatus(status)) # {'status': 'STATUS_WAIT_CODE', 'message': 'Ожидание смс'}
except:
print(status['message']) # Error text
status = sa.getIncomingCallStatus(id=000000000)
try:
print(status['status']) # 2
except:
print(status['message']) # Error text
prices = sa.getPrices(service='fb', country=0)
try:
print(prices['0']) # {'fb': {'cost': 9, 'count': 27934}}
except:
print(prices['message']) # Error text
countries = sa.getCountries()
try:
print(countries['0']['eng']) # Russia
except:
print(countries['message']) # Error text
service = sa.getAdditionalService(id=000000000, service='ig')
try:
print(service['phone']) # 79999999999
except:
print(service['message']) # Error text
service = sa.getRentServicesAndCountries(time=4, operator='tele2', country=0)
try:
print(service['services']['full']['cost']) # 100.00
except:
print(service['message']) # Error text
rent = sa.getRentNumber(service='ig', time=4, operator='tele2', country=0)
try:
print(rent['phone']['number']) # 79999999999
except:
print(rent['message']) # Error text
status = sa.getRentStatus(000000000)
try:
print(status['values']['0']['text']) # SMS
except:
print(status['message']) # Error text
status = sa.setRentStatus(id=000000000, status=1)
try:
print(status['status']) # success
except:
print(status['message']) # Error text
rent = sa.getRentList()
try:
print(rent['values']['0']['phone']) # 79999999999
except:
print(rent['message']) # Error text
rent = sa.continueRentNumber(id=000000000, time=4)
try:
print(rent['phone']['number']) # 79999999999
except:
print(rent['message']) # Error text
rent = sa.getContinueRentPriceNumber(000000000)
try:
print(status['price']) # 4.00
except:
print(status['message']) # Error text
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
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





















































