API
Accedi
Documentazione › Messaggi › Invia SMS
POST

Invia SMS

POSThttps://app.sendapp.ai/api/sms/send
Invia un SMS tramite l'SMS Gateway. Il gateway deve essere configurato e un dispositivo dev'essere associato prima di usare questa API.
L'SMS Gateway va configurato e un dispositivo associato in Apps > SMS Gateway prima di usare questo endpoint.
Parametri
apikey obbligatorio
La tua API Key.
token obbligatorio
Token dell'account.
number obbligatorio
Numero destinatario in formato internazionale (es. +39XXXXXXXXXX).
message obbligatorio
Il testo del messaggio da inviare.
Richiesta
curl -X POST 'https://app.sendapp.ai/api/sms/send' \
  -H 'Content-Type: application/json' \
  -d '{
    "apikey": "YOUR_API_KEY",
    "token": "YOUR_ACCOUNT_TOKEN",
    "number": "+39XXXXXXXXXX",
    "message": "Ciao da SendApp!"
  }'
<?php
$ch = curl_init('https://app.sendapp.ai/api/sms/send');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
    CURLOPT_POSTFIELDS => json_encode([
        'apikey'  => 'YOUR_API_KEY',
        'token'   => 'YOUR_ACCOUNT_TOKEN',
        'number'  => '+39XXXXXXXXXX',
        'message' => 'Ciao da SendApp!',
    ]),
]);
echo curl_exec($ch);
curl_close($ch);
const res = await fetch('https://app.sendapp.ai/api/sms/send', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    apikey: 'YOUR_API_KEY',
    token: 'YOUR_ACCOUNT_TOKEN',
    number: '+39XXXXXXXXXX',
    message: 'Ciao da SendApp!'
  })
});
console.log(await res.json());
Risposta (200 OK)
{
  "status": "success",
  "message": "SMS sent successfully"
}
Errore
{
  "status": "error",
  "message": "No active SMS Gateway instance found. Please configure SMS Gateway first."
}