1

I am designing an API using WSO2AM 2.0
My service is like : http://190.100.10.10:9000/abc/xyz/doPost<br>

I want to replace /abc/xyz/doPost by /<MY_CUSTOM_PATH>/doPost

How can I make a custom URL pattern to hide my original URL path from the service? Like: http://<WSO2AM_GENERATED_HOST>/WSO2AM_CONTEXT/WSO2AM_VERSION/<MY_CUSTOM_PATH>/doPost

I have searched the docs, but I am not able to find any related tutorial. If I put /abc/xyz/doPost it will get appended to the WSO2AM generated hostname.

What is "EDIT SOURCE" in the image below?
Can it be used to do what I want? If YES, How??
enter image description here

Abhinav Tyagi
  • 5,158
  • 3
  • 30
  • 60

3 Answers3

0

There aren't anything like WSO2AM_CONTEXT or WSO2AM_VERSION. You can provide any value for the context and version. Version can be String, numbers, etc.

In your case, you can use abc as context and xyz as the version.

Abimaran Kugathasan
  • 31,165
  • 11
  • 75
  • 105
0

That is exactly the kind of URL you would get in WSO2 API Cloud: http://your.custom.url/api-name/version/context. See this tutorial for details: https://docs.wso2.com/display/APICloud/Customize+the+API+Store+and+Gateway+URLs

DSotnikov
  • 634
  • 3
  • 10
  • I am not using WSO cloud. I have the zip version installed on my local Machine. – Abhinav Tyagi Oct 05 '16 at 16:22
  • Sure. My point is that if it works that way in the cloud, that means that the product is capable of it already (cloud is the same product - just set up and maintained by WSO2). – DSotnikov Oct 06 '16 at 17:36
0

It might not be complicated...

In publisher interface, when you add/edit an API, in "Implementation" screen, just configure WSO2 APIM to point to "http://190.100.10.10:9000/abc/xyz" - this way, "/abc/xyz" will not be visible to your clients.

So in this case,

http://<WSO2AM_GENERATED_HOST>/WSO2AM_CONTEXT/WSO2AM_VERSION/doPost

will point to:

http://190.100.10.10:9000/abc/xyz/doPost

If you wanted to add additional custi=om paths, in the "Design" screen you attached, you can also add your "(MY_CUSTOM_PATH)/doPost" path there.

This way

http://<WSO2AM_GENERATED_HOST>/WSO2AM_CONTEXT/WSO2AM_VERSION/<MY_CUSTOM_PATH>/doPost

will point to:

http://190.100.10.10:9000/abc/xyz//<MY_CUSTOM_PATH>/doPost

(However, your backend services should also have "//doPost" implemented)

J D
  • 274
  • 3
  • 17