title: AWS API Gateway deployed API can't parse request body
body: <p>I have a Lambda function integrated with API Gateway and the stack was deployed as cloud formation template. When I try to test the endpoint in the AWS web console I got correct response but when I try to invoke the deployed version of the API I got that error.</p>
  
  <pre><code>"message": "Could not parse request body into json: Unrecognized token ....etc"
  </code></pre>
  
  <p>I tried this mapping <code>{ "body" : $input.json('$') }</code> in the integration request, but didn't work.</p>
  
  <p>Here is the JSON I am trying to send using POSTMAN</p>
  
  <pre><code>{
      "description": "test description",
      "status": "test status"
  }
  </code></pre>
  
  <p>and the request has header: <code>Content-Type: application/json</code></p>
  
  <p>Here you are screenshots for POSTMAN request body &amp; headers, and the response from the API:</p>
  
  <p><a href="https://i.stack.imgur.com/ibndR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ibndR.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/LRARh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LRARh.png" alt="enter image description here"></a></p>
  
  <p>Any Solution guys?</p>
  
  <h2>UPDATE:</h2>
  
  <p>I put a mapping template at integration request level as the following: </p>
  
  <pre><code>{
     "body-json" : $input.json('$')
  }
  </code></pre>
  
  <p>And updated the lambda function to log the coming request, then made 2 requests:</p>
  
  <h3>First one: from API Gateway test web console:</h3>
  
  <p>I found the following in the cloudwatch logs:</p>
  
  <pre><code>INFO    {
    body: {
      description: 'test',
      projectId: 23,
      action: 'test',
      entity: 'test',
      startDate: '01-01-2020',
      endDate: '01-01-2020'
    }
  }
  </code></pre>
  
  <h3>Second one: from POSTMAN:</h3>
  
  <p>I found the following in the cloudwatch logs:</p>
  
  <pre><code>INFO    {
    body: 'ewogICAgImRlc2NyaXB0aW9uIjogInRlc3QiLAogICAgInByb2plY3RJZCI6IDIzLAogICAgImFjdGlvbiI6ICJ0ZXN0IiwKICAgICJlbnRpdHkiOiAidGVzdCIsCiAgICAic3RhcnREYXRlIjogIjAxLTAxLTIwMjAiLAogICAgImVuZERhdGUiOiAiMDEtMDEtMjAyMCIKfQ=='
  }
  </code></pre>
  
  <p>That indicates that in case of making the request using POSTMAN, the JSON payload is stringified automatically. What can cause such thing? and how to deal with it?</p>