API 문서
iLoveSMS REST API 또는 SMS-Activate 프로토콜로 번호 구매를 자동화하세요.
개인 API 키는 계정 설정에 있습니다. 회원가입
REST JSON API v1
기본 URL: https://ilovesms.com.tr/api/v1/ — 인증: ?api_key=… / Authorization: Bearer …
| Method | 매개변수 | 설명 |
|---|---|---|
GET services | — | 최저가와 재고가 포함된 서비스 목록. |
GET countries | — | 국가 목록. |
GET prices | service | 서비스의 국가별 가격과 재고. |
GET balance | api_key | 내 잔액. |
POST buy | api_key, service, country_id | 번호 구매; 요금은 잔액에서 차감됩니다. |
GET status | api_key, id | 주문 상태와 SMS 코드. |
POST cancel | api_key, id | 대기 중 주문을 취소하고 환불. |
POST finish | api_key, id | 코드 수신 후 번호 종료. |
GET orders | api_key | 최근 주문 100건. |
# 1) 번호 구매
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) 코드가 올 때까지 5초마다 조회하세요
curl "https://ilovesms.com.tr/api/v1/status?api_key=YOUR_API_KEY&id=1042"
{"ok":true,"order":{"id":1042,"status":"received","code":"48213", ...}}
오류 코드: bad_key, bad_service, insufficient, no_numbers, not_cancelable, cancel_later
Webhooks
계속 조회하는 대신 URL을 알려주시면 코드 도착이나 환불 시 JSON 이벤트를 보내 드립니다.
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초 안에 HTTP 2xx로 응답하세요. 웹훅 URL 설정: 계정 설정
SMS-Activate 호환 엔드포인트
SMS-Activate 프로토콜용 소프트웨어는 수정 없이 동작합니다. 기본 URL과 API 키만 바꾸세요.
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}}}
서비스 코드와 국가 ID는 services, countries 메서드와 같습니다.