The subscriber sync API is an API that you need to develop in your shop so that Releva can periodically sync its internal subscriber list from your shop’s subscriber list.
Do I need to develop it? #
You need to develop this functionality if your shop has built-in mechanisms to collect marketing consent into a database you own, as well as if your don’t have a single unsubscribe page that all users can use, but instead each subscriber gets a unique unsubscribe link . In the other cases, you can just prepare a CSV with your subscribers and import it into Releva with the procedure described here.
Request Format #
Releva will perform the following curl equivalent:
curl -H 'authorization: Bearer <secretKey>' -H 'Content-Type: application/json' -XGET https://your-awesome-shop.com/releva/subscribers?page=N
Response Format #
Releva will expect you to provide a JSON response with HTTP status 200
and the following structure. Your response should contain 20-50 subscribers.
{
"pageCount": 123,
"subscribers": [
{
"email": "subscribed-example@releva.ai",
"subscribedAt": "2022-01-01T05:00:00.000Z",
"subscriptions": [
"newsletter"
],
"unsubscribeLink": "...",
},
{
"email": "not-subscribed-example@releva.ai",
"subscribedAt": null
}
]
}
The subscribers Array #
Each element in this array should have the following structure:
Field | Type | Description |
---|---|---|
String | The email address of the subscriber | |
subscribedAt | ISO 8601 String (Optional) | The date and time when this subscriber has given their consent or null if they are not subscribed. |
unsubscribeLink | String (Optional) | The URL where the user can unsubscribe. If this is ommitted, it will use the default unsubscribe URL configured for this shop in Releva. |
subscriptions | Array[String] (Optional) | List of subscriptions that the user has given their consent for. These are user defined and can later be used to build segments and send marketing communication to the subscribers who have opted in for this specific type of communication. |
consent | String (Optional) | Subscriber’s consent, may be one of these: legitimateInterest – this is the default one, and every user has this consent by default privacyPolicy mandatoryCookies cookiesPolicy |