title: Get route parameters in Azure API Management Inboud policy section
body: <p>I have a URL with template parameters. </p>
  
  <pre><code>https://test.azure-api.net/HelperFunction/{siteId}/lots/InventoryItem/{itemId}
  </code></pre>
  
  <pre><code>https://test.azure-api.net/HelperFunction/122/lots/InventoryItem/12
  </code></pre>
  
  <p>I wanted to read the template/path parameters in inbound policy section.</p>
  
  <p>I am trying as below. But it will only fetch the query string parameters. I wanted to get the path parameters.</p>
  
  <pre><code> &lt;inbound&gt;
          &lt;set-body&gt;@{
                  JObject transBody = new JObject();
                  transBody.Add("Arguments", 
                  new JObject
                  {
                      {"method", context.Request.Method},
                      {"parameters", context.Request.Url.QueryString},
                  });
  
                  //Add all json properties as arg
                  transBody.Add("UriPath", context.Request.Url.Path);
                  return transBody.ToString();
              }&lt;/set-body&gt;
          &lt;base /&gt;
   &lt;/inbound&gt;
  </code></pre>
  
  <p>My requirement would be to read route parameters as </p>
  
  <pre><code>"siteId" : 122,
  "itemId" : 12
  </code></pre>
  
  <p>Any help would be appreciated.</p>