AWS Certified Developer Associate DVA-C01 – Question335

A developer is building a WebSocket API using Amazon API Gateway. The payload sent to this API is JSON that includes an action key. This key can have three different values: create, update, and remove. The developer must integrate with different routes based on the value of the action key of the incoming JSON payload.
How can the developer accomplish this task with the LEAST amount of configuration?

A.
Deploy the WebSocket API to three stages for the respective routes: create, update, and remove
B. Create a new route key and set the name as action
C. Set the value of the route selection expression to action
D. Set the value of the route selection expression to $request.body.action

Correct Answer: B