Can one API have many targeted path for each end point?

I had my open API specs which i converted to TykDefinition, an api corebos has many endpoints each with its parameters but finally the targeted path in Tyk is one. Is it possible to have a TykDefinition which specify targeted path for each endpoint.
image

Hi Corrensa,

Thank you for using Tyk - we’re happy to have you here :slight_smile:

If I understand correctly you want to expose a single service on the Tyk side with multiple endpoints? In this case yes, you’re able to do this. There was a similar question here Configuring endpoints on API.

Alternatively you can also have individual api proxies to forward to the identical endpoint of your api, i.e http://localhost:8080/getchallengehttp://your-api/getchallenge.

Hope this helps,


Valmir

Thanks, i decided to use url rewrite : though I’m facing an issue with it.

image.png

Here is how i defined my spec, According to documentation,

If i send the request : https://frantic-dancer-mgw.aws-usw2.cloud-ara.tyk.io/wora/getchallenge/admin

Then i expected it to rewrite to : http://167.172.111.162/wora/webservice.php/getchallenge?operation=getchallenge&username=admin

But i don’t get it

image.png

Hi Corrensa,

Your image uploads appear to be failing as I can’t see them from my end - could potentially be because the image file is too large.

Assuming you’re adding your log or your .conf files you can just copy and paste it under the ‘preformatted text’ in the reply section.


Valmir

Basically i need to know: if i have a url: https://tyk/listen/path?param1=a&param2=b
But i’m using a url rewrite and i need to rewrite to
url_rewrite: “/param2?operation=param1&”
How can i construct that?

Hello @Corrensa,

This probably relevant to this issue here Using context variables in URL rewrite - #7 by zaid

However, you can use the following regex path\?param1=(\w+)&param2=(\w+) and you can access the values at $1 and $2. Which means that the URL rewrite string would be /$2?operation=$1

Zaid

1 Like