Data transformations for REST APIs in API Gateway
In API Gateway, an API's method request can take a payload in a different format from the integration request payload. Similarly, the backend may return an integration response payload different from the method response payload. You can map URL path parameters, URL query string parameters, HTTP headers, and the request body across API Gateway using mapping templates.
A mapping template is a script expressed in Velocity Template Language (VTL)
The payload can have a data model according to the JSON schema draft 4
Note
You don't have to define any model to create a mapping template, but you must define a model in order to have API Gateway to generate a SDK or to turn on request body validation for your API.
Topics
- Mapping templates for REST APIs
- Set up data transformations in API Gateway
- Use a mapping template to override an API's request and response parameters and status codes
- Set up request and response data mappings using the API Gateway console
- Example data models and mapping templates for API Gateway
- Amazon API Gateway API request and response data mapping reference
- API Gateway mapping template and access logging variable reference