Hi all,
I need to check if a profile exists on my custom form submission. I already have the custom form submitting to Klaviyo through an API call. What I’d like to do is add another call before this, and check if the email exists already.
I’m attempting to use the example shown here: https://apidocs.klaviyo.com/reference/track-identify#identify-get
When I run this code, it returns a 1 every time, whether the email / profile exists or not.
Is there a way to check if the profile exists through this endpoint?
const options = {
method: 'POST',
headers: {Accept: 'text/html', 'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({
data: '{"token": "PUBLIC_KEY","properties": {"$email":"ben.franklin@klaviyo.com"}}'
})
};
fetch('https://a.klaviyo.com/api/identify', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
Many thanks for any advice.