I have to update the profile's property in klaviyo with API. so I made this JS. but for some reasons, it doesn't work with me! This is API guide to update profile's property. I followed it but showing this issue! Could someone help me to fix this issue? many thanks
https://apidocs.klaviyo.com/reference/profiles#update-profile
const options = {method: 'PUT', headers: {'Accept': 'application/json', 'Access-Control-Allow-Origin': '*'}};
fetch('https://a.klaviyo.com/api/v1/person/01FHGADW5PW4SF33JMWPSN9KQX?api_key=pk_d3af8ba75d110725231231ba795f05ffe77fb&$locale=es-US', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
Also, this ajax's result is the same. still showing the same issue. I'd like to get profile info! The first is to update the profile, second is to get profile info. but all is not working! very sad!
var $email = '1919@gmail.com';
$.ajax({
type: 'POST',
url: `https://a.klaviyo.com/api/v2/people/search?api_key=pk_d3af8ba75d110725231123ba795f05ffe77fb&email=${$email}`,
success: function(res){
console.log(res);
}
});