We are providing a number of API's so that we can integrate with other services as easy as possible.
To try this out I initially set up a simple API based on a list of contacts. I end up with two simple (GET) URL's such as the following, both work as expected:
1. ./ClientPortal/rest/v1/contacts/
2. ../ClientPortal/rest/v1/contacts/{email}
The base URL = /ClientPortal/rest/v1
What I'd like to know is if I can adapt the base URL in any way? From what I've read the "rest" part has to remain and the other two are dependent on the module name (ClientPortal) and the version number (v1).
For example could I have something like = /api/v1 which maps to /ClientPortal/rest/v1?
I see there is a possibility to use SEO Friendly URLs, would that work in this respect? If so are there any downsides to this?
I also tried setting up a reverse proxy using NGINX and re-writing URL's but haven't got it working yet. The errors usually to do with swagger libs not being found properly when accessing the swagger documentation page.
Are there perhaps other approaches or ideas to get this working?
Hi Colin,
As far as I know this isn't possible. The path for an expose REST service will always contain the Module name followed by /rest, followed by the name of the REST API (which could be "v1" as in your case, though if you have more than one API in the same module, that wouldn't work of course).
I'm not sure about SEO friendly URLs though, that might work. Did you try it already?
Here's a discussion around this topic you might find interesting.
Regards,
Nordin
Which basically confirms what I wrote above :D.
Thanks for the feedback so far. The replies and links correspond to what I have heard already from others and is a bit disappointing from our perspective.
I am now looking into a different solution based on an API gateway we have in our organisation which would also give us additional security options and caching etc. I would then have OS API behind this and initial results are positive albeit with some additional implementation work I didn't want to do LOL