API dokümantasyonu

iLoveSMS REST API veya SMS-Activate uyumlu protokol ile numara alımlarını otomatikleştirin.

Kişisel API anahtarınız hesap ayarlarınızda. Kayıt ol

REST JSON API v1

Taban adres: https://ilovesms.com.tr/api/v1/ — Kimlik doğrulama: ?api_key=… / Authorization: Bearer …

MethodParametrelerAçıklama
GET services—En düşük fiyat ve stokla servis listesi.
GET countries—Ülke listesi.
GET pricesserviceBir servis için ülke bazında fiyat ve stok.
GET balanceapi_keyBakiyeniz.
POST buyapi_key, service, country_idNumara satın alır; ücret bakiyeden düşülür.
GET statusapi_key, idSipariş durumu ve SMS kodu.
POST cancelapi_key, idBekleyen siparişi iptal eder ve iade eder.
POST finishapi_key, idKod geldikten sonra numarayı kapatır.
GET ordersapi_keySon 100 siparişiniz.
# 1) Numara satın al
curl -X POST "https://ilovesms.com.tr/api/v1/buy" -d "api_key=YOUR_API_KEY" -d "service=tg" -d "country_id=12"

{"ok":true,"order":{"id":1042,"service":"Telegram","country":"USA","number":"12025550123",
 "price":0.45,"status":"waiting","code":null,"seconds_left":1200}}

# 2) Kod gelene kadar 5 saniyede bir sorgulayın
curl "https://ilovesms.com.tr/api/v1/status?api_key=YOUR_API_KEY&id=1042"

{"ok":true,"order":{"id":1042,"status":"received","code":"48213", ...}}

Hata kodları: bad_key, bad_service, insufficient, no_numbers, not_cancelable, cancel_later

Webhooks

Sürekli sorgulamak yerine bize bir adres verin; kod gelince veya kullanılmayan sipariş iade edilince oraya JSON olay gönderelim.

POST https://your-server.example/sms-webhook
Content-Type: application/json
X-Event: sms.received          (sms.received | order.refunded | test)
X-Signature: sha256=<hmac_sha256(body, API_KEY)>

{"event":"sms.received","order":{"id":1042,"service":"Telegram","number":"12025550123","status":"received","code":"48213", ...},"sent_at":"2026-10-30T12:00:00+00:00"}

# PHP
$ok = hash_equals('sha256=' . hash_hmac('sha256', file_get_contents('php://input'), API_KEY), $_SERVER['HTTP_X_SIGNATURE']);

5 saniye içinde HTTP 2xx ile yanıt verin. Webhook adresinizi şuradan ayarlayın: Hesap ayarları

SMS-Activate uyumlu uç nokta

SMS-Activate protokolüyle yazılmış yazılımlar değişiklik yapmadan çalışır: sadece taban adresi ve API anahtarını değiştirin.

https://ilovesms.com.tr/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getBalance        → ACCESS_BALANCE:12.40
...&action=getNumber&service=tg&country=12                    → ACCESS_NUMBER:1042:12025550123
...&action=getStatus&id=1042                                   → STATUS_WAIT_CODE | STATUS_OK:48213
...&action=setStatus&id=1042&status=8                          → ACCESS_CANCEL
...&action=setStatus&id=1042&status=6                          → ACCESS_ACTIVATION
...&action=getPrices&service=tg                                → {"12":{"tg":{"cost":0.45,"count":3120}}}

Servis kodları ve ülke ID'leri services ve countries metotlarındakilerle aynıdır.