SendApp API
Integra WhatsApp, SMS, contatti e l'assistente AI di SendApp nelle tue applicazioni. Un'unica base URL, autenticazione con apikey, risposte JSON.
Base URL: https://app.sendapp.ai
Autenticazione
Ogni richiesta deve includere il parametro apikey (o l'header X-API-Key per gli endpoint contatti/account). L'apikey autentica il tuo utente. Molti endpoint richiedono inoltre un token che identifica lo specifico account (modello AI / canale WhatsApp) su cui operare.
| Parametro | Descrizione |
|---|---|
| apikeystringrequired | La tua API Key. Identifica il tuo account SendApp. |
| tokenstringrichiesto dai singoli endpoint | Token dell'account (modello AI o canale). Identifica su quale account viene eseguita l'operazione. |
token è un placeholder in questa pagina (YOUR_ACCOUNT_TOKEN): hai un token diverso per ciascun account. Usa GET /api/get_tokens per elencarli.Invia messaggio WhatsApp (Meta)
Invia un messaggio tramite la WhatsApp Cloud API di Meta. Supporta testo libero (freetext), media, messaggi interattivi con pulsanti e template approvati. I messaggi freetext possono essere inviati solo entro 24 ore dall'ultimo messaggio dell'utente.
| Parametro | Descrizione |
|---|---|
| apikeyrequired | La tua API Key. |
| tokenrequired | Token dell'account. |
| numberrequired | Numero destinatario in formato internazionale senza + (es. 1234567890). |
| typerequired | freetext per testo/media/interattivi, template per i template. |
| messageoptional | Testo del messaggio (o didascalia per image/video; corpo per gli interattivi). |
| media_typeoptional | Per i media: image, video, audio o document. |
| media_urloptional | URL del file da inviare. |
| file_nameoptional | Nome del file (per i documenti). |
| headeroptional | Testo dell'header (messaggi interattivi). |
| footeroptional | Testo del footer (messaggi interattivi). |
| buttonsoptional | Array di pulsanti, massimo 3 (messaggi interattivi). |
| templateoptional | Oggetto template con name, language e components (richiesto se type=template). |
curl -X POST 'https://app.sendapp.ai/api/whatsapp-meta/send' \
-H 'Content-Type: application/json' \
-d '{
"apikey": "YOUR_API_KEY",
"token": "YOUR_ACCOUNT_TOKEN",
"number": "1234567890",
"type": "freetext",
"message": "Ciao dalla WhatsApp Business API!"
}'<?php
$ch = curl_init('https://app.sendapp.ai/api/whatsapp-meta/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' => '1234567890',
'type' => 'freetext',
'message' => 'Ciao dalla WhatsApp Business API!',
]),
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;const res = await fetch('https://app.sendapp.ai/api/whatsapp-meta/send', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
apikey: 'YOUR_API_KEY',
token: 'YOUR_ACCOUNT_TOKEN',
number: '1234567890',
type: 'freetext',
message: 'Ciao dalla WhatsApp Business API!'
})
});
const data = await res.json();
console.log(data);Invia messaggio WhatsApp Web
Invia un messaggio di testo o media tramite WhatsApp Web (automazione browser). Imposta type=text per il testo o type=media per allegare un file.
| Parametro | Descrizione |
|---|---|
| apikeyrequired | La tua API Key. |
| tokenrequired | Token dell'account. |
| numberrequired | Numero destinatario (es. 1234567890). |
| typerequired | text oppure media. |
| messageoptional | Testo del messaggio (richiesto se type=text). |
| media_urloptional | URL del file media (richiesto se type=media). |
| filenameoptional | Nome del file per il media. |
curl -X POST 'https://app.sendapp.ai/api/whatsapp-web/send' \
-H 'Content-Type: application/json' \
-d '{
"apikey": "YOUR_API_KEY",
"token": "YOUR_ACCOUNT_TOKEN",
"number": "1234567890",
"type": "text",
"message": "Ciao, questo è un messaggio di prova!"
}'<?php
$ch = curl_init('https://app.sendapp.ai/api/whatsapp-web/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' => '1234567890',
'type' => 'text',
'message' => 'Ciao, questo è un messaggio di prova!',
]),
]);
echo curl_exec($ch);
curl_close($ch);const res = await fetch('https://app.sendapp.ai/api/whatsapp-web/send', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
apikey: 'YOUR_API_KEY',
token: 'YOUR_ACCOUNT_TOKEN',
number: '1234567890',
type: 'text',
message: 'Ciao, questo è un messaggio di prova!'
})
});
console.log(await res.json());Invia SMS
Invia un SMS tramite l'SMS Gateway. Il gateway deve essere configurato e un dispositivo dev'essere associato prima di usare questa API.
| Parametro | Descrizione |
|---|---|
| apikeyrequired | La tua API Key. |
| tokenrequired | Token dell'account. |
| numberrequired | Numero destinatario in formato internazionale (es. +39XXXXXXXXXX). |
| messagerequired | Il testo del messaggio da inviare. |
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());Elenca template Meta
Recupera tutti i template WhatsApp approvati da Meta per l'account, con nome, lingua, categoria, stato e struttura dei componenti/variabili.
| Parametro | Descrizione |
|---|---|
| apikeyrequired | La tua API Key. |
| tokenrequired | Token dell'account. |
curl 'https://app.sendapp.ai/api/whatsapp-meta/get_templates?apikey=YOUR_API_KEY&token=YOUR_ACCOUNT_TOKEN'<?php
$url = 'https://app.sendapp.ai/api/whatsapp-meta/get_templates?apikey=YOUR_API_KEY&token=YOUR_ACCOUNT_TOKEN';
$response = file_get_contents($url);
$data = json_decode($response, true);
print_r($data);const params = new URLSearchParams({ apikey: 'YOUR_API_KEY', token: 'YOUR_ACCOUNT_TOKEN' });
const res = await fetch('https://app.sendapp.ai/api/whatsapp-meta/get_templates?' + params);
const data = await res.json();
console.log(data.templates);Crea template Meta
Crea un template WhatsApp Meta e lo invia a Meta per l'approvazione. Passa i campi semplici (body, e opzionali header/footer) e costruiamo noi i componenti; per template avanzati puoi passare direttamente l'array components in formato Meta. Nel body usa {{1}}, {{2}}… come variabili.
| Parametro | Descrizione |
|---|---|
| apikeyrequired | La tua API Key. |
| tokenrequired | Token dell'account WhatsApp Meta. |
| namerequired | Nome del template: minuscolo, solo lettere, numeri e underscore. |
| categoryrequired | MARKETING, UTILITY o AUTHENTICATION. |
| bodyrequired | Testo del corpo (obbligatorio se non passi components). |
| languageoptional | Codice lingua (default it). |
| headeroptional | Testo dell'intestazione (max 60 caratteri). |
| footeroptional | Testo del piè di pagina (max 60 caratteri). |
| componentsoptional | Array/JSON dei componenti in formato Meta, per template avanzati. |
curl -X POST 'https://app.sendapp.ai/api/whatsapp-meta/create_template' \
-H 'Content-Type: application/json' \
-d '{
"apikey": "YOUR_API_KEY",
"token": "YOUR_ACCOUNT_TOKEN",
"name": "promo_estate",
"category": "MARKETING",
"language": "it",
"header": "Offerta speciale",
"body": "Ciao {{1}}, sconto del {{2}}% solo per oggi!",
"footer": "Rispondi STOP per disiscriverti"
}'<?php
$ch = curl_init('https://app.sendapp.ai/api/whatsapp-meta/create_template');
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',
'name' => 'promo_estate',
'category' => 'MARKETING',
'body' => 'Ciao {{1}}, sconto del {{2}}% solo per oggi!',
]),
]);
echo curl_exec($ch);const res = await fetch('https://app.sendapp.ai/api/whatsapp-meta/create_template', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
apikey: 'YOUR_API_KEY',
token: 'YOUR_ACCOUNT_TOKEN',
name: 'promo_estate',
category: 'MARKETING',
body: 'Ciao {{1}}, sconto del {{2}}% solo per oggi!'
})
});
console.log(await res.json());Lista contatti
Recupera l'elenco paginato dei tuoi contatti, con filtri per ricerca e tag. Utile anche per trovare gli ID da usare in fase di eliminazione. L'autenticazione può passare via header X-API-Key oppure via campo apikey.
| Parametro | Descrizione |
|---|---|
| apikeyrequired | La tua API Key (anche header X-API-Key). |
| pageoptional | Numero di pagina (default 1). |
| per_pageoptional | Elementi per pagina (default 100, max 1000). |
| searchoptional | Cerca su nome, telefono o email (LIKE). |
| tagoptional | Corrispondenza esatta di tag. |
| with_phoneoptional | Solo contatti con un numero di telefono. |
| with_emailoptional | Solo contatti con una email. |
curl 'https://app.sendapp.ai/api/contacts?page=1&per_page=50&search=mario' \
-H 'X-API-Key: YOUR_API_KEY'<?php
$ch = curl_init('https://app.sendapp.ai/api/contacts?page=1&per_page=50&search=mario');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['X-API-Key: YOUR_API_KEY'],
]);
echo curl_exec($ch);
curl_close($ch);const params = new URLSearchParams({ page: 1, per_page: 50, search: 'mario' });
const res = await fetch('https://app.sendapp.ai/api/contacts?' + params, {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
console.log(await res.json());Crea contatto
Crea (o aggiorna in upsert) un singolo contatto. Deve avere almeno un telefono OPPURE una email. Contatti esistenti con lo stesso telefono/email vengono uniti (tag combinati, metadata uniti).
| Parametro | Descrizione |
|---|---|
| apikeyrequired | La tua API Key (anche header X-API-Key). |
| nameoptional | Nome completo, fino a 255 caratteri. |
| phonerequired | Formato internazionale (es. +393391234567). Obbligatorio se manca email. |
| emailrequired | Email valida. Obbligatoria se manca il telefono. |
| tagsoptional | Array di stringhe o stringa separata da virgole (es. "vip,newsletter"). |
| metadataoptional | Oggetto JSON con campi personalizzati. |
201 Created con il contatto creato — 403 se raggiunto il limite di contatti del piano — 422 se mancano sia telefono che email.curl -X POST 'https://app.sendapp.ai/api/contacts' \
-H 'X-API-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "Mario Rossi",
"phone": "+393391234567",
"email": "mario@example.com",
"tags": ["newsletter", "vip"],
"metadata": { "source": "landing_page_a" }
}'<?php
$ch = curl_init('https://app.sendapp.ai/api/contacts');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['X-API-Key: YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Mario Rossi',
'phone' => '+393391234567',
'email' => 'mario@example.com',
'tags' => ['newsletter', 'vip'],
'metadata' => ['source' => 'landing_page_a'],
]),
]);
echo curl_exec($ch);
curl_close($ch);const res = await fetch('https://app.sendapp.ai/api/contacts', {
method: 'POST',
headers: { 'X-API-Key': 'YOUR_API_KEY', 'Content-Type': 'application/json' },
body: JSON.stringify({
name: 'Mario Rossi',
phone: '+393391234567',
email: 'mario@example.com',
tags: ['newsletter', 'vip'],
metadata: { source: 'landing_page_a' }
})
});
console.log(await res.json());Crea contatti in blocco
Importa fino a 10.000 contatti in una singola chiamata. I duplicati (per telefono o email) vengono uniti automaticamente ai contatti esistenti.
| Parametro | Descrizione |
|---|---|
| apikeyrequired | La tua API Key (anche header X-API-Key). |
| contactsrequired | Array di oggetti contatto — max 10.000 per chiamata. Ogni oggetto accetta name, phone, email, tags, metadata. |
curl -X POST 'https://app.sendapp.ai/api/contacts/bulk' \
-H 'X-API-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"contacts": [
{ "name": "Alice", "phone": "+39111111111", "tags": ["newsletter"] },
{ "name": "Bob", "email": "bob@example.com" }
]
}'<?php
$ch = curl_init('https://app.sendapp.ai/api/contacts/bulk');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['X-API-Key: YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'contacts' => [
['name' => 'Alice', 'phone' => '+39111111111', 'tags' => ['newsletter']],
['name' => 'Bob', 'email' => 'bob@example.com'],
],
]),
]);
echo curl_exec($ch);
curl_close($ch);const res = await fetch('https://app.sendapp.ai/api/contacts/bulk', {
method: 'POST',
headers: { 'X-API-Key': 'YOUR_API_KEY', 'Content-Type': 'application/json' },
body: JSON.stringify({
contacts: [
{ name: 'Alice', phone: '+39111111111', tags: ['newsletter'] },
{ name: 'Bob', email: 'bob@example.com' }
]
})
});
console.log(await res.json());Elimina contatto
Elimina un singolo contatto tramite ID. Solo i contatti appartenenti al tuo account possono essere eliminati — qualunque altro ID restituisce 404.
| Parametro | Descrizione |
|---|---|
| apikeyrequired | La tua API Key (anche header X-API-Key). |
| idrequired | ID del contatto (intero, nel path). Usa GET /api/contacts per trovarlo. |
curl -X DELETE 'https://app.sendapp.ai/api/contacts/42' \
-H 'X-API-Key: YOUR_API_KEY'<?php
$ch = curl_init('https://app.sendapp.ai/api/contacts/42');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => ['X-API-Key: YOUR_API_KEY'],
]);
echo curl_exec($ch);
curl_close($ch);const res = await fetch('https://app.sendapp.ai/api/contacts/42', {
method: 'DELETE',
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
console.log(await res.json());Elimina contatti in blocco
Elimina molti contatti in una chiamata. Gli ID che non appartengono al tuo account vengono ignorati silenziosamente e conteggiati come not_found — nessuna fuga di dati cross-account è possibile.
| Parametro | Descrizione |
|---|---|
| apikeyrequired | La tua API Key (anche header X-API-Key). |
| idsrequired | Array di ID contatto (interi). Max 10.000 per chiamata. |
curl -X DELETE 'https://app.sendapp.ai/api/contacts/bulk' \
-H 'X-API-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{ "ids": [12, 34, 56, 78] }'<?php
$ch = curl_init('https://app.sendapp.ai/api/contacts/bulk');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => ['X-API-Key: YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode(['ids' => [12, 34, 56, 78]]),
]);
echo curl_exec($ch);
curl_close($ch);const res = await fetch('https://app.sendapp.ai/api/contacts/bulk', {
method: 'DELETE',
headers: { 'X-API-Key': 'YOUR_API_KEY', 'Content-Type': 'application/json' },
body: JSON.stringify({ ids: [12, 34, 56, 78] })
});
console.log(await res.json());Carica media campagna
Carica un file multimediale (immagine, audio, video, documento) sullo storage e ottieni l'URL pubblico da usare come media_url nella creazione di una bozza campagna. Richiesta multipart/form-data, dimensione massima 10 MB.
| Parametro | Descrizione |
|---|---|
| apikeyrequired | La tua API Key. |
| tokenrequired | Token dell'account. |
| filerequired | Il file da caricare (multipart, max 10 MB). |
curl -X POST 'https://app.sendapp.ai/api/campaigns/upload_media' \
-F 'apikey=YOUR_API_KEY' \
-F 'token=YOUR_ACCOUNT_TOKEN' \
-F 'file=@/path/to/image.jpg'<?php
$ch = curl_init('https://app.sendapp.ai/api/campaigns/upload_media');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => [
'apikey' => 'YOUR_API_KEY',
'token' => 'YOUR_ACCOUNT_TOKEN',
'file' => new CURLFile('/path/to/image.jpg'),
],
]);
echo curl_exec($ch);const form = new FormData();
form.append('apikey', 'YOUR_API_KEY');
form.append('token', 'YOUR_ACCOUNT_TOKEN');
form.append('file', fileInput.files[0]);
const res = await fetch('https://app.sendapp.ai/api/campaigns/upload_media', { method: 'POST', body: form });
console.log(await res.json()); // { status:'success', url:'https://...' }Crea bozza campagna
Crea una campagna come bozza. Non invia nulla: per inviarla usa poi l'endpoint di avvio. I destinatari si scelgono per tag; il messaggio può essere testo o un template approvato. Nel testo puoi usare i segnaposto {{name}}, {{phone}}, {{email}}.
| Parametro | Descrizione |
|---|---|
| apikeyrequired | La tua API Key. |
| tokenrequired | Token dell'account. |
| namerequired | Nome della campagna. |
| channelrequired | whatsapp, whatsapp-web o sms. |
| message_typerequired | template, text, text_media o media_only. |
| messageoptional | Testo del messaggio (per text / text_media). |
| template_nameoptional | Nome del template (per message_type=template). |
| template_languageoptional | Lingua del template. |
| media_urloptional | URL pubblico del media (dall'endpoint di upload). |
| media_typeoptional | image, audio, video o document. |
| recipient_typeoptional | all (tutti i contatti) o tags (filtra per tag). Default all. |
| tagsoptional | Array di tag dei destinatari (se recipient_type=tags). |
| scheduled_atoptional | Data/ora di invio programmato. Omesso = invio manuale. |
curl -X POST 'https://app.sendapp.ai/api/campaigns/draft' \
-H 'Content-Type: application/json' \
-d '{
"apikey": "YOUR_API_KEY",
"token": "YOUR_ACCOUNT_TOKEN",
"name": "Promo estate",
"channel": "whatsapp",
"message_type": "template",
"template_name": "promo_estate",
"recipient_type": "tags",
"tags": ["shopify"]
}'<?php
$ch = curl_init('https://app.sendapp.ai/api/campaigns/draft');
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',
'name' => 'Promo estate',
'channel' => 'whatsapp',
'message_type' => 'template',
'template_name' => 'promo_estate',
'recipient_type' => 'tags',
'tags' => ['shopify'],
]),
]);
echo curl_exec($ch); // { status:'success', campaign_id: 148 }const res = await fetch('https://app.sendapp.ai/api/campaigns/draft', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
apikey: 'YOUR_API_KEY',
token: 'YOUR_ACCOUNT_TOKEN',
name: 'Promo estate',
channel: 'whatsapp',
message_type: 'template',
template_name: 'promo_estate',
recipient_type: 'tags',
tags: ['shopify']
})
});
console.log(await res.json()); // { status:'success', campaign_id: 148 }Avvia campagna
Avvia (invia) una campagna in bozza esistente, dato il suo campaign_id (restituito dalla creazione bozza). Questo invia messaggi reali ai destinatari selezionati.
| Parametro | Descrizione |
|---|---|
| apikeyrequired | La tua API Key. |
| campaign_idrequired | ID della campagna in bozza da inviare. |
curl -X POST 'https://app.sendapp.ai/api/campaigns/launch' \
-H 'Content-Type: application/json' \
-d '{ "apikey": "YOUR_API_KEY", "campaign_id": 148 }'<?php
$ch = curl_init('https://app.sendapp.ai/api/campaigns/launch');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode(['apikey' => 'YOUR_API_KEY', 'campaign_id' => 148]),
]);
echo curl_exec($ch);const res = await fetch('https://app.sendapp.ai/api/campaigns/launch', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ apikey: 'YOUR_API_KEY', campaign_id: 148 })
});
console.log(await res.json());Info account
Recupera le informazioni complete dell'account: profilo (email, username, fuso orario…), dettagli del piano (nome, prezzi, limiti, app abilitate, permessi), stato dell'abbonamento e utilizzo corrente (token consumati, messaggi, costo, numero di contatti).
| Parametro | Descrizione |
|---|---|
| apikeyrequired | La tua API Key (anche header X-API-Key). |
curl 'https://app.sendapp.ai/api/account' \
-H 'X-API-Key: YOUR_API_KEY'<?php
$ch = curl_init('https://app.sendapp.ai/api/account');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['X-API-Key: YOUR_API_KEY'],
]);
echo curl_exec($ch);
curl_close($ch);const res = await fetch('https://app.sendapp.ai/api/account', {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
console.log(await res.json());Elenca token degli account
Recupera tutti i token degli account associati alla tua API Key. Usa questi token nel parametro token degli altri endpoint.
| Parametro | Descrizione |
|---|---|
| apikeyrequired | La tua API Key. |
curl 'https://app.sendapp.ai/api/get_tokens?apikey=YOUR_API_KEY'<?php
$response = file_get_contents('https://app.sendapp.ai/api/get_tokens?apikey=YOUR_API_KEY');
print_r(json_decode($response, true));const res = await fetch('https://app.sendapp.ai/api/get_tokens?apikey=YOUR_API_KEY');
console.log(await res.json());Crea account AI
Crea un nuovo account/token per un modello AI personalizzato.
| Parametro | Descrizione |
|---|---|
| apikeyrequired | La tua API Key. |
| namerequired | Nome del nuovo account (3-255 caratteri). |
| greetings_messageoptional | Messaggio di saluto mostrato dall'AI. |
| no_info_messageoptional | Messaggio mostrato quando non viene trovata alcuna informazione. |
curl -X POST 'https://app.sendapp.ai/api/create_accounts' \
-H 'Content-Type: application/json' \
-d '{
"apikey": "YOUR_API_KEY",
"name": "Assistente Vendite",
"greetings_message": "Ciao! Come posso aiutarti?"
}'<?php
$ch = curl_init('https://app.sendapp.ai/api/create_accounts');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'apikey' => 'YOUR_API_KEY',
'name' => 'Assistente Vendite',
'greetings_message' => 'Ciao! Come posso aiutarti?',
]),
]);
echo curl_exec($ch);
curl_close($ch);const res = await fetch('https://app.sendapp.ai/api/create_accounts', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
apikey: 'YOUR_API_KEY',
name: 'Assistente Vendite',
greetings_message: 'Ciao! Come posso aiutarti?'
})
});
console.log(await res.json());Carica dati di training
Carica dati di training per il tuo modello AI: un file (PDF o TXT via URL), una pagina web da scrapare, oppure una sitemap.
| Parametro | Descrizione |
|---|---|
| apikeyrequired | La tua API Key. |
| tokenrequired | Token dell'account. |
| media_urloptional | URL del file da processare (PDF o TXT). |
| urloptional | URL della pagina web da scrapare. |
| sitemapoptional | URL della sitemap da processare. |
curl -X POST 'https://app.sendapp.ai/api/upload_training' \
-H 'Content-Type: application/json' \
-d '{
"apikey": "YOUR_API_KEY",
"token": "YOUR_ACCOUNT_TOKEN",
"url": "https://example.com/faq"
}'<?php
$ch = curl_init('https://app.sendapp.ai/api/upload_training');
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',
'url' => 'https://example.com/faq',
]),
]);
echo curl_exec($ch);
curl_close($ch);const res = await fetch('https://app.sendapp.ai/api/upload_training', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
apikey: 'YOUR_API_KEY',
token: 'YOUR_ACCOUNT_TOKEN',
url: 'https://example.com/faq'
})
});
console.log(await res.json());Stato del training
Verifica lo stato di un processo di training per l'account indicato.
| Parametro | Descrizione |
|---|---|
| apikeyrequired | La tua API Key. |
| tokenrequired | Token dell'account. |
curl 'https://app.sendapp.ai/api/training_status?apikey=YOUR_API_KEY&token=YOUR_ACCOUNT_TOKEN'<?php
$url = 'https://app.sendapp.ai/api/training_status?apikey=YOUR_API_KEY&token=YOUR_ACCOUNT_TOKEN';
print_r(json_decode(file_get_contents($url), true));const params = new URLSearchParams({ apikey: 'YOUR_API_KEY', token: 'YOUR_ACCOUNT_TOKEN' });
const res = await fetch('https://app.sendapp.ai/api/training_status?' + params);
console.log(await res.json());Interroga l'assistente AI
Invia una domanda all'assistente AI usando il token dell'account. Passa un conversation_id per mantenere il contesto tra più richieste.
| Parametro | Descrizione |
|---|---|
| apikeyrequired | La tua API Key. |
| tokenrequired | Token per questa conversazione. |
| questionrequired | La tua domanda. |
| conversation_idoptional | Identificatore di conversazione per il contesto. |
curl -X POST 'https://app.sendapp.ai/api/conversation/ask' \
-H 'Content-Type: application/json' \
-d '{
"apikey": "YOUR_API_KEY",
"token": "YOUR_ACCOUNT_TOKEN",
"question": "Ciao, come puoi aiutarmi?"
}'<?php
$ch = curl_init('https://app.sendapp.ai/api/conversation/ask');
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',
'question' => 'Ciao, come puoi aiutarmi?',
]),
]);
echo curl_exec($ch);
curl_close($ch);const res = await fetch('https://app.sendapp.ai/api/conversation/ask', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
apikey: 'YOUR_API_KEY',
token: 'YOUR_ACCOUNT_TOKEN',
question: 'Ciao, come puoi aiutarmi?'
})
});
console.log(await res.json());Webhook in ingresso (Integrazioni)
Ricevi contatti da piattaforme esterne (Shopify, WooCommerce, HubSpot, Klaviyo, Pipedrive e altre). A ogni evento estraiamo il contatto (nome / telefono / email), lo creiamo o aggiorniamo in SendApp e lo taggiamo con la piattaforma di provenienza (es. shopify). Non viene inviato alcun messaggio: raggiungi poi quei contatti con una Campagna (per tag) o via API.
| Parametro | Descrizione |
|---|---|
| tokenrequired | Token dell'account, nel path dell'URL. Determina quale account riceve i contatti. |
| sourceoptional | Query string, es. ?source=shopify. Usata come tag del contatto; in mancanza si usa lo User-Agent. |
{ "status": "ok", "contact": { "id": 12345 } }.200 con status: ignored, così la piattaforma di origine mantiene il webhook attivo.curl -X POST 'https://app.sendapp.ai/api/integrations/webhook/YOUR_ACCOUNT_TOKEN?source=shopify' \
-H 'Content-Type: application/json' \
-d '{
"email": "jon@example.com",
"customer": {
"first_name": "Jon",
"last_name": "Snow",
"phone": "+391234567890"
}
}'<?php
$ch = curl_init('https://app.sendapp.ai/api/integrations/webhook/YOUR_ACCOUNT_TOKEN?source=shopify');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'email' => 'jon@example.com',
'customer' => ['first_name' => 'Jon', 'last_name' => 'Snow', 'phone' => '+391234567890'],
]),
]);
echo curl_exec($ch);
curl_close($ch);const res = await fetch('https://app.sendapp.ai/api/integrations/webhook/YOUR_ACCOUNT_TOKEN?source=shopify', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
email: 'jon@example.com',
customer: { first_name: 'Jon', last_name: 'Snow', phone: '+391234567890' }
})
});
console.log(await res.json());Webhook di stato — WhatsApp Meta
Registra (POST) un URL sul tuo server per ricevere in tempo reale gli eventi di stato dei messaggi Meta (sent, delivered, read, failed) e gli eventi inbound. Ogni evento webhook di Meta viene inoltrato così com'è al tuo URL via HTTP POST. Usa DELETE per rimuovere il webhook registrato.
| Parametro | Descrizione |
|---|---|
| apikeyrequired | La tua API Key. |
| tokenrequired | Token dell'account. |
| urlrichiesto per POST | Il tuo URL server (HTTPS). Non necessario per la DELETE. |
# Registra il webhook
curl -X POST 'https://app.sendapp.ai/api/whatsapp-meta/set_webhook' \
-H 'Content-Type: application/json' \
-d '{ "apikey": "YOUR_API_KEY", "token": "YOUR_ACCOUNT_TOKEN", "url": "https://tuo-server.com/webhook" }'
# Rimuovi il webhook
curl -X DELETE 'https://app.sendapp.ai/api/whatsapp-meta/set_webhook' \
-H 'Content-Type: application/json' \
-d '{ "apikey": "YOUR_API_KEY", "token": "YOUR_ACCOUNT_TOKEN" }'<?php
// Registra il webhook
$ch = curl_init('https://app.sendapp.ai/api/whatsapp-meta/set_webhook');
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',
'url' => 'https://tuo-server.com/webhook',
]),
]);
echo curl_exec($ch);
curl_close($ch);// Registra il webhook
const res = await fetch('https://app.sendapp.ai/api/whatsapp-meta/set_webhook', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
apikey: 'YOUR_API_KEY',
token: 'YOUR_ACCOUNT_TOKEN',
url: 'https://tuo-server.com/webhook'
})
});
console.log(await res.json());Webhook di stato — SMS
Registra (POST) un URL sul tuo server per ricevere in tempo reale gli eventi SMS (sms_received, device.disconnected, device.reconnected, device.deleted). Ogni evento viene inoltrato al tuo URL via HTTP POST. Usa DELETE per rimuovere il webhook.
| Parametro | Descrizione |
|---|---|
| apikeyrequired | La tua API Key. |
| tokenrequired | Token dell'account. |
| urlrichiesto per POST | Il tuo URL server (HTTPS). Non necessario per la DELETE. |
# Registra il webhook
curl -X POST 'https://app.sendapp.ai/api/sms/set_webhook' \
-H 'Content-Type: application/json' \
-d '{ "apikey": "YOUR_API_KEY", "token": "YOUR_ACCOUNT_TOKEN", "url": "https://tuo-server.com/sms-webhook" }'
# Rimuovi il webhook
curl -X DELETE 'https://app.sendapp.ai/api/sms/set_webhook' \
-H 'Content-Type: application/json' \
-d '{ "apikey": "YOUR_API_KEY", "token": "YOUR_ACCOUNT_TOKEN" }'<?php
$ch = curl_init('https://app.sendapp.ai/api/sms/set_webhook');
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',
'url' => 'https://tuo-server.com/sms-webhook',
]),
]);
echo curl_exec($ch);
curl_close($ch);const res = await fetch('https://app.sendapp.ai/api/sms/set_webhook', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
apikey: 'YOUR_API_KEY',
token: 'YOUR_ACCOUNT_TOKEN',
url: 'https://tuo-server.com/sms-webhook'
})
});
console.log(await res.json());