71
Views
12
Comments
Solved
Getting Invalid URL Path error while exposing a REST API
Question

Hi,

I am exposing a REST API with URL path "/V0.5/Users/auth/on-init". While entering the URL path, I am getting Invalid URL Path error. We found that the error is due to using "." in the URL path.

Can someone suggest how can we use "." in the URL path.

Thank you.


v0.5.png
2020-09-15 13-07-23
Kilian Hekhuis
 
MVP
Solution

Hi Yerra,

To get around the Service Studio error, you can replace the "V0.5" part by an input parameter called (for example) Version, so your path would be "/{Version}/Users/auth/on-init". This makes "/V0.5/Users/auth/on-init" also a valid path. The only downside is that any "version" is valid, so you might want to add a check for "V0.5", and return a 404 if it's not.

2025-06-10 05-27-50
Yerra Chandra Mouli

Hi Kilian, 

It worked, Thank you.

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP
2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

Hi Yerra,

I don't know if that is possible. But it is also strange to see a minor version in the URL path of a REST endpoint. 

You could consider alternative versioning via 

Versioning through query parameters

Users/auth/on-init ?version=0.5

or adding a custom header:

Accepts-version: 1.0

Regards,

Daniel

2025-06-10 05-27-50
Yerra Chandra Mouli

Hi Daniel,

Thanks for your response.

Actually our requirement is we should get a callback to this exposed REST API and the url path we was given is "/V0.5/Users/auth/on-init".

Can you provide us some sample demo on adding a custom header so that it would be helpful for us.

Thank you.

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

Hi if you need to call this end point as is, then adding the custom header isn't going to solve your problem. You are basically required to use the end point as it is.

Can you share the error you get? I will ask around at OutSystems.


2025-06-10 05-27-50
Yerra Chandra Mouli

Hi Daniel,

I have attached a screenshot where I am getting error.

Thank you.

v0.5.png
2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

Hi,

Abstract from: 
https://success.outsystems.com/documentation/11/extensibility_and_integration/rest/expose_rest_apis/customize_rest_urls/

So this is a limitation from .NET, nothing OutSystems is going to fix.

Regards,

Daniel

2025-06-10 05-27-50
Yerra Chandra Mouli

Thanks for the information Daniel.

Thank you.

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

That's only about the part after the last slash, but the V0.5 is not after the last slash. Perhaps OutSystems has implemented this a bit too prohibitive?

2025-02-10 17-24-13
Arun Rajput

Hi Yerra Chandra Mouli,


You can try to modify url path on before action of api.

I did not check this we can modify url path or not.

Thanks

Arun




2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

That is not possible on a Exposed API, imho

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP
Solution

Hi Yerra,

To get around the Service Studio error, you can replace the "V0.5" part by an input parameter called (for example) Version, so your path would be "/{Version}/Users/auth/on-init". This makes "/V0.5/Users/auth/on-init" also a valid path. The only downside is that any "version" is valid, so you might want to add a check for "V0.5", and return a 404 if it's not.

2025-06-10 05-27-50
Yerra Chandra Mouli

Hi Kilian, 

It worked, Thank you.

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.