Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

338
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda