title: AWS API Gateway working from POSTMAN, but not from AWS Lambda function
body: <p>I have an API gateway, which is working from the POSTMAN, using a valid access token, but when I call the same API gateway from inside Lambda function, I am getting 403 access denied error for the same access token. I am not sure where I am missing something. It's really weird, where everything from URL, API_KEY, access token, JSON body is the same, but worked differently in both services.</p>
  <p>Please let me know if you have some pointers.</p>
  <p>Here is the function that I am using for calling API Gateway -</p>
  <pre><code>    return new Promise((resolve, reject) =&gt; {
      var options = {
          'method': 'POST',
          'url': 'https://XXXXXXXX.execute-api.ap-south-1.amazonaws.com/dev/Patient',
          'headers': {
            'Content-Type': 'application/json',
            'X-Api-Key': 'XXXXXXXX',
            'Authorization': 'Bearer ' + accessToken
          },
          body: JSON.stringify({&quot;resourceType&quot;:&quot;Patient&quot;,&quot;active&quot;:true,&quot;name&quot;:[{&quot;family&quot;:&quot;Smith&quot;,&quot;given&quot;:[&quot;Emily&quot;]}],&quot;gender&quot;:&quot;female&quot;,&quot;birthDate&quot;:&quot;1995-09-24&quot;,&quot;identifier&quot;:[&quot;1221212121&quot;],&quot;managingOrganization&quot;:{&quot;reference&quot;:&quot;Organization/2.16.840.1.113883.19.5&quot;,&quot;display&quot;:&quot;Good Health Clinic&quot;}})
        
      };
      
      request(options, function (error, response) {
        if (error) throw new Error(error);
        console.log(response.body);
      });
      
    });
  </code></pre>
  <p>Thanks</p>