Parameter mapping for REST APIs in API Gateway (original) (raw)

Note

In parameter mapping, you map request or response parameters. You can map parameters using parameter mapping expressions or static values. For a list of mapping expressions, see Parameter mapping source reference for REST APIs in API Gateway. You can use parameter mapping in your integration request for proxy and non-proxy integrations, but to use parameter mapping for an integration response, you need a non-proxy integration.

For example, you can map the method request header parameter puppies to the integration request header parameter DogsAge0. Then, if a client sends the header puppies:true to your API, the integration request sends the request header DogsAge0:true to the integration endpoint. The following diagram shows the request lifecycle of this example.

Diagram of API Gateway parameter mapping example for a request

To create this example using API Gateway, see Example 1: Map a method request parameter to an integration request parameter.

As another example, you can also map the integration response header parameter kittens to the method response header parameter CatsAge0. Then, if the integration endpoint returns kittens:false, the client receives the header CatsAge0:false. The following diagram shows the request lifecycle of this example.

Diagram of API Gateway parameter mapping example for a response

Topics

Data transformations

Parameter mapping examples

Did this page help you? - Yes

Thanks for letting us know we're doing a good job!

If you've got a moment, please tell us what we did right so we can do more of it.

Did this page help you? - No

Thanks for letting us know this page needs work. We're sorry we let you down.

If you've got a moment, please tell us how we can make the documentation better.