Bird
0
0

You configured API Gateway to integrate with DynamoDB PutItem but receive a 400 Bad Request error. Which of these is the most likely cause?

medium📝 Debug Q14 of 15
DynamoDB - with Serverless
You configured API Gateway to integrate with DynamoDB PutItem but receive a 400 Bad Request error. Which of these is the most likely cause?
AMissing required 'Item' field in the request mapping template
BUsing HTTP GET method instead of POST
CIncorrect table name in the DynamoDB action
DNot enabling CORS on API Gateway
Step-by-Step Solution
Solution:
  1. Step 1: Understand PutItem requirements

    PutItem requires an 'Item' field specifying the data to insert; missing it causes a bad request.
  2. Step 2: Evaluate other options

    Using GET instead of POST may cause issues but usually not 400 if mapping is correct; wrong table name causes 500 errors; CORS issues cause client-side errors, not 400 from API Gateway.
  3. Final Answer:

    Missing required 'Item' field in the request mapping template -> Option A
  4. Quick Check:

    PutItem needs 'Item' field [OK]
Quick Trick: PutItem must include 'Item' in request template [OK]
Common Mistakes:
MISTAKES
  • Confusing HTTP method errors with mapping errors
  • Ignoring required fields in request templates
  • Assuming CORS causes 400 errors

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More DynamoDB Quizzes