Quick Start
Invia il tuo primo messaggio in meno di 3 minuti.
Prerequisiti
- Account Qlara attivo
- API Key (dalla sezione impostazioni della piattaforma)
1. Scegli il canale
| Canale | Quando usarlo |
|---|---|
| SMS | Raggiungi qualsiasi telefono, inclusi i non-smartphone |
| RCS | Messaggi ricchi con pulsanti e immagini (Android) |
| Raggiungi gli utenti su WhatsApp con template approvati |
2. Invia il tuo primo SMS
- cURL
- Node.js
- Python
- PHP
- Java
curl -X POST "https://lora-api.agiletelecom.com/api/message-server/sms/send" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"destination": "+393401234567",
"sender": "MyCompany",
"body": "Ciao! Questo è il tuo primo SMS."
}'
const response = await fetch(
"https://lora-api.agiletelecom.com/api/message-server/sms/send",
{
method: "POST",
headers: {
"X-Api-Key": "YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
destination: "+393401234567",
sender: "MyCompany",
body: "Ciao! Questo è il tuo primo SMS.",
}),
}
);
const data = await response.json();
console.log(data);
import requests
response = requests.post(
"https://lora-api.agiletelecom.com/api/message-server/sms/send",
headers={
"X-Api-Key": "YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"destination": "+393401234567",
"sender": "MyCompany",
"body": "Ciao! Questo è il tuo primo SMS.",
},
)
print(response.json())
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => "https://lora-api.agiletelecom.com/api/message-server/sms/send",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"X-Api-Key: YOUR_API_KEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"destination" => "+393401234567",
"sender" => "MyCompany",
"body" => "Ciao! Questo è il tuo primo SMS.",
]),
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
HttpClient client = HttpClient.newHttpClient();
String jsonBody = """
{
"destination": "+393401234567",
"sender": "MyCompany",
"body": "Ciao! Questo è il tuo primo SMS."
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://lora-api.agiletelecom.com/api/message-server/sms/send"))
.header("X-Api-Key", "YOUR_API_KEY")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(jsonBody))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
3. Invia il tuo primo WhatsApp
- cURL
- Node.js
- Python
- PHP
- Java
curl -X POST "https://lora-api.agiletelecom.com/api/message-server/whatsapp/send" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"destination": "+393401234567",
"phoneNumberId": 5,
"template": { "id": 42 },
"enableNotification": true
}'
const response = await fetch(
"https://lora-api.agiletelecom.com/api/message-server/whatsapp/send",
{
method: "POST",
headers: {
"X-Api-Key": "YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
destination: "+393401234567",
phoneNumberId: 5,
template: { id: 42 },
enableNotification: true,
}),
}
);
const data = await response.json();
console.log(data);
import requests
response = requests.post(
"https://lora-api.agiletelecom.com/api/message-server/whatsapp/send",
headers={
"X-Api-Key": "YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"destination": "+393401234567",
"phoneNumberId": 5,
"template": {"id": 42},
"enableNotification": True,
},
)
print(response.json())
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => "https://lora-api.agiletelecom.com/api/message-server/whatsapp/send",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"X-Api-Key: YOUR_API_KEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"destination" => "+393401234567",
"phoneNumberId" => 5,
"template" => ["id" => 42],
"enableNotification" => true,
]),
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
HttpClient client = HttpClient.newHttpClient();
String jsonBody = """
{
"destination": "+393401234567",
"phoneNumberId": 5,
"template": { "id": 42 },
"enableNotification": true
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://lora-api.agiletelecom.com/api/message-server/whatsapp/send"))
.header("X-Api-Key", "YOUR_API_KEY")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(jsonBody))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
4. Invia il tuo primo RCS
- cURL
- Node.js
- Python
- PHP
- Java
curl -X POST "https://lora-api.agiletelecom.com/api/message-server/rcs/send" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"destination": "+393401234567",
"agentId": 10,
"templateId": 42
}'
const response = await fetch(
"https://lora-api.agiletelecom.com/api/message-server/rcs/send",
{
method: "POST",
headers: {
"X-Api-Key": "YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
destination: "+393401234567",
agentId: 10,
templateId: 42,
}),
}
);
const data = await response.json();
console.log(data);
import requests
response = requests.post(
"https://lora-api.agiletelecom.com/api/message-server/rcs/send",
headers={
"X-Api-Key": "YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"destination": "+393401234567",
"agentId": 10,
"templateId": 42,
},
)
print(response.json())
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => "https://lora-api.agiletelecom.com/api/message-server/rcs/send",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"X-Api-Key: YOUR_API_KEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"destination" => "+393401234567",
"agentId" => 10,
"templateId" => 42,
]),
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
HttpClient client = HttpClient.newHttpClient();
String jsonBody = """
{
"destination": "+393401234567",
"agentId": 10,
"templateId": 42
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://lora-api.agiletelecom.com/api/message-server/rcs/send"))
.header("X-Api-Key", "YOUR_API_KEY")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(jsonBody))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
5. Verifica la risposta
Se tutto è andato bene, riceverai:
{
"messageId": "e76614d1-4ac1-4d94-89f0-d07f1b5a190c",
"simulation": false,
"results": {
"sms": { "accepted": true, "unicode": false, "parts": 1 }
}
}
attenzione
accepted: true significa che il messaggio è stato accettato per l'invio, non che è stato consegnato. La conferma di consegna arriva tramite webhook (Delivery Notification).
Prossimi passi
- Configura il tuo callback URL per ricevere le notifiche di consegna
- Esplora i template per RCS e WhatsApp
- Configura il fallback automatico per garantire la consegna