klaviyo / magento2-klaviyo

37 stars 51 forks source link

subscriber api endpoint #25

Closed remstone7 closed 5 years ago

remstone7 commented 5 years ago

It appears we don't get customers who subscriber as a guest as the hooks don't fire. this is to expose 2 api endpoints to be able to query this data.

  1. for historical sync by id's (batching)
  2. for periodic date pull (since param)

Endpoints:

@param mixed $start
@param mixed $until
@param mixed $store_id

/V1/klaviyo/reclaim/customers/subscriptions/periodic Ex

rest/V1/klaviyo/reclaim/customers/subscriptions/periodic?start=2019-04-25%20:00:00&until=2019-04-25%2018:00:00:00
@param mixed $start_id     
@param mixed $end_id         
@param mixed $store_id

/V1/klaviyo/reclaim/customers/subscriptions/historical

http://magento2.local:8888/rest/V1/klaviyo/reclaim/customers/subscriptions/historical?start_id=1&end_id=10
klaviyojad commented 5 years ago

I dont get the naming convention you use, periodic vs historical? Why not just call it getSubscribedsById and getSubscribersByDateRange?