477
Views
9
Comments
REST API URL Path in Parameter format
Question

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.



restapi.JPG
2019-04-17 22-09-44
Omar Alejandro Soto Anaya

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: 

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

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


Hope this help.

Regards.

2019-01-04 10-45-45
Sravan Vanteru

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

UserImage.jpg
Amelie Igloso

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.





 


URLpathERROR.JPG
2019-01-04 10-45-45
Sravan Vanteru

Hi,

Can you attach error of screenshot please ?


Sravan

UserImage.jpg
Amelie Igloso

Sravan Vanteru wrote:

Hi,

Can you attach error of screenshot please ?


Sravan


Attached is the screenshot

URLpathERROR.JPG
UserImage.jpg
Narendra Maheshwari

Hi Amelie,

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



Thanks,

Narendra

UserImage.jpg
Amelie Igloso

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?

2019-01-04 10-45-45
Sravan Vanteru

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

UserImage.jpg
Gaurav Mangwani

Make it "/"+Site.Api_Path

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.