Entegrasyon SMS
Sanal Santral SMS servisi ile entegrasyon için geliştirilmiş RESTful API.
Endpoint
POST https://api.sanalsantral.com.tr/sms/create
Authentication
Kimlik Doğrulama
API, Basic Authentication kullanır.
Authorization: Basic
Zorunlu Header'lar
| Header | Açıklama | Örnek |
|---|---|---|
| Content-Type | İçerik tipi | application/json |
| Authorization | Kimlik doğrulama | Basic dXNlcm5hbWU6cGFzc3dvcmQ= |
| X-Customer-Company-ID | Müşteri şirket ID'si | 123 |
| X-Entegrator-Company-ID | Entegratör şirket ID'si | 456 |
SMS Create
Zorunlu Parametreler
| Parametre | Tip | Açıklama |
|---|---|---|
| type | number | SMS tipi (1: Normal SMS) |
| sendingType | number | Gönderim tipi (0: Tekil, 1: Çoklu, 2: Toplu) |
| content | string | SMS içeriği |
| sender | string | Gönderici adı |
| number | number | Alıcı telefon numarası (Tekil gönderim için) |
| numbers | array | Alıcı telefon numaraları (Çoklu gönderim için) |
Opsiyonel Parametreler
| Parametre | Tip | Açıklama |
|---|---|---|
| title | string | SMS başlığı |
| encoding | number | Karakter kodlaması (1: UTF-8) |
| validity | number | Geçerlilik süresi (dakika) |
| customID | string | Özel takip ID'si |
Örnek İstek
Tekil SMS
curl -X POST https://sms.sanalsantral.com.tr:9588/sms/create \
-H "Content-Type: application/json" \
-H "X-Customer-Company-ID: 123" \
-H "X-Entegrator-Company-ID: 456" \
-H "Authorization: Basic " \
-d '{
"type": 1,
"sendingType": 0,
"content": "Merhaba, bu bir test mesajıdır",
"number": 905531450114,
"sender": "SANAL TEST",
"encoding": 1,
"validity": 60
}'
Yanıt Formatı
Başarılı Yanıt
{
"success": true,
"message": "SMS başarıyla gönderildi",
"data": {
"err": null,
"data": {
"pkgID": 9806329
}
}
}
Hata Yanıtı
{
"success": false,
"message": "Hata açıklaması",
"error": "Detaylı hata mesajı"
}
Test Verileri
Zorunlu Header'lar
| Header | Açıklama | Örnek |
|---|---|---|
| Content-Type | İçerik tipi | application/json |
| Authorization | Kimlik doğrulama | Basic dddddddd= |
| X-Customer-Company-ID | Müşteri şirket ID'si | 123 |
| X-Entegrator-Company-ID | Entegratör şirket ID'si | 456 |
Body-raw
{
"type": 1,
"sendingType": 0,
"title": "Test mesaj",
"content": "Merhaba, bu bir test mesajıdır. Dikkate almayınız..",
"number": 905531450114,
"encoding": 1,
"sender": "SANAL TEST",
"validity": 60
}