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

350
Vistas
POST Request is working on Postman but getting 403 in JS

I have tested an API https://connect.us-east-1.amazonaws.com/contact/suspend-recording with POST request in postman successfully and getting the 200 statuscode and it is working absolutely fine and suspend/pause the call recording according to the desired goals. I generate the code by using POSTMAN Code Snippet and used it in my project/code and than when i test it, it throw 403 forbidden error. POSTMAN Header 403 Error In Inspection -> Network -> Response {"message":"Signature expired: 20220324T135827Z is now earlier than 20220325T072547Z (20220325T073047Z - 5 min.)"} Response In Inspection -> Network -> Headers enter image description here

function pauseRecording(){
//let contactId = contactId; //document.getElementById("contactId").value;

alert("ContactId Alert:" + contactId)
var settings = {
    "crossDomain": true,
    "url": "https://connect.us-east-1.amazonaws.com/contact/suspend-recording",
    "method": "POST",
    "timeout": 0,
    "headers": {
      "X-Amz-Content-Sha256": "beaead3198f7da1e70d03ab969765e0821b24fc913697e929e726aeaebXXXXXX",
      "X-Amz-Date": "20220324T135827Z",
      "Authorization": "XXXX-XXXX-SHA256 Credential=XXXXXXI7HVAVPV5LNWQN/20220324/us-east-1/connect/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=XXXXXXde1fc213ebf2191ebc518e01858fb6cc024773db9133deb7fbebc59XXX",
      "Content-Type": "application/json"
    },
    "data": JSON.stringify({
      "ContactId": contactId,
      "InitialContactId": contactId,
      "InstanceId": "XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
    }),
  };
  
  $.ajax(settings).done(function (response) {
    console.log(response);
  });
}

HTML Button: <button onclick="pauseRecording()">Pause Recording</button> Any Solution Please?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

First give us response body, I assume you getting CORS error. You calling this api from browser, so it means request goes from client side (from browser). So your response error telling you about CORS error. It means you have to configure CORS in your API disabling your CORS origin ...

Related document

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