klaviyo / php-klaviyo

PHP wrapper for the Klaviyo API
59 stars 47 forks source link

Statuscode always 200 even with wrong public API-Key? #36

Closed DannyDan closed 3 years ago

DannyDan commented 3 years ago

I try to implement a API-Testbutton for testing the connection to Klaviyo, but I always get back a 1 even when using a wrong public api-key. Also the statuscode from the curl call is always 200?!?

remstone7 commented 3 years ago

Hey Danny, that's actually not an issue with this wrapper its how the api operates. To read more about the track api and how it responds, please see here: https://www.klaviyo.com/docs/http-api#track

DannyDan commented 3 years ago

What I dont understand is, why I'm not getting a 0 back when using the wrong public api-key?!? The documentation says: Responses 1 Success 0 Failure When exactly will I get a 0 back from my call?

remstone7 commented 3 years ago

You would get a 0 if the payload itself is invalid, basically the check on the web tier is to just make sure the payload itself is valid and contains the correct information api key, event data, etc.. but we don't validate the api key until later downstream this is why you're seeing this behaviour

DannyDan commented 3 years ago

ok. not the answer I was hoping for, but thanks for clearing this.