A newsletter subscription is be made by selecting the checkbox "I want to subscribe to the newsletter" on the donation form.
Get a list of newsletter subscriptions for the current site.
GET /v1/newsletter-subscriptions
The result will be returned as JSON with a newsletter_subscriptions
key. This will be an array with objects containing Newsletter subscription attributes.
Curl example:
curl -H "X-Api-Key: 12345" https://api.digicollect.nl/v1/newsletter-subscriptions
Example response body:
{
"newsletter_subscriptions": [
{
"id": 1,
"created_at": "2017-07-07T13:55:43Z",
"updated_at": "2017-07-07T13:55:43Z",
"email": "john.doe@digicollect.nl",
"locale": "nl"
}
],
"links": {
"pages": {
"last": "https://api.digicollect.nl/v1/newsletter-subscriptions?page=5&per_page=1",
"next": "https://api.digicollect.nl/v1/newsletter-subscriptions?page=2&per_page=1"
}
},
"total_entries": 5,
"total_pages": 5,
"per_page": 1,
"current_page": 1
}
Retrieve a single newsletter subscription for the current site.
GET /v1/newsletter-subscriptions/1
The result will be returned as JSON with a newsletter_subscription
key. This will be an object containing Newsletter subscription attributes.
Curl example:
curl -H "X-Api-Key: 12345" https://api.digicollect.nl/v1/newsletter-subscriptions/1
Example response body:
{
"newsletter_subscription": {
"id": 1,
"created_at": "2022-09-26T14:50:14Z",
"updated_at": "2022-09-26T14:50:14Z",
"email": "john.doe@digicollect.nl",
"locale": "nl",
"consents": [
{
"consent_type": "newsletter_subscription",
"consent_status": "granted",
"granted_at": "2022-09-26T14:50:14Z",
"consent_text": "Op onze dienstverlening zijn onze <a href='/algemene-voorwaarden' target='_blank'>Algemene Voorwaarden</a> & <a href='/privacy' target='_blank'>Privacyverklaring</a> van toepassing.",
"url": "https://demo1.digicollect.nl/john-doe",
"terms_conditions_version": "V5 22-06-2016 13:09",
"privacy_version": "V2 07-12-2018 08:34"
}
]
}
}
A newsletter_subscription
response object contains the following attributes:
Name | Type | Description |
---|---|---|
id | number | Unique identifier for this newsletter subscription. |
created_at | string | The time (ISO 8601 format) when the newsletter subscription was created. |
updated_at | string | The time (ISO 8601 format) when the newsletter subscription was last updated. |
string | The email address of the subscription. | |
locale | string | The locale that was used while submitting the subscription form (nl , en , de , etc). |
consents | array | List of consents associated with the newsletter subscription. See Newsletter subscription - Consent object. optional |
This object contains information about a specific consent an user has given.
Some consents can also be revoked later on by the user, after which the status will change to revoked
and the attribute revoked_at
will be returned.
Attribute | Type | Description |
---|---|---|
consent_type | string | Type of consent. See below for possible values with their description. |
consent_status | string | Status of the consent (granted or revoked ). |
granted_at | string | The time (ISO 8601 format) when the consent was granted. |
revoked_at | string | The time (ISO 8601 format) when the consent was revoked. optional |
consent_text | string | The consent text the user has agreed to. |
url | string | The URL of the webpage where the consent was given. |
terms_conditions_version | string | Version of terms and conditions when the consent was given. |
privacy_version | string | Version of privacy statement when the consent was given. optional |
Available consent types are:
Consent type | Description |
---|---|
newsletter_subscription | Accepting to receive the newsletter. |