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

319
Vistas
GetResponse Api integration Using fetch() is not working

GetResponse Api integration Using Fetch API method not working

The following SMS is showing in the console:

Cross-Origin Request Blocked: 
The Same Origin Policy disallows reading the remote resource at https://api.getresponse.com/v3/contacts.
(Reason: CORS header 'Access-Control-Allow-Origin' missing).

Code is given bellow:

// main.js

// POST request using fetch()
fetch("https://api.getresponse.com/v3/contacts", {
    
    // Adding method type
    method: "POST",
    
    // Adding body or contents to send
    body: JSON.stringify(
        {
            campaign : {
                campaignId: "5D8Qm"
            },
            name: "xyz",
            email: "fdfdfd@gmail.com"
        }
    ),
    
    // Adding headers to the request
    headers: {
        
        
        "X-Auth-Token": "api-key o9q5s264jbp9dws0nsevnagqdst81esh",
        "Content-type": "application/json"
    }
})

// Converting to JSON
.then(response => response.json())

// Displaying results to console
.then(json => console.log(json));
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

It's a classic CORS issue as azbarcea said.

As for your comment about why cURL works but Fetch API not, you can refer to this answer in Stack Overflow.

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