Lokalisiert durch KI

Abonnent hinzufügen

const response = await fetch('https://api.emailit.com/v2/audiences/aud_1234567890/subscribers', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer em_test_51RxCWJ...vS00p61e0qRE',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    email: 'max.mustermann@beispiel.de',
    first_name: 'Max',
    last_name: 'Mustermann',
    custom_fields: {
      company: 'Musterfirma GmbH',
      role: 'Entwickler'
    }
  })
});

const result = await response.json();

Antworten

{
  "object": "subscriber",
  "id": 1234567890,
  "audience_id": 1234567890,
  "contact_id": 1234567890,
  "email": "max.mustermann@beispiel.de",
  "first_name": "Max",
  "last_name": "Mustermann",
  "custom_fields": {
    "company": "Musterfirma GmbH",
    "role": "Entwickler"
  },
  "subscribed": true,
  "subscribed_at": "2021-01-01T00:00:00Z",
  "unsubscribed_at": null,
  "created_at": "2021-01-01T00:00:00Z",
  "updated_at": "2021-01-01T00:00:00Z"
}