HomeYottly APIExport customers subscription status API

Export customers subscription status API

This API allows you to synchronize newsletter subscription status in Yottly with your system. You can load full list or only current changes (i.e. only customers with subscription status changed in time interval <from,now>) . If NLF_TIME is not available in the customers feed, the date of registration is considered instead. You can also choose if you want only currently subscribed or unsubscribed customers.

GET
https://api.yottly.com/shop/yottlyId/subscriptions?from=YYYY-MM-DD&state=subscription_state
header: X-Api-Key: your-api-key
  • yottlyId – Yottly ID of your eshop
  • your-api-key – Yottly API key for your eshop (Please ask us for the API key via email)
  • from – optional parameter, date in format YYYY-MM-DD (time is set to 00:00 at Europe/Prague timezone). Full history is returned if omitted.
  • state – optional parameter, one of subscribed, unsubscribed. All states are returned if omitted.

 

Response

JSON format – stream, one json object per line (application/json-seq):

{"customerId":"XYZ123", //ID of the customer
  "email":"xyz123@yottly.com", // email address of the customer
  "newsletterFrequency":"every day", //current newsletter subscription status of the customer: "every day"/"special occasions" = subscribed, "never" = unsubscribed
  "since":1526481188957 //timestamp (in miliseconds) of setting the current newsletter subscription status
}

Example

curl -H 'X-Api-Key: key' 'https://api.yottly.com/shop/4541245641234564/subscriptions?from=2018-04-19'
{"customerId":"XYZ123","email":"xyz123@yottly.com","newsletterFrequency":"every day","since":1526481188957}
{"customerId":"ABC123","email":"abc123@yottly.com","newsletterFrequency":"never","since":1526481188957}
{"customerId":"XAZ1R3","email":"xaz1r3@yottly.com","newsletterFrequency":"every day","since":1526481188957}
curl -H 'X-Api-Key: key' 'https://api.yottly.com/shop/4541245641234564/subscriptions?from=2018-04-19&state=subscribed'
{"customerId":"XYZ123","email":"xyz123@yottly.com","newsletterFrequency":"every day","since":1526481188957}
{"customerId":"XAZ1R3","email":"xaz1r3@yottly.com","newsletterFrequency":"every day","since":1526481188957}
Was this article helpful to you? Yes No