Dokumentation ›
Kontakte › Opt-in contatto
POST
Opt-in contatto
POSThttps://app.sendapp.ai/api/contacts/{id}/opt-in
Riattiva un contatto: rimuove l'opt-out così riceve di nuovo le campagne. Idempotente.
Parameter
apikey
erforderlich
La tua API Key (anche header
X-API-Key).
id
erforderlich
Kontakt-ID (Ganzzahl, im Pfad). Verwenden Sie
GET /api/contacts, um sie zu finden. Anfrage
curl -X POST 'https://app.sendapp.ai/api/contacts/42/opt-in' \
-H 'X-API-Key: YOUR_API_KEY'<?php
$ch = curl_init('https://app.sendapp.ai/api/contacts/42/opt-in');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
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/opt-in', {
method: 'POST',
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
console.log(await res.json());Antwort (200 OK)
{
"status": "success",
"changed": true,
"contact": { "id": 42, "opted_out": false, "...": "..." }
}Fehler
{
"status": "error",
"message": "Contact not found."
}