Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

352
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!