Documentazione ›
Contatti › Leggi contatto
GET
Leggi contatto
GEThttps://app.sendapp.ai/api/contacts/{id}
Restituisce un singolo contatto con tutto ciò che gli è associato: tag, campi personalizzati (per nome), stato opt-out, operatore responsabile, fase del ciclo di vita e contatori di interazione.
Parametri
apikey
obbligatorio
La tua API Key (anche header
X-API-Key).
id
obbligatorio
ID del contatto (intero, nel path). Usa
GET /api/contacts per trovarlo. Richiesta
curl '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 => 'GET',
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: 'GET',
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
console.log(await res.json());Risposta (200 OK)
{
"status": "success",
"contact": {
"id": 42,
"name": "Mario Rossi",
"phone": "+393331234567",
"email": "mario@example.com",
"birthday": "1985-04-12",
"tags": ["cliente", "vip"],
"custom_fields": { "City": "Milano", "Buy status": "active" },
"metadata": { "source": "api" },
"opted_out": false,
"opted_out_at": null,
"opted_out_reason": null,
"owner": { "id": 3, "name": "Giulia" },
"lifecycle_stage": "customer",
"engagement": {
"last_interaction_at": 1757260800,
"last_inbound_at": 1757260800,
"last_outbound_at": 1757174400,
"conversations_count": 2,
"primary_channel": "whatsapp"
},
"created_at": 1752400000,
"updated_at": 1757260800
}
}Errore
{
"status": "error",
"message": "Contact not found."
}