sms.tcで電話番号の購入とSMS認証を自動化できます。最新のREST APIと、そのまま置き換え可能なSMS-Activate互換エンドポイントの2種類をご用意しています。既存のSMS-Activate対応ソフトウェアは、コードを変更せずにsms.tcへ接続先を切り替えるだけで利用できます。
sms.tcは複数のプロバイダーを束ねるアグリゲーターです。1つのAPIで複数の上流プロバイダーの電話番号を当社の価格で利用できます。お使いの環境に合ったインターフェースをお選びください。
HTTP経由のJSON。新規の連携におすすめです。
https://sms.tc/api/v1SMS-Activateクライアントと互換性のあるプレーンテキストプロトコルです。
https://sms.tc/stubs/handler_api.phpすべてのリクエストにAPIキーを含める必要があります。REST APIはヘッダーから、SMS-Activateエンドポイントはクエリパラメーター api_key からキーを読み取ります。
REST
Authorization: Bearer smstc_live_xxxX-Api-Key: smstc_live_xxxSMS-Activate
?api_key=smstc_live_xxx標準コード
国はSMS-Activateの数値ID(0=ロシア、1=ウクライナ…)、サービスは短縮コード(tg、wa、ig…)で指定します。catalog / getCountries / getServicesList エンドポイントで確認できます。
通貨
すべての価格と残高はUSD(ISO 840)で表示されます。
残高
購入代金はsms.tcの残高から差し引かれます。失敗またはタイムアウトしたアクティベーションは自動的に返金されます。
SMS受信成功率(rate)
商品のレスポンスには rate が含まれる場合があります。これは当社で確定したアクティベーションのうちSMSを受信できた割合(%、または null)です。プロバイダー+サービス+国の組み合わせごとに算出され、確定済みアクティベーションが10件以上ある場合のみ表示され、1日1回更新されます。プロバイダー別の内訳は /activations/offers/providers をご利用ください。
ベースURLは https://sms.tc/api/v1 です。Bearer / X-Api-Key ヘッダーで認証します。レスポンスはJSON形式です。
/activations/offersList available numbers (service → country → price/count/rate)./activations/offers/providersPer-provider offers (provider, operator, price, stock, SMS success rate). Requires service + country./activationsBuy a number. Body: { service, country, operator? }./activations/{id}Get activation status + received SMS code./emailsList email activations./emailsBuy an email activation. Body: { site, domain }./emails/batchBuy email activations in bulk (count 1–10)./emails/{id}Check an email activation./emails/{id}Cancel an email activation./emails/{id}/reorderReorder an email activation./emails/domainsList available email domains./catalog/countriesCanonical country list (SMS-Activate ids)./catalog/servicesCanonical service list (short codes)./catalog/pricesPrices by country/service, incl. SMS success rate (rate)./rent/offersRentable services for a country + duration./rentRent a number. Body: { service, country, duration }./rent/{id}Get a rent order + its SMS./rent/{id}/prolongExtend a rent. Body: { duration }.# 1) 利用可能な番号を一覧表示
curl https://sms.tc/api/v1/activations/offers \
-H "Authorization: Bearer smstc_live_xxx"
# 2) 番号を購入(Telegram、国 6)
curl -X POST https://sms.tc/api/v1/activations \
-H "Authorization: Bearer smstc_live_xxx" \
-H "Content-Type: application/json" \
-d '{"service":"tg","country":6}'
# 3) コードを確認
curl https://sms.tc/api/v1/activations/123456 \
-H "X-Api-Key: smstc_live_xxx"/stubs/handler_api.php という単一のエンドポイントで、クエリパラメーター action によって処理が振り分けられます。SMS-Activateプロトコルを再現しているため、既存のパートナーソフトウェアをそのまま利用できます。レスポンスはプレーンテキスト(V2 / list 系アクションはJSON)です。
| action | 戻り値 |
|---|---|
| getBalance | ACCESS_BALANCE:12.50 |
| getNumber | ACCESS_NUMBER:<id>:<phone> |
| getNumberV2 | JSON (activationId, phoneNumber, …) |
| getStatus | STATUS_WAIT_CODE · STATUS_OK:<code> |
| getStatusV2 | JSON (sms, call, …) |
| setStatus | ACCESS_READY · ACCESS_RETRY_GET · ACCESS_ACTIVATION · ACCESS_CANCEL |
| getActiveActivations | JSON (active list) |
| getHistory | JSON (history) |
| getPrices | JSON (prices by country/service) |
| getCountries | JSON (countries) |
| getServicesList | JSON (services) |
| getOperators | JSON (operators) |
| getAllSms | JSON (all SMS for an activation) |
| finishActivation | 204 |
| cancelActivation | 204 |
| reactivate / reactivateOptions | JSON · provider-dependent |
| getRentNumber / getRentServicesAndCountries / serviceCountRent | JSON · provider-dependent |
| prolong / prolongOptions / prolongHistory | JSON · rent only |
setStatus
# 番号を取得
GET https://sms.tc/stubs/handler_api.php?api_key=smstc_live_xxx&action=getNumber&service=tg&country=6
→ ACCESS_NUMBER:123456:628712345678
# ステータス / コードを確認
GET https://sms.tc/stubs/handler_api.php?api_key=smstc_live_xxx&action=getStatus&id=123456
→ STATUS_OK:12345
# 完了(6)またはキャンセル(8)
GET https://sms.tc/stubs/handler_api.php?api_key=smstc_live_xxx&action=setStatus&id=123456&status=8
→ ACCESS_CANCELSMS-Activateエンドポイントはプレーンテキストのトークン(HTTP 200)を返します。REST APIはHTTPステータスとエラーコードを含むJSONを返します。
NO_KEYAPIキーがありません。BAD_KEYAPIキーが無効、期限切れ、またはご利用のIPでは許可されていません。BAD_ACTION不明な action パラメーターです。BAD_SERVICE不明なサービスコードです。NO_NUMBERSこのサービス/国で利用できる番号はありません。NO_BALANCE残高が不足しています。WRONG_ACTIVATION_IDアクティベーションIDがないか、形式が正しくありません。NO_ACTIVATIONお客様のアカウントにこのアクティベーションは見つかりません。BAD_STATUSsetStatus の値が無効です。EARLY_CANCEL_DENIEDまだキャンセルできません(最低保持時間が経過していません)。ACTION_NOT_AVAILABLE選択したプロバイダーではこの操作は利用できません。機械可読な完全版の仕様書と導入ガイドは以下からご覧いただけます。