WildCard option in azure apim for POST and GET REST API

Suresh Thakur, Kirti 86 Reputation points
2021-11-18T06:36:58.477+00:00

I have created a API which is masking the url of backend service.
The BE API is REST API
Now, apart from the masked base url, Backend is expecting any template path or additional value in path from frontend.
Ex- BE url -https://abc.pqr.com:443/A_EntityName

This url is been masked in apim

Now the BE is expecting that frontend url can come in below fashion along with query parameter-
https://abc.pqr.com:443/A_EntityName/newbombayentity?server=123
https://abc.pqr.com:443/A_EntityName/$metadata?server=123
https://abc.pqr.com:443/A_EntityName/$batch?server=123

In APIM how do i allow such dynamic urls with query parameter for GET and POST methods..

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
2,462 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Saadia Sajjad 86 Reputation points
    2021-11-18T22:07:37.95+00:00

    You can use inbound policy

    Rewrite URL
    The rewrite-uri policy converts a request URL from its public form to the form expected by the web service, as shown in the following example.
    Public URL - http://api.example.com/storenumber/ordernumber
    Request URL - http://api.example.com/v2/US/hardware/storenumber&ordernumber?City&State
    This policy can be used when a human and/or browser-friendly URL should be transformed into the URL format expected by the web service. This policy only needs to be applied when exposing an alternative URL format, such as clean URLs, RESTful URLs, user-friendly URLs or SEO-friendly URLs that are purely structural URLs that do not contain a query string and instead contain only the path of the resource (after the scheme and the authority). This is often done for aesthetic, usability, or search engine optimization (SEO) purposes.

    You can get further information from this link
    https://learn.microsoft.com/en-us/azure/api-management/api-management-transformation-policies#RewriteURL

    0 comments No comments

  2. Pramod Valavala 20,656 Reputation points Microsoft Employee Moderator
    2021-11-22T06:07:42.843+00:00

    @Suresh Thakur, Kirti You could create a wildcard operation as covered in the docs. For reference, the path should be /*.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.