title: Python lambda function returns KeyError
body: <p>I'm trying to create simple Lambda function using Python 3.6.</p>
  
  <p>The function should get a userId (my primary key in DynamoDB) in the  request query string params and returns 200 if item exist in DB, here is my lambda function</p>
  
  <pre><code>import boto3
  import os
  from boto3.dynamodb.conditions import Key, Attr
  
  def lambda_handler(event, context):
  
    userId = event["userId"]
  
    dynamodb = boto3.resource('dynamodb')
    table = dynamodb.Table(os.environ['Customers'])
    items = table.query(
    KeyConditionExpression=Key('userId').eq(userId)
    )
  
    return items["Items"]
  </code></pre>
  
  <p>When i am doing tests in Lambda interface it works and return the correct user however,  when trying from Postman or using API Gateway it returns the following error </p>
  
  <pre><code>{
  "errorMessage": "'userId'",
  "errorType": "KeyError",
  "stackTrace": [
      [
          "/var/task/index.py",
          7,
          "lambda_handler",
          "userId = event["userId"]"
      ]
  ]
  }
  </code></pre>
  
  <ul>
  <li>What am i missing here ?</li>
  <li>Struggling to understand "event"  ,  documentation states its a python 
  dictionary but how can i print the result of it and actually debug the lambda 
  when called from Postman or API Gateway?</li>
  </ul>