Documentación ›
Mensajes › Enviar SMS
POST
Enviar SMS
POSThttps://app.sendapp.ai/api/sms/send
Envía un SMS a través del SMS Gateway. El gateway debe estar configurado y un dispositivo debe estar vinculado antes de usar esta API.
El SMS Gateway debe configurarse y vincularse un dispositivo en Apps > SMS Gateway antes de usar este endpoint.
Parámetros
apikey
obligatorio
Tu API Key.
token
obligatorio
Token de la cuenta.
number
obligatorio
Número del destinatario en formato internacional (p. ej. +39XXXXXXXXXX).
message
obligatorio
El texto del mensaje a enviar.
Solicitud
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": "¡Hola desde 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' => '¡Hola desde 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: '¡Hola desde SendApp!'
})
});
console.log(await res.json());Respuesta (200 OK)
{
"status": "success",
"message": "SMS sent successfully"
}Error
{
"status": "error",
"message": "No active SMS Gateway instance found. Please configure SMS Gateway first."
}