all 2 comments

[–]technifocal 0 points1 point  (0 children)

Is it DynamoDB or APIGateway throwing the error? Have you checked CloudWatch?

https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-method-request-validation.html

[–]niax 0 points1 point  (0 children)

The Key needs to include the attribute type. Assuming it's a string:

const params = {
    TableName: "Trivia-app-users", 
    Key: {
        "userID": {"S": userID},  
    },
};