Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

239
Vistas
Access to fetch has been blocked by CORS policy - Fetch() JS issue

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

enter image description here

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);
    }
  });
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

The access control header has to be put on the server, not on the client. If you don't control the server, there's nothing you can do about this.

about 4 years ago · Juan Pablo Isaza Denunciar

0

Putting you private key in a browser is a terrible idea. It allows ANY visitor to your website to then be able to access all of your admin API.

Klaviyo explicitly does not support CORS on the API requests for exactly this reason. See Klaviyo's response to a similar question here. https://community.klaviyo.com/apis-40/does-klaviyo-api-support-cors-requests-704?postid=2253#post2253

The correct way to do this is to have a server that you control make the requests to Klaviyo's api. You can make requests to your server from the JS.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda