Hello
fetch('https://a.klaviyo.com/api/v2/list/Xa9enW/members?api_key=xxxxxxxxxxxxxxxxxxxxxxxxxxx&emails=ABC123@gmail.com', {
mode: "no-cors",
method: "GET",
headers: {
"Accept": "application/json"
}
}).then(function (response) {
return response.json();
})
.then(function (data) {
appendData(data);
})
.catch(function (err) {
console.log('error: ' + err);
});
function appendData(data) {
alert(data0.id]); // not working
var mainContainer = document.getElementById("myData");
for (var i = 0; i < data.length; i++) {
var div = document.createElement("div");
div.innerHTML = 'Name: ' + datai].id + ' ' + datai].created;
mainContainer.appendChild(div);
}
}
Hello I am running this api to get whether this email is in list or i am getting data inside response.json but i have created appenddata function in which i want to show this email in page but it is returning nothing appendData(data); this is not returning anything what wrong i am doing i dont know please help
Also please help me how to pass dynamic email in api for example
https://a.klaviyo.com/api/v2/list/Xa9enW/members?api_key=xxxxxxxxxxxxxxxxxxxxxxxxxxx&emails={{cutomer.emial}}
when i am passing this it is giving me error