1 Answer
- Newest
- Most votes
- Most comments
0
Redirect may not be ideal for a REST API. If the API operations are similar and map 1:1 to the new API operations, you could proxy directly within API Gateway.
The flow to set this up would be:
- For each API operation in the old API determine which API operation in the new API to target
- In each API operation Integration Request settings, point to the new API operation using HTTP endpoint
- Any header, path parameter, query strings mapping or changes can be accomplished in the Integration Request in a mapping template
- Any POST Body adjustments can be accomplished in the Integration Request in a mapping template
- Any needs to map Response headers, body, or type can be accomplished in the Integration Response
answered a year ago
Relevant content
- asked 10 months ago
- AWS OFFICIALUpdated 3 months ago
- AWS OFFICIALUpdated 4 years ago
- AWS OFFICIALUpdated a year ago
Thank you for the answer cyrk-aws. And then what do I need to do in my old site so it knows the request should go to API Gateway?
The approach I described will work if the old API is in API Gateway. This way you control what the backend integration points to and make the changes to point to another API.
If you don't have control over the old API then you will need to modify the old app/site to point to the new API. But that doesn't help your problem of users not updating the app.
Thank you so much cyrk-aws, To elaborate a little more, our old APIs are in Magento at them moment... our domain is set to point to the magento site, we will then change the domain to point to the new wordpress site...so for example....
Currently the login API is www.ourdomain.com/rest/v1/login/token
Our new API, once we change the domain to point there will be www.ourdomain.com/wp-json/jwt-auth/token
I'm assuming that after the domain is changed to point to the new website the old API will try to go to the new site right?
So i would need the www.ourdomain.com/rest/v1/login/token gets redirected with header and body to www.ourdomain.com/wp-json/jwt-auth/token
So no API are managed through API Gateway. Does that help understand my situation better? Would this work?