Newsletter
Business+Verwalten Sie Newsletter-Abonnenten.
Erforderliche Bereiche:
newsletter
Endpunkte
GET
/api/v1/newsletter
Alle Abonnenten auflisten
POST
/api/v1/newsletter
E-Mail-Adresse abonnieren
DELETE
/api/v1/newsletter/{id}
Nach Abonnenten-ID abmelden
DELETE
/api/v1/newsletter
Nach E-Mail-Adresse abmelden
Abfrageparameter
| Parameter | Beschreibung |
|---|---|
search
|
Suchbegriff zum Filtern der Ergebnisse |
status
|
Nach Abonnentenstatus filtern (confirmed, pending, unsubscribed) |
from_date
|
Abonnenten ab diesem Datum filtern (ISO 8601) |
to_date
|
Abonnenten bis zu diesem Datum filtern (ISO 8601) |
sort
|
Sortierfeld (email, name, created_at, confirmed_at) |
order
|
Sortierrichtung (ASC oder DESC, Standard: DESC) |
Request-Schema
| Parameter | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
email
|
string | Ja | E-Mail-Adresse zum Abonnieren (erforderlich) |
name
|
string | Nein | Name des Abonnenten |
send_confirmation
|
boolean | Nein | Ob eine Bestätigungs-E-Mail gesendet werden soll (Standard: true) |
Response-Schema
| Feld | Typ |
|---|---|
id
|
integer |
email
|
string |
name
|
string|null |
contact_id
|
integer|null |
status
|
string |
confirmed_at
|
string|null |
unsubscribed_at
|
string|null |
created_at
|
string |
Codebeispiele
curl -X GET "https://your-tenant.plandocket.com/api/v1/newsletter" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"
<?php
$apiKey = 'YOUR_API_KEY';
$baseUrl = 'https://your-tenant.plandocket.com';
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => $baseUrl . '/api/v1/newsletter',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Content-Type: application/json',
],
]);
$response = curl_exec($ch);
$data = json_decode($response, true);
curl_close($ch);
print_r($data);
const apiKey = 'YOUR_API_KEY';
const baseUrl = 'https://your-tenant.plandocket.com';
const response = await fetch(`${baseUrl}/api/v1/newsletter`, {
method: 'GET',
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
});
const data = await response.json();
console.log(data);
import requests
api_key = 'YOUR_API_KEY'
base_url = 'https://your-tenant.plandocket.com'
headers = {
'Authorization': f'Bearer {api_key}',
'Content-Type': 'application/json',
}
response = requests.get(f'{base_url}/api/v1/newsletter', headers=headers)
data = response.json()
print(data)
Beispiel-Antwort
200 OK
{
"data": {
"newsletter_id": 1,
"created_at": 1704067200,
"updated_at": 1704067200
},
"meta": {
"request_id": "req_abc123"
}
}