SMS Bridge - API v1

Dokumentacja endpointów v1 (legacy). Autoryzacja: Authorization: Bearer YOUR_API_KEY

Strona główna Dokumentacja v2

Autoryzacja

Wymagane nagłówki
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Statusy

Najczęściej spotykane statusy SMS
queued
sent_to_device
sms_sent
failed
blocked

Endpointy

Lista endpointów v1
POST /v1/send_message.php
Wysłanie SMS
Dodaje SMS do kolejki (status queued).
GET /v1/get_pending.php
Pobierz oczekujące
Legacy pobieranie oczekujących wiadomości.
POST /v1/update_status.php
Aktualizacja statusu
Status z bramki (sms_sent/failed).
GET /v1/auth.php
Test autoryzacji
Sprawdza poprawność API KEY.

Przykłady (zakładki)

Wklej swój API_KEY w nagłówku Authorization
<?php
$url = '/v1/send_message.php';
$payload = [
  'to' => '+48123456789',
  'text' => 'Wiadomość testowa',
  'sender' => 'client',
  'external_id' => 'EXT-2025-001'
];
$ch = curl_init($url);
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_HTTPHEADER => [
    'Content-Type: application/json',
    'Authorization: Bearer YOUR_API_KEY'
  ],
  CURLOPT_POSTFIELDS => json_encode($payload)
]);
$res = curl_exec($ch);$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo "HTTP $code\n";
echo $res;
curl -X POST '/v1/send_message.php' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"to":"+48123456789","text":"Wiadomość testowa","sender":"client","external_id":"EXT-2025-001"}'
{
  "to": "+48123456789",
  "text": "Wiadomość testowa",
  "sender": "client",
  "external_id": "EXT-2025-001"
}
import requests

url = '/v1/send_message.php'
headers = {
  'Authorization': 'Bearer YOUR_API_KEY',
  'Content-Type': 'application/json'
}
payload = {
  'to': '+48123456789',
  'text': 'Wiadomość testowa',
  'sender': 'client',
  'external_id': 'EXT-2025-001'
}
r = requests.post(url, headers=headers, json=payload, timeout=30)
print(r.status_code)
print(r.text)
// Kotlin + OkHttp
val url = "/v1/send_message.php"
val json = """{
  \"to\": \"+48123456789\",
  \"text\": \"Wiadomość testowa\",
  \"sender\": \"client\",
  \"external_id\": \"EXT-2025-001\"
}"""

val client = okhttp3.OkHttpClient()
val body = okhttp3.RequestBody.create(
  "application/json; charset=utf-8".toMediaType(),
  json
)
val request = okhttp3.Request.Builder()
  .url(url)
  .addHeader("Authorization", "Bearer YOUR_API_KEY")
  .post(body)
  .build()

client.newCall(request).enqueue(object : okhttp3.Callback {
  override fun onFailure(call: okhttp3.Call, e: java.io.IOException) {
    e.printStackTrace()
  }
  override fun onResponse(call: okhttp3.Call, response: okhttp3.Response) {
    println(response.code)
    println(response.body?.string())
  }
})

Przykład: test autoryzacji

GET /v1/auth.php
Authorization: Bearer YOUR_API_KEY

Przykład: pobranie oczekujących

GET /v1/get_pending.php
{
  "success": true,
  "count": 1,
  "messages": [
    {
      "id": 1,
      "target_phone": "+48123456789",
      "message_text": "Wiadomość",
      "external_id": "EXT-2025-001",
      "status": "queued"
    }
  ]
}

Przykład: update status

POST /v1/update_status.php
{
  "message_id": 12345,
  "status": "sms_sent",
  "details": {
    "provider_id": "MSG-987654"
  }
}