How to Mock API Gateway Endpoints for Frontend Development?
A developer is building an application that will use an Amazon API Gateway API with an AWS Lambda backend. The team that will develop the frontend requires immediate access to the API endpoints to build the UI. To prepare the backend application for integration, the developer needs to set up endpoints. The endpoints need to return predefined HTTP status codes and JSON responses for the frontend team. The developer creates a method for an API resource. Which solution will meet these requirements?
Community Votes
100% of anonymous learners picked answer B. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
This question tests knowledge of API Gateway MOCK integration type and the correct mapping layers: integration request defines the JSON response template, while integration response maps it to specific HTTP status codes.
To provide predefined HTTP status codes and JSON responses without a real backend, use API Gateway MOCK integration with configured integration request and integration response mappings. This enables frontend teams to develop against stable API contracts immediately.
Candidates often choose option D, confusing method request with integration request. Method request defines parameters (headers, query strings, path params) for the client-facing interface, while integration request transforms the request sent to the backend or defines mock response templates.
Community Discussion (4 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Understanding the Requirement
The scenario requires predefined HTTP status codes and JSON responses without an actual backend. This is a classic use case for MOCK integration in Amazon API Gateway, which allows you to simulate API behavior during frontend development.
Why Option B is Correct
Option B correctly identifies two critical steps:
1. Set integration type to MOCK — This tells API Gateway to respond without invoking any backend service. 2. Configure integration request and integration response — In a MOCK integration: - The integration request defines the static JSON response template (the body). - The integration response maps that response to a specific HTTP status code (e.g., 200, 404, 500) based on conditions or default mappings.
This two-layer mapping is exactly how MOCK integrations work in API Gateway.
Why Option D is Wrong
Option D incorrectly states that method request defines HTTP status codes. This is a fundamental misunderstanding:
- Method request defines the client-facing contract: required headers, query string parameters, path parameters, and request body schema. It does not define HTTP status codes or response bodies.
- Integration response is where HTTP status codes are mapped and returned to the client.
Why Options A and C are Wrong
- Option A (AWS_PROXY): Requires provisioning actual Lambda functions, which contradicts the requirement for predefined responses without backend development.
- Option C (HTTP_PROXY): Requires an external placeholder API, adding unnecessary infrastructure and complexity when MOCK integration serves the purpose perfectly.
Community Consensus
The community unanimously agrees on Option B (100% vote distribution), confirming that MOCK integration with proper integration request/response configuration is the standard approach for this scenario.
Official Reference
Exam Strategy
When you see keywords like 'predefined responses,' 'mock,' or 'frontend needs endpoints before backend is ready,' immediately think MOCK integration. Remember the mapping hierarchy: method request/response defines the client interface, while integration request/response handles backend communication or mock response templates.
Related Analysis
Practice All DVA-C02 Questions
Access 100 questions with complete answers and detailed explanations.
View Full DVA-C02 Practice Test →