REST API URL Path in Parameter format

Hi,


Were anyone of you able to parameterized the URL Path of the REST AP? In our set-up, the path might change in the future.  Hence, we want to have it in parameter so that we won't have to perform deployments everytime there is a change in the url path.



Hi Amelie,

I don't undestand your problem, if you want to put a paramenter in a Rest API just pass it in the url like: 

http://<apiurl>/{Insert_parameter_Here/Continueryourapi or not.

that is the way to pass a parameter into an API.


Hope this help.

Regards.

Hi Amelie Igloso,

Yes you can do it by using site properties in OutSystems. Please follow below steps to create and manage.


1. Create Site property like below and publish


2. Update Path into newly created property in service center. find below same. Factory->eSpaces->SelectCurrentEspace-> Site Properties



3. Access that property from site object like below. 


4. When you want to changes api url you can directly go to service center and update, not required deployments.


Hope this helps.


Sravan

Sravan Vanteru wrote:

Hi Amelie Igloso,

Yes you can do it by using site properties in OutSystems. Please follow below steps to create and manage.


1. Create Site property like below and publish


2. Update Path into newly created property in service center. find below same. Factory->eSpaces->SelectCurrentEspace-> Site Properties



3. Access that property from site object like below. 


4. When you want to changes api url you can directly go to service center and update, not required deployments.


Hope this helps.


Sravan


Hi Sravan,


Your suggested procedure was the same thing I performed  but I'm encountering error when I defined  the Site Property in the URL path as shown by the screenshot below.  "URL path needs to start with "/" was the error message being displayed.





 


Hi,

Can you attach error of screenshot please ?


Sravan

Sravan Vanteru wrote:

Hi,

Can you attach error of screenshot please ?


Sravan


Attached is the screenshot

Hi Amelie,

You need to add "/"  as prefix in URL Path.



Thanks,

Narendra

Narendra Maheshwari wrote:

Hi Amelie,

You need to add "/"  as prefix in URL Path.



Thanks,

Narendra

Hi Narendra,


With the above format, system might treat "/Site.Api_PATH"  as the actual path not a VARIABLE.  What do you think?

Hi Amelie Igloso,

I think you need to configure full URL in service center.

  • URL path needs to start with '/'

    The URL path doesn't start with '/' in the definition of the REST API.

    Review the syntax of the URL path.

Please find the reference link.


Sravan

Make it "/"+Site.Api_Path