Dimar FZC LLC
Flamingo Villas A-32-01-05-03 25314 阿拉伯聯合大公國,阿治曼
+971585072431, /assets/img/icons/logo/logo.svg, [email protected]

SMS-Activate 的 API 協定

API 是您的軟體與我們的伺服器之間的通訊協定

API 用於自動化您端的簡訊、OTP 和 PVA 接收流程

我們的 API 完全相容於競爭對手的網站

所有請求必須發送至 https://api.sms-activate.ai/stubs/handler_api.php

POST 或 GET 請求。

所有請求必須包含以 api_key GET 參數形式提供的 API 金鑰

下載 PHP 版本的協定實作 下載 Python 版本的現成協定實作

驗證 API

查詢可用虛擬號碼數量
https://api.sms-activate.ai/stubs/handler_api.php?api_key=$api_key&action=getNumbersStatus&country=$country&operator=$operator

參數:

$api_key - API 金鑰

$country * - 國家代碼 請參閱表格

$operator * 行動營運商代碼,您可以指定多個以逗號分隔的代碼(僅適用於:

俄羅斯
megafon, mts, beeline, tele2, rostelecom, any
烏克蘭
kyivstar, life, utel, mts, vodafone
哈薩克
tele2、beeline、activ、altel

** 可用於 $country = 0, $country = 1, $country = 2

回應:

服務回應將以 JSON 格式呈現,範例:

{"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}
連字號前為服務名稱,後方的數字表示是否需要包含轉發功能。0 - 否。1 - 是。

完整服務列表

查詢各服務熱門國家 FreePrice
https://api.sms-activate.ai/stubs/handler_api.php?api_key=$api_key&action=getTopCountriesByService&service=$service&freePrice=$freePrice

參數:

$api_key - API 金鑰

$service * - 服務 請參閱表格

* 選填參數。若未指定,預設將顯示所有服務的熱門國家。

$freePrice * - 選填參數。若提供 true,數量與價格將依據 Free Price 顯示

回應:

服務回應將以 JSON 格式呈現,範例:

{ 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 } }, ... }
餘額查詢
https://api.sms-activate.ai/stubs/handler_api.php?api_key=$api_key&action=getBalance

含現金回饋帳戶的餘額查詢:

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

* 若在現金回饋帳戶設定中勾選「使用現金回饋進行啟用」,則回傳的餘額將包含累計的現金回饋

參數:

$api_key - API 金鑰

回應:

ACCESS_BALANCE:「帳戶餘額」

可能發生的錯誤:

BAD_KEY - API 金鑰無效

ERROR_SQL - SQL Server 錯誤

查詢可用營運商
https://api.sms-activate.ai/stubs/handler_api.php?api_key=$api_key&action=getOperators&country=$country

* 回傳指定國家可用的所有電信業者;若未指定國家,則回傳每個國家可用的所有電信業者

參數:

$api_key - API 金鑰

$country - 國家代碼

回應:

服務回應將採用 JSON 格式:

{"status":"success", "countryOperators": {
"Country1Code": ["operator1Name","operator2Name","operator3Name", ...],
"Country2Code": ["operator1Name","operator2Name","operator3Name", ...],
...
}}

範例:

{"status":"success", "countryOperators": {
"0": ["beeline","megafon","mts", ...],
"1": ["life","mts","kyivstar","utel" ...],
...
}}

* 在 'countryOperators' 中,鍵值為國家代碼

可能發生的錯誤:

BAD_KEY - API 金鑰無效

ERROR_SQL - SQL Server 錯誤

OPERATORS_NOT_FOUND - 找不到記錄(例如:指定的國家不存在)

查詢進行中的驗證
https://api.sms-activate.ai/stubs/handler_api.php?api_key=$api_key&action=getActiveActivations

參數:

$api_key - API 金鑰

回應:

服務回應將採用 JSON 格式:

{"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",
}]

可能發生的錯誤:

BAD_KEY - API 金鑰無效

ERROR_SQL - SQL Server 錯誤

NO_ACTIVATIONS - 找不到項目(無進行中的驗證)

索取號碼 FreePrice
https://api.sms-activate.ai/stubs/handler_api.php?api_key=$api_key&action=getNumber&service=$service&forward=$forward&operator=$operator&ref=$ref&country=$country&phoneException=$phoneException&maxPrice=maxPrice&useCashBack=$useCashBack&activationType=$activationType&language=$language&userId=$userId

參數:

$api_key - API 金鑰

$service - 訂購服務 請參閱表格

$forward * - 是否需要申請帶有轉發功能的號碼

* 選填參數,接受 0(不執行,預設值)、1(執行)

$maxPrice * - 您願意以自由價格購買號碼的最高價格

* 選填參數,若未指定,將以常規價格進行購買

$phoneException * - 排除俄羅斯號碼的前綴。請以逗號分隔輸入。記錄格式:國家代碼加上 3 至 6 位遮罩數字(例如:7918、7900111)。預設值為帳戶中設定的值。

$operator* 是號碼的行動電信業者,您可以使用逗號指定多個業者(僅適用於 **)

$activationType - 啟用類型:0 - 含簡訊(預設),1 - 含號碼,2 - 含語音

$language - 解析語言(語音啟用時必填) 請參閱表格

$userId * - 因啟用統計數據不佳而封鎖的使用者 ID,但經銷商自己的帳戶不受影響。

俄羅斯
megafon, mts, beeline, tele2, rostelecom, any
烏克蘭
kyivstar, life, utel, mts, vodafone
哈薩克
tele2、beeline、activ、altel

* 選填欄位

** 可用於 $country = 0, $country = 1, $country = 2

$ref - 傳遞推薦人 ID。

$country - 國家代碼 請參閱表格

$useCashBack* - 接受布林值,若參數為 'true',購買號碼將使用現金回饋餘額。當現金回饋餘額用盡後,後續所有購買將使用主餘額。請務必記住,後續所有購買將優先使用現金回饋,之後才使用主餘額(即使之後傳遞參數 'false' 亦然)。

* 選填參數,接受 'true'

透過 API 取得號碼即表示您同意 專案規則 專案規則

可能發生的錯誤:

WRONG_MAX_PRICE:$min- 指定的最高價格低於允許範圍

$min - 最低允許價格

BAD_ACTION - 無效的操作

BAD_SERVICE - 無效的服務名稱

BAD_KEY - API 金鑰無效

ERROR_SQL - SQL Server 錯誤

BANNED:'YYYY-m-d H-i-s' - 帳戶被封鎖的時間

WRONG_EXCEPTION_PHONE - 無效的排除前綴

NO_BALANCE_FORWARD - 餘額不足,無法購買來電轉接

CHANNELS_LIMIT - 帳戶已被封鎖

NO_NUMBERS - 無可用號碼

如果您嘗試取得特定電信業者的號碼,而該業者未在所選國家營運或不提供所選服務,系統將回傳第一個符合請求參數的業者號碼

V2 號碼請求 FreePrice
https://api.sms-activate.ai/stubs/handler_api.php?api_key=$api_key&action=getNumberV2&service=$service&forward=$forward&operator=$operator&ref=$ref&country=$country&phoneException=$phoneException&maxPrice=maxPrice&activationType=$activationType&language=$language&userId=$userId

此方法運作方式類似於方法 getNumber,接受相同的參數及下述額外參數,但會回傳額外的啟用資訊

參數:

$orderId- 來自經銷商系統的啟用 ID。購買時,此資料會與我們系統中的啟用 ID 和經銷商進行比對。藉此實現冪等性(相同訂單不會被重複處理)。

回應:

如果請求成功,回應將採用以下格式:

{
"activationId": 635468024,
"phoneNumber": "79584******",
"activationCost": "12.50",
"countryCode": "0",
"canGetAnotherSms": "1",
"activationTime": "2022-06-01 17:30:57",
"activationOperator": "mtt"
}

如果您嘗試取得特定電信業者的號碼,而該業者未在所選國家營運或不提供所選服務,系統將回傳第一個符合請求參數的業者號碼

可能發生的錯誤:

ORDER_ALREADY_EXISTS- 訂單已建立

Webhooks

當您收到發送至號碼的簡訊時,若您在設定中啟用了 Webhooks 功能,我們將透過 POST 請求,將簡訊資訊傳送至您指定的網址

回應:

回應格式如下:

{
"activationId": 635468024,
"service": "go",
"text": "Your sms text",
"code": "Your sms code",
"country": 0,
"receivedAt": "2022-06-01 17:30:57",
}

發送請求時,我們將等待您的腳本返回 HTTP 狀態碼 200。若您的腳本未回應,我們將在 2 小時內重試發送請求,但最多不超過 8 次。

您可以在以下位置啟用此功能: 個人資料設定

為多個服務訂購虛擬號碼
https://api.sms-activate.ai/stubs/handler_api.php?api_key=$api_key&action=getMultiServiceNumber&multiService=$service&multiForward=$forward&operator=$operator&ref=$ref&country=$country

參數:

$api_key - API 金鑰

$service - 訂購服務 請參閱表格

$forward * - 是否需要申請帶有轉發功能的號碼

* 選填參數,轉發字元以逗號分隔,轉發位數必須與參數中傳遞的服務數量相符 $service。僅允許傳遞一個含轉發設定的服務,例如「0,1,0,0」為正確,「0,1,1,0」為錯誤。取值為 0(不執行,預設值)或 1(執行)

$operator * - 號碼所屬的手機營運商,您可以指定多個以逗號分隔的號碼(僅適用於 **):

俄羅斯
megafon, mts, beeline, tele2, rostelecom, any
烏克蘭
kyivstar, life, utel, mts, vodafone
哈薩克
tele2、beeline、activ、altel

$ref - 傳遞推薦人 ID。

$country - 國家代碼 請參閱表格

透過 API 取得號碼即表示您同意 專案規則 專案規則

回應:

NO_NUMBERS - 無可用號碼

NO_BALANCE - 餘額不足

{{'phone':phone,'activation':activation,'service':service},
{'phone':phone,'activation':activation,'service':service}}
,其中(phone - 操作 ID,activation - 電話號碼,service - 服務)

可能發生的錯誤:

BAD_ACTION - 無效的操作

BAD_SERVICE - 無效的服務名稱

BAD_KEY - API 金鑰無效

ERROR_SQL - SQL Server 錯誤

BANNED:'YYYY-m-d H-i-s' - 帳戶被封鎖的時間

啟用狀態變更
https://api.sms-activate.ai/stubs/handler_api.php?api_key=$api_key&action=setStatus&status=$status&id=$id&forward=$forward

參數:

$api_key - API 金鑰

$id - 啟用 ID

$forward * - 您希望轉發至的電話號碼

* 僅在傳遞 getNumber forward=1 參數時才需要填寫。

$status - 啟用狀態

1 - 通知號碼已可用(簡訊已發送至該號碼)

3 - 請求再次發送驗證碼(免費)

6 - 完成啟用 *

8 - 回報號碼已被使用並取消啟用

* 若狀態為「已收到驗證碼」,則標記為成功並完成;若狀態為「準備中」,則刪除並標記為錯誤;若狀態為「等待重試」,則將啟用轉移至簡訊待處理狀態

** 若號碼已到達,則無法變更已選擇「語音通話」作為驗證方式的啟用狀態

API 使用流程的簡單邏輯:

使用 getNumber 方法取得號碼後,可執行以下操作:

8 - 取消啟用(若號碼不符合您的需求)

1 - 通知簡訊已發送(選填)

針對狀態為 1 的啟用:

8 - 取消啟用

收到驗證碼後立即執行:

3 - 請求再次發送簡訊

6 - 確認簡訊驗證碼並完成啟用

針對狀態為 3 的啟用:

6 - 確認簡訊驗證碼並完成啟用

回應:

ACCESS_READY - 號碼就緒已確認

ACCESS_RETRY_GET - 等待新的簡訊

ACCESS_ACTIVATION - 服務已成功啟用

ACCESS_CANCEL - 已取消啟用

可能發生的錯誤:

EARLY_CANCEL_DENIED - 不允許在前 2 分鐘內取消號碼

ERROR_SQL - SQL Server 錯誤

NO_ACTIVATION - 啟用 ID 不存在

BAD_SERVICE - 無效的服務名稱

BAD_STATUS - 狀態不正確

BAD_KEY - API 金鑰無效

BAD_ACTION - 無效的操作

WRONG_ACTIVATION_ID - 無效的 ID 或 ID 非數字。

取得啟用狀態
https://api.sms-activate.ai/stubs/handler_api.php?api_key=$api_key&action=getStatus&id=$id

參數:

$api_key - API 金鑰

$id - 啟用 ID

回應:

STATUS_WAIT_CODE - 等待簡訊

STATUS_WAIT_RETRY: '過去、未匹配的代碼' - 等待代碼確認

STATUS_WAIT_RESEND - 等待重新發送簡訊 *

* 軟體必須按下重新發送簡訊並將狀態更改為 6

STATUS_CANCEL - 已取消啟用

STATUS_OK: '啟用代碼' - 已收到代碼

可能發生的錯誤:

NO_ACTIVATION - 啟用 ID 不存在

ERROR_SQL - SQL Server 錯誤

BAD_KEY - API 金鑰無效

BAD_ACTION - 無效的操作

取得啟用狀態(版本 2)
https://api.sms-activate.ai/stubs/handler_api.php?api_key=$api_key&action=getStatusV2&id=$id

參數:

$api_key - API 金鑰

$id - 啟用 ID

回應:

回應格式如下:

{
"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 - 已取消啟用

可能發生的錯誤:

NO_ACTIVATION - 啟用 ID 不存在

ERROR_SQL - SQL Server 錯誤

BAD_KEY - API 金鑰無效

BAD_ACTION - 無效的操作

取得啟用歷史記錄
https://api.sms-activate.ai/stubs/handler_api.php?api_key=$api_key&action=getHistory&start=$start&end=$end&offset=$offset&limit=$limit

參數:

$api_key - API 金鑰

$start - Unix 時間戳格式的時間戳(可選)- 從哪個日期開始計算啟用

$end - Unix 時間戳格式的時間戳(可選)- 計算啟用到哪個日期為止

$offset - 回應中返回的第一個元素的偏移量。預設為 0

$limit - 返回記錄的最大數量。最大值為 100。預設為 50。

回應:

回應格式如下:

[{
"id": 635468024,
"date": "2022-11-12 15:58:39",
"phone": "79918529716",
"sms": "sms":"["Your sms code"]",
"cost": 100 //Если активация не завершена, то cost = 0,
"status": "4",
}]

可能發生的錯誤:

ERROR_SQL - SQL Server 錯誤

BAD_KEY - API 金鑰無效

BAD_ACTION - 無效的操作

取得某服務的前 10 大國家
https://api.sms-activate.ai/stubs/handler_api.php?api_key=$api_key&action=getListOfTopCountriesByService&service=$service

參數:

$api_key - API 金鑰

$service - 服務名稱

回應:

回應格式如下:

[{
"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)
}]

可能發生的錯誤:

ERROR_SQL - SQL Server 錯誤

BAD_KEY - API 金鑰無效

WRONG_SERVICE - 服務不正確

BAD_ACTION - 無效的操作

取得來電狀態
https://api.sms-activate.ai/stubs/handler_api.php?api_key=$api_key&action=getIncomingCallStatus&activationId=$id

參數:

$api_key - API 金鑰

$id - 啟用 ID

回應:

服務回應將以 JSON 格式呈現,範例:

{"status":"2","phone":false}

可能的狀態:

2 - 新啟用

3 - 成功完成

4 - 已取消

5 - 已退回

可能發生的錯誤:

BAD_KEY - API 金鑰無效

無效的啟用 ID - 無效的啟用 ID

按國家取得當前價格
https://api.sms-activate.ai/stubs/handler_api.php?api_key=$api_key&action=getPrices&service=$service&country=$country

參數:

$api_key - API 金鑰

$service服務簡稱(可選,預設為所有服務) 請參閱表格

$country國家代碼名稱(可選,預設為所有國家) 請參閱表格

回應:

JSON - 物件格式
{"Country":{"Service":{"cost":Cost,"count":Count}}}

取得驗證服務的即時價格
https://api.sms-activate.ai/stubs/handler_api.php?api_key=$api_key&action=getPricesVerification&service=$service

參數:

$api_key - API 金鑰

$service服務簡稱(可選,預設為所有服務) 請參閱表格

回應:

JSON - 物件格式
{"Service":{"Country":{"count":Quantity,"price":"Price"}}}

取得所有國家列表
https://api.sms-activate.ai/stubs/handler_api.php?api_key=$api_key&action=getCountries

參數:

$api_key - API 金鑰

回應:

JSON - 物件格式 {{'Страна':{'id':0,'rus':"Россия","eng:"Russia","chn":"俄罗斯","visible":1,"retry":1,"rent":1,"multiService":1}},

其中(

id :國家 ID;

rus :俄文國家名稱;

eng :英文國家名稱;

chn :中文國家名稱;

visible :0 - 該國家不在網站上顯示,1 - 顯示;

retry :0 - 不支援重複發送簡訊,1 - 支援;

rent :0 - 該國家不可租賃,1 - 可租賃;

multiService :0 - 該國家不支援多服務,1 - 支援。)

取得所有服務列表
https://api.sms-activate.ai/stubs/handler_api.php?api_key=$api_key&action=getServicesList

參數:

$api_key- API 金鑰

$country *- 國家 ID。若您已指定國家,我們將回傳該國家有定價的服務

$lang *- 用於提供 `name` 的語言。可能的值:'ru'、'en'、'es'、'cn'。預設為 'en'

* 選用參數

回應:

JSON - 物件格式 { "status": "success", "services": [ { "code": "aoo", "name": "Pegasus Airlines" } ] }

轉發號碼的附加服務

在收到轉發號碼的第一則簡訊後,您可以購買其他相關服務,例如 Yula、Yandex、Avito 或其他任何服務

額外服務的費用僅需 5p

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

參數:

$api_key - API 金鑰

$service - 關於服務簡稱,請參閱表格 請參閱表格

$id - 父級啟用 ID

回應:

ADDITIONAL:$id:$phone - 已成功建立新的啟用。其中 ID 為額外啟用的 ID,phone 為電話號碼

可能發生的錯誤:

WRONG_ADDITIONAL_SERVICE - 無效的額外服務(僅允許轉發服務)

WRONG_ACTIVATION_ID - 不正確的父級啟用 ID

WRONG_SECURITY - 嘗試傳輸未重定向的啟用 ID,或已完成的/非活躍的啟用時發生錯誤

REPEAT_ADDITIONAL_SERVICE - 嘗試再次訂購已購買的服務時發生錯誤 NO_BALANCE - 餘額不足

ERROR_SQL- 資料庫錯誤,請聯絡客戶服務

虛擬號碼重新啟用

如果您已在該號碼上成功啟用,則可以再次進行啟用。

額外啟用的費用取決於國家和服務。具體費用可從以下位置獲取:

https://api.sms-activate.ai/stubs/handler_api.php?api_key=$api_key&action=getExtraActivation&activationId=$activationId

參數:

$api_key - API 金鑰

$activationId - 父級啟用 ID

回應:

ACCESS_NUMBER:$id:$phone - 已成功建立新的啟用。其中 $id 為額外啟用的 ID,$phone 為電話號碼

可能發生的錯誤:

RENEW_ACTIVATION_NOT_AVAILABLE- 該號碼無法進行額外啟用

WRONG_ACTIVATION_ID - 不正確的父級啟用 ID

ERROR_SQL- 資料庫錯誤,請聯絡客戶服務

NEW_ACTIVATION_IMPOSSIBLE- 無法進行額外啟用

NO_BALANCE - 帳戶餘額不足

獲取額外號碼啟用的價格

您可以查詢號碼是否可用於額外啟用並獲取其費用

https://api.sms-activate.ai/stubs/handler_api.php?api_key=$api_key&action=checkExtraActivation&activationId=$activationId

參數:

$api_key - API 金鑰

$activationId - 父級啟用 ID

回應:

JSON - 物件格式 {'status': 'success', 'cost':200,"service":"tw","phone":777777777,"country":14},

可能發生的錯誤:

RENEW_ACTIVATION_NOT_AVAILABLE- 該號碼無法進行額外啟用

WRONG_ACTIVATION_ID - 不正確的父級啟用 ID

SIM_OFFLINE - SIM 卡離線

重複語音解析
https://api.sms-activate.ai/stubs/handler_api.php?api_key=$api_key&action=parseCall&id=$id&newLang=$newLang

參數:

$api_keyapi key

$id - 啟用 ID

$newLang - 新的解析語言 請參閱表格

回應:

回應格式如下:

{
"result": "OK"
}

STATUS_CANCEL - 已取消啟用

NO_CALL- 未收到來電

PARSE_COUNT_EXCEED- 解析次數已達上限(最多 4 次)

可能發生的錯誤:

WRONG_ACTIVATION_ID - ID 無效,該啟用項目不存在

ERROR_SQL - SQL Server 錯誤

BAD_KEY - API 金鑰無效

BAD_ACTION - 無效的操作

租用 API

查詢可用的國家與服務
https://api.sms-activate.ai/stubs/handler_api.php?api_key=$api_key&action=getRentServicesAndCountries&rent_time=$time&operator=$operator&country=$country&incomingCall=$incomingCall

參數:

$api_key - API 金鑰

$time* - 租用時長(預設:4 小時)

$operator* - 號碼所屬的手機營運商,可指定多個並以逗號分隔(預設:任意)

$country* - 國家(預設:俄羅斯)

$incomingCall * - 若已轉接 "true"取得支援接收來電功能的號碼

回應:

服務回應將以 JSON 格式呈現,範例:

{ "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 } } }

可能發生的錯誤:

BAD_KEY - API 金鑰無效

OUT_OF_STOCK - 該國家的號碼暫不可用

訂購虛擬號碼租用
https://api.sms-activate.ai/stubs/handler_api.php?api_key=$api_key&action=getRentNumber&service=$service&rent_time=$time&operator=$operator&country=$country&url=$url&incomingCall=$incomingCall

參數:

$api_key - API 金鑰

$service - 您需要取得號碼的服務項目

$time* - 租用時長(單位:小時,預設:4 小時)。下一個可用的時段為 12 小時,接著是 24 小時。當請求租用一天或更長時間時,必須傳入:24、48、72 等數值。

$operator* - 號碼所屬的手機營運商,可指定多個並以逗號分隔(預設:任意)

$country* - 國家(預設:俄羅斯)

$url * - Webhook 連結(預設不納入考量)

$incomingCall * - 若已轉接 "true"取得支援接收來電功能的號碼

什麼是 Webhook?

* 選填參數。若未指定,將使用預設參數。

回應:

服務回應將以 JSON 格式呈現,範例:

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

可能發生的錯誤:

BAD_KEY - API 金鑰無效

以 JSON 格式回應:

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


欄位中可能的回應值 "message":

BAD_SERVICE - 未指定服務或名稱不正確

NO_BALANCE - 帳戶餘額不足

NO_NUMBERS - 無可用號碼

ACCOUNT_INACTIVE - 無可用號碼

SERVER_ERROR - 伺服器錯誤

CHANNELS_LIMIT - 帳戶已被封鎖

取得租用狀態
https://api.sms-activate.ai/stubs/handler_api.php?api_key=$api_key&action=getRentStatus&id=$id&page=$page&size=$size

參數:

$api_key - API 金鑰

$id - 訂購號碼時回覆中取得的租用 ID

$page* - 開始篩選的頁碼(頁碼從 0 開始編號,由新到舊;預設為 0)

$size* - 每頁數量(預設 10)

* 選填參數。若未指定,將使用預設參數。

回應:

服務回應將以 JSON 格式呈現,範例:

{ "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" } } }

* 僅在有簡訊時成功('quantity' 方塊 > 0)。

可能發生的錯誤:

BAD_KEY - API 金鑰無效

以 JSON 格式回應:

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

欄位中可能的回應值 "message":

NO_ID_RENT - 未指定租用 ID

INVALID_PHONE - 號碼並非由您租用(無效的租用 ID)

STATUS_FINISH - 租用已付款並完成

STATUS_CANCEL - 租用已取消並退款

STATUS_WAIT_CODE - 等待第一則簡訊

STATUS_REVOKE - 號碼已被封鎖,您的資金已退回

租用狀態變更
https://api.sms-activate.ai/stubs/handler_api.php?api_key=$api_key&action=setRentStatus&id=$id&status=$status

參數:

$api_key - API 金鑰

$id - 訂購號碼時回覆中取得的租用 ID

$status - 變更狀態代碼(號碼)

狀態可以是:

1
完成
2
取消

回應:

服務回應將採用 JSON 格式:

{ "status": "success" }

可能發生的錯誤:

BAD_KEY - API 金鑰無效

以 JSON 格式回應:

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

欄位中可能的回應值 "message":

NO_ID_RENT - 未指定租用 ID

INCORECT_STATUS - 狀態缺失或指定錯誤

CANT_CANCEL - 無法取消租用(超過 20 分鐘)

INVALID_PHONE - 號碼並非由您租用(無效的租用 ID)

ALREADY_FINISH - 租用已完成

ALREADY_CANCEL - 租用已取消

SERVER_ERROR - 伺服器錯誤

列出當前啟用項目
https://api.sms-activate.ai/stubs/handler_api.php?api_key=$api_key&action=getRentList

👉注意!此方法僅顯示最後 10 個號碼。若您需要更多號碼,請使用 getRentStatus 方法來檢查狀態。

參數:

$api_key - API 金鑰

回應:

服務回應將採用 JSON 格式:

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

可能發生的錯誤:

BAD_KEY - API 金鑰無效

BAD_ACTION - 無效的操作


以 JSON 格式回應:

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


欄位中可能的回應值 "message":

NO_NUMBERS - 沒有租用的號碼

SERVER_ERROR - 伺服器錯誤

延長租期
https://api.sms-activate.ai/stubs/handler_api.php?api_key=$api_key&action=continueRentNumber&id=$id&rent_time=$time

參數:

$api_key - API 金鑰

$id - 租用 ID

$rent_time- 租用時間(預設:4 小時)

回應:

服務回應將採用 JSON 格式:

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

當已完成的租用被延長時,將重新下單並提供新的 ID

可能發生的錯誤:

BAD_KEY - API 金鑰無效

BAD_ACTION - 無效的操作

SERVER_ERROR - 伺服器錯誤


以 JSON 格式回應:

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


欄位中可能的回應值 "message":

NO_ID_RENT - 缺少租用 ID

INVALID_TIME - 時間錯誤。可用小時數範圍為 4 至 1344

MAX_HOURS_EXCEED - 超過最大可用時間

資訊:

最大值 - 最大可用時間

INVALID_PHONE - 無效的租用 ID

RENT_DIE - 無法延長租用,因為號碼已過期

NO_BALANCE - 餘額不足

CHANNELS_LIMIT - 帳戶已被封鎖

取得續租費用
https://api.sms-activate.ai/stubs/handler_api.php?api_key=$api_key&action=getContinueRentPriceNumber&id=$id&rent_time=$time

* 此方法僅適用於 MTT 營運商的租用服務。

參數:

$api_key - API 金鑰

$id - 租用 ID

$rent_time - 租用時長

回應:

服務回應將採用 JSON 格式:

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

可能發生的錯誤:

BAD_KEY - API 金鑰無效

BAD_ACTION - 無效的操作

SERVER_ERROR - 伺服器錯誤


以 JSON 格式回應:

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


欄位中可能的回應值 "message":

NO_ID_RENT - 缺少租用 ID

INVALID_PHONE - 無效的租用 ID

INVALID_TIME - 時間設定不正確

RENT_DIE - 無法延長租用,因為號碼已過期

MAX_HOURS_EXCEED - 超過最大可用時間

資訊:

最大值 - 最大可用時間

CHANNELS_LIMIT - 帳戶已被封鎖

API JAVA

開始使用

在 Maven 中包含程式庫

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

您可以透過以下連結查看註冊範例 MavenRepository 連結

匯入主要類別以與 SMS-Activate API 互動。

import ru.sms_activate.SMSActivateApi

使用此程式庫需要 API 金鑰,您可以在本頁面及下方連結取得。

SMS-Activate API 金鑰
餘額操作範例

若要取得帳戶目前的餘額,請使用以下方法 getBalance... 如果您除了餘額外還想查詢現金回饋,請呼叫以下方法 getBalanceAndCashBack.

方式 getBalanceAndCashBack 回傳類別物件SMSActivateGetBalanceAndCashBack.

getBalance:取得目前帳戶餘額

參數:

NONE

回傳類型:

BigDecimal

getBalanceAndCashBack:取得餘額與現金回饋金額作為總餘額

參數:

NONE

getNumber:取得啟用號碼

參數:

countryId(Integer) - 國家代碼。

service(String) - 服務的簡稱。

forward*(boolean) - 是否請求具備來電轉接功能的號碼。

operatorSet*(集合) - 營運商集合。

phoneException*(集合) - 僅排除俄羅斯的前綴,號碼長度為 3 至 6 位(例如 7918、7900111)。

* 可選欄位。若未指定,將根據個人資料中的設定提供預設數量。

回傳類型:

SMSActivateActivation

getNumberStatus:取得可用服務資訊

參數:

countryId(Integer) - 國家代碼。

operatorSet*(集合) - 該服務可用的營運商集合

回傳類型:

SMSActivateGetNumbersStatus

getAdditionalService:回傳呼叫轉接號碼的附加服務。

參數:

id(整數) - 啟用識別碼

service(String) - 服務的簡稱。

您可以傳遞接收到的類別物件,以取代啟用識別碼 SMSActivateActivation 使用此方法後 getNumber 或使用後的其中一個啟用項目 getMultiServiceNumber.

回傳類型:

SMSActivateGetNumbersStatus

getMultiServiceNumber:取得多項服務的啟用

參數:

countryId(Integer) - 國家代碼。

serviceMap(集合) - 已購買啟用的服務集合

multiForwardList(列表) - 支援呼叫轉接的服務列表

operatorSet(集合) - 營運商集合。

getAllPrices:取得完整的啟用價格列表

參數:

NONE

回傳類型:

SMSActivateGetPriceInfo

getPricesByCountryIdAndServiceShortName:依國家和服務取得啟用價格列表

參數:

countryId(Integer) - 國家代碼。

service(String) - 服務的簡稱。

回傳類型:

SMSActivateGetPriceInfo

getPricesAllServicesByCountryId:依國家取得所有服務的啟用價格列表

參數:

countryId(Integer) - 國家代碼。

回傳類型:

SMSActivateGetPriceInfo

getStatus:取得啟用狀態

參數:

activationId(整數) - 啟用識別碼

您可以傳遞接收到的類別物件,以取代啟用識別碼 SMSActivateActivation 使用此方法後 getNumber 或使用後的其中一個啟用項目 getMultiServiceNumber.

setStatus:設定啟用狀態

參數:

id(整數) - 啟用識別碼

status(SMSActivateClientStatus) - 要為啟用設定的狀態

您可以傳遞接收到的類別物件,以取代啟用識別碼 SMSActivateActivation 使用此方法後 getNumber 或使用後的其中一個啟用項目 getMultiServiceNumber.

getCountries:取得國家資訊

參數:

NONE

getFullSms:取得該號碼的完整簡訊內容

參數:

activationId(整數) - 啟用識別碼

您可以傳遞接收到的類別物件,以取代啟用識別碼 SMSActivateActivation 使用此方法後 getNumber 或使用後的其中一個啟用項目 getMultiServiceNumber.

透過啟用接收完整簡訊內容的演算法

使用 getNumber 方法取得號碼後,可執行以下操作:

CANCEL - 8 - 取消啟用(如果號碼不符合您的需求)

MESSAGE_WAS_SENT - 通知簡訊已發送(必須設定此狀態才能接收簡訊完整內容)

在強制設定 MESSAGE_WAS_SENT 狀態後,請使用 waitSMS 方法並搭配啟用參數及等待時間來設定變數,以接收簡訊。

收到簡訊後,您可以使用 getFullSMS 方法獲取簡訊,接著透過 getText() 方法顯示完整文字內容。

隨後,您可以將啟用狀態設定為以下幾種:

若要將狀態設定為 MESSAGE_WAS_SENT 進行啟用:

CANCEL - 取消啟用

收到驗證碼後立即執行:

REQUEST_ONE_MORE_CODE - 要求發送另一則簡訊

FINISH - 確認簡訊驗證碼並完成啟用

若要將狀態設定為 REQUEST_ONE_MORE_CODE 進行啟用:

FINISH - 確認簡訊驗證碼並完成啟用

getRentNumber:取得具備租賃選項的號碼

參數:

countryId(Integer) - 國家代碼。

service(String) - 服務的簡稱。

hours(Integer)* - 租賃時長

operator(String)* - 電信業者名稱

urlWebhook(String)* - Webhook 連結(預設不處理)

什麼是 Webhook?

* 選填參數。若未指定,將採用預設值

回傳類型:

SMSActivateRentActivation

GetRentServicesAndCountriesRun:取得可租賃的服務與國家

參數:

countryId(Integer) - 國家代碼。

operatorSet(集合) - 電信業者組合

hours(Integer)* - 租賃時長

* 選填參數。若未指定,將採用預設值

GetRentStatusJava:取得租賃狀態

參數:

rentId(Integer) - 租賃號碼識別碼

除了 rentId,您也可以傳入產生的類別物件 SMSActivateRentActivation 使用此方法後 getRentNumber

回傳類型:

SMSActivateRentStatus

Email API

API 狀態說明

3 - 等待中

4 - 已取消

5 - 成功

Mail API 版本 2

DESCRIPTION:

更嚴格地遵循 REST API 原則,並增加用於註冊 Telegram 帳號的 gmail.com 信箱數量。

取得優惠列表
https://api.sms-activate.ai/stubs/handler_api.php?action=getDomains&api_key=$api_key&site=$site

參數:

$api_key - API 金鑰

$site- 您需要電子郵件對應的網站

回應:

服務回應將以 JSON 格式呈現,範例:

{
                        "status":"OK",
                        "response":{
                            "zones":[
                                {
                                "name":"info",
                                "cost":2.5
                                },
                                ...
                            ],
                            "popular":[
                                {
                                "name":"mail.ru",
                                "cost":6,
                                "count":159008
                                },
                                ...
                            ]
                        }
                        }

可能發生的錯誤:

BAD_SITE- 未指定網站

BAD_KEY - API 金鑰無效

BAD_ACTION - 無效的操作

透過郵件購買驗證
https://api.sms-activate.ai/stubs/handler_api.php?api_key=$api_key&action=buyMailActivation&site=$site&mail_type=$mail_type&mail_domain=$mail_domain

參數:

$api_key - API 金鑰

$site - 您需要電子郵件對應的網站

$mail_type - 郵件類型:熱門網域或區域(1 - 區域 2 - 熱門)

$mail_domain - 已選擇的區域或網域

回應:

服務回應將以 JSON 格式呈現,範例:

{
                        "status":"OK",
                        "response":{"email":"[email protected]","id":241}
                        }

可能發生的錯誤:

BAD_KEY - API 金鑰無效

BAD_ACTION - 無效的操作

MAIL_TYPE_ERROR - 指定網站不存在此網域

CHANNELS_LIMIT - 帳戶已被封鎖

郵件重新啟用
https://api.sms-activate.ai/stubs/handler_api.php?api_key=$api_key&action=reorderMailActivation&id=$id

參數:

$api_key - API 金鑰

$id- 需要重新啟用的郵件 ID

回應:

服務回應將以 JSON 格式呈現,範例:

{
                            "status": "OK",
                        "response": {
                            "email": "[email protected]",
                            "id": 360
                            }
                        }

可能發生的錯誤:

BAD_KEY - API 金鑰無效

BAD_ACTION - 無效的操作

BLOCKED_SITE - 被封鎖的網站

BAD_BALANCE - 餘額不足

ACTIVATION_NOT_FOUND - 找不到該啟用記錄

CHANNELS_LIMIT - 帳戶已被封鎖

取得活躍購買清單
https://api.sms-activate.ai/stubs/handler_api.php?api_key=$api_key&action=getMailHistory&page=$page&per_page=$per_page&search=$search&sort=$sort

參數:

$api_key - API 金鑰

$page- 頁碼

$per_page- 每頁顯示的購買數量

$search- 搜尋欄

$sort- 排序方向(desc、asc)

回應:

服務回應將以 JSON 格式呈現,範例:

{
                        "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
                        }
                        }
取消郵件購買
https://api.sms-activate.ai/stubs/handler_api.php?api_key=$api_key&action=cancelMailActivation&id=$id

參數:

$api_key - API 金鑰

$id- 購買 ID

回應:

服務回應將以 JSON 格式呈現,範例:

{
                        "status":"OK",
                        "response":true
                        }

可能發生的錯誤:

EARLY_CANCEL_DENIED - 前 2 分鐘內無法取消郵件。

檢查電子郵件是否已收到
https://api.sms-activate.ai/stubs/handler_api.php?api_key=$api_key&action=checkMailActivation&id=$id

參數:

$api_key - API 金鑰

$id- 已購買電子郵件的 ID,於購買電子郵件後返回

回應:

服務回應將以 JSON 格式呈現,範例:

{
                        "status":"OK",
                        "response":{
                            "value":"Содержания письма"
                        }
                        }

API 合作夥伴軟體

購買合作夥伴軟體
https://api.sms-activate.ai/stubs/handler_api.php?action=buyPartnerProduct&productId=$id&api_key=$api_key

參數:

$api_key - API 金鑰

$id- 您需要購買的軟體 ID

回應:

服務回應將以 JSON 格式呈現,範例:

{                            
                            "status": "success",
                            "key": "F5qrzFoY6afj3zrEq7SeMplbx",
                            "manual": "Software download link:"                            
                        }

可能發生的錯誤:

BAD_DATA - ID 不正確或 ID 非數字

BAD_ACTION - 無效操作或經銷商未通過驗證。

                        <?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 smsactivate.cc 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

{{ texts.verificationVoiceTextFirst }}

{{ texts.verificationVoiceTextSecond }}

{{ texts.verificationVoiceTextThird }}

網站克隆工具