My base url is https://org.apigee.net/base which covers https://myrealurl.com/v1
I want to add different endpoints like /plants which would cover https://myrealurl.com/v1/plants.json
I cannot figure out how to do this. Do I create a route rule? If so, can you please provide me with the exact code and where to place it.
This is not working.
<RouteRule name="plants"> <Condition>(proxy.pathsuffix MatchesPath "/plants") and (request.verb = "GET")</Condition> <URL>https://myrealurl.com/v1/plants.json</URL></RouteRule>
Solved! Go to Solution.
You should have an API Proxy bundle.
Within that, a single API Proxy endpoint, with basepath /base
Within that, 2 flows. One with a condition like
<Condition>(proxy.pathsuffix MatchesPath "/plants") and (request.verb = "GET")</Condition>
Another with no condition. This second is your "default" flow, and we'll use it to catch invalid requests.
Then have one target, which uses https://myrealurl.com/v1/plants.json as the target url. One last twist: use an AssignMessage to tell Apigee Edge to NOT append the inbound pathsuffix to the outbound request.
Here's a screencast showing how to construct it, interactively.
Here's a working API proxy that does what you want, the output of the exercise I went through above: