⚡ REST API
OTP API Entegrasyonu
Tek endpoint ile sisteminizden WhatsApp OTP gönderin. Numara rotasyonu ve oran sınırlaması otomatik yönetilir.
🔑 API Anahtarınız
sk-tikotp-••••••••••••••••••••••••
Şablon ve alıcı numaraya göre WhatsApp OTP gönderir. 1 istek = 1 kredi. Aynı alıcıya 60 saniye içinde tekrar gönderemezsiniz.
Request Body
JSON
{
"to": "+905XXXXXXXXX",
"template_id": "tpl_abc123",
"image_url": "https://ornek.com/resim.jpg"
}
Response 200
JSON
{
"success": true,
"otp_id": "otp_f3a9c8b4",
"sent_to": "+905XXXXXXXXX",
"sent_from": "+90530XXXXXX1",
"expire_at": "2026-09-18T23:03:00Z",
"credits_remaining": 499,
"has_image": true
}
Hata Kodları
| Kod | Açıklama |
401 | Geçersiz API Key |
402 | Yetersiz kredi |
429 | 60s rate limit — aynı numaraya çok erken istek |
503 | Tüm hatlar 38s bekleme süresinde |
cURL
curl -X POST "https://api.tikotp.com/api/v1/otp/send" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"to":"+905XXXXXXXXX","template_id":"tpl_abc123","image_url":"https://ornek.com/resim.jpg"}'
const res = await fetch('https://api.tikotp.com/api/v1/otp/send', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({ to: '+905XXXXXXXXX', template_id: 'tpl_abc123', image_url: 'https://ornek.com/resim.jpg' })
});
const { otp_id, expire_at, credits_remaining, has_image } = await res.json();
import requests
r = requests.post('https://api.tikotp.com/api/v1/otp/send',
headers={'Authorization': 'Bearer YOUR_API_KEY'},
json={'to': '+905XXXXXXXXX', 'template_id': 'tpl_abc123', 'image_url': 'https://ornek.com/resim.jpg'})
data = r.json()
print(data['otp_id'])
$ch = curl_init('https://api.tikotp.com/api/v1/otp/send');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode(['to'=>'+905XXXXXXXXX','template_id'=>'tpl_abc123','image_url'=>'https://ornek.com/resim.jpg']),
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY','Content-Type: application/json'],
CURLOPT_RETURNTRANSFER => true
]);
$r = json_decode(curl_exec($ch), true);
Kullanıcının girdiği kodu doğrular. Her OTP yalnızca bir kez kullanılabilir.
Request
{ "otp_id": "otp_f3a9c8b4", "code": "847291" }
Response
{ "success": true, "verified": true, "phone": "+905XXXXXXXXX" }
Numaranın WhatsApp hesabı olup olmadığını sorgular ve numarayı +90... formatına dönüştürür.
Request
{ "phone": "5331112233" }
Response
{
"success": true,
"phone_raw": "5331112233",
"phone_formatted": "+905331112233",
"whatsapp_exists": true,
"status": "registered"
}