When I query my Invoke URL as https://xxx.execute-api.yyy.amazonaws.com/test/q?apiKey=AAA with my below setup my backend receives a call as https://api.mysite.com/q?apiKey=AAA&apiKey=111: one apiKey=AAA comes from the client, the second one - apiKey=111 comes from the Integration Request configuration.
Question:
What/How should I configure an integration that apiKey=AAA either removed from the client call or replaced on the integration step with 111 value so that only one apiKey comes to the backend?
Note:
- with proxy passthrough integration the Mapping Templates are not available;
- the reason for such configuration is that my legacy backend has a big amount of endpoints which is not possible to configure individually.
My setup:
- I have created a new REST API.
- Then I have created a new Configure as a Proxy resource named
proxywith a Resource Path/{proxy+}with the following setup forANYmethod as a proxy integration:- Integration type
HTTP Proxy - Endpoint URL:
https://api.mysite.com/{proxy} - Content Handling:
Passthrough
- Integration type
- As a next step, I have configured an
Integration Requestfor my/{proxy+} - ANYby adding a new query string to theURL Query String Parameterssection:- Name:
myApiKey - Mapped from:
'111'
- Name:
- Then I click
Deploy APItoteststage and gettingInvoke URL, let's say:https://xxx.execute-api.yyy.amazonaws.com/test.