Data transformations for REST APIs in API Gateway - Amazon API Gateway

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) and applied to the payload using JSONPath expressions.

The payload can have a data model according to the JSON schema draft 4. To learn more about models, see Data models for REST APIs.

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.