title: API Gateway - Lambda Proxy - Python Internal server error
body: <p>I have issues parsing the input data from event in Python 3.7.</p>
  
  <pre><code>def lambda_handler(event, context):
   image = event['image']
   siteid = int(event['siteid'])
   camid = int(event['camid'])
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>Lambda execution failed with status 200 due to customer function error: 'image'.
  </code></pre>
  
  <p>Method request model:</p>
  
  <pre><code>{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "UploadModel",
    "type": "object",
    "properties": {
      "image": { "type": "string" },
      "siteid": { "type": "string" },
      "camid": { "type": "string" }
      }
  }
  </code></pre>
  
  <p>Use Lambda Proxy integration: ON</p>
  
  <p>It works fine directly from the lambda console with a simple input array:</p>
  
  <pre><code>{
      "image": "xxxx"
      "siteid": 2,
      "camid": 1
  }
  </code></pre>
  
  <p>Response function:</p>
  
  <pre><code>def response(message, status_code):
      return {
          "statusCode": str(status_code),
          "body": json.dumps(message),
          "headers": {
              "Content-Type": "application/json",
              "Access-Control-Allow-Origin": '*'
              },
          }
  </code></pre>