I have an existing rest API created in OutSytems which can be accessed from
https://xxxxx.outsystemsenterprise.com/[module_name]/rest
But I want to create a new version for the same API and would like to expose it as
https://xxxxx.outsystemsenterprise.com/[version]/[module_name]/rest
Anyone know how to do this in OutSystems?
Thanks,
Constance
Hi Constance,
What you want is not possible with OutSystems. However, you can easily add the version to the path that the Platform generates:
https://xxxxx.outsystemsenterprise.com/[module_name]/rest/[api_name]/v2
Of course, this means you must add that to every method you expose, but on the other hand, this also allows for a per-method versioning.
Thanks for your reply.
You're most welcome. If my answer helped you solve your problem, could you please mark it as solution? Thanks.
for this case, I think it is more convenient to clone the api module and change the url
Thanks and best regards
I don't think so, that would mean you'd have to maintain two seperate modules instead of a single one, and have a different module name does not have a clear indication it's a different version.
It should depend on the purpose of exposing new version.
I think @Constance Li wanna to keep the old version for current use, create version for refactoring or expanding business. When the new version is total consumed and adapted, she will deprecate the old version.
On the other hand, structures, logic, etc are harder to maintain if keep both of them in 1 module
Thanks all for the reply.
In the end, I duplicated the API and managed to get the URL formatting works using customization but I had to rename my API as vx but that works for me. Because we want to keep both version until we are ready to move to v2.
https://success.outsystems.com/Documentation/11/Extensibility_and_Integration/REST/Expose_REST_APIs/Customize_REST_URLs
Can we try different versions of the API to comply with different versions specifications. Both versions must translate the different types of inputs into an OutSystems Record List before calling the actual service.
article link
https://success.outsystems.com/Documentation/Best_Practices/Architecture/Designing_the_Architecture_of_Your_OutSystems_Applications