title: Azure API Management (Policies)
body: <p>I need help building APIM policy for one of my task.<br />
  I have two payloads.</p>
  <p>One that gets “UniqueID” from an external service, and verifies that webhook is coming from that external service.<br />
  The other payload goes in the request body, when sending in the request.</p>
  <p>The two payloads are somewhat different, so when I put the payload from the one that is coming from the external service, I get missing body request, because the API expects the another payload in the request body.</p>
  <p>What I want APIM to do, is modify(change the name of keys, add new keys) so the payload looks exactly like the one API expects.</p>
  <p>Payload1</p>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;DocumentID&quot;: &quot;221&quot;,
    &quot;UniqueID&quot;: &quot;1001&quot;,
    &quot;dependentee_name&quot;: {
      &quot;first&quot;: &quot;Tony&quot;,
      &quot;last&quot;: &quot;Stark&quot;
    },
    &quot;insurer_first_name&quot;: &quot;Steve&quot;,
    &quot;insurer_last_name&quot;: &quot;Rogers&quot;
  }
  </code></pre>
  <p>Payload2</p>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;insurer&quot;: {
      &quot;firstName&quot;: &quot;Steve&quot;,
      &quot;lastName&quot;: &quot;Rogers&quot;
    },
    &quot;dependentee&quot;: {
      &quot;firstName&quot;: &quot;Tony&quot;,
      &quot;lastName&quot;: &quot;Stark&quot;
    }
  }
  </code></pre>
  <p>Payload3 - expected</p>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;DocumentID&quot;: &quot;221&quot;,
    &quot;UniqueID&quot;: &quot;1001&quot;,
    &quot;insurer&quot;: {
      &quot;firstName&quot;: &quot;Steve&quot;,
      &quot;lastName&quot;: &quot;Rogers&quot;
    },
    &quot;dependentee&quot;: {
      &quot;firstName&quot;: &quot;Tony&quot;,
      &quot;lastName&quot;: &quot;Stark&quot;
    }
  }
  </code></pre>
  <p> </p>
  <p> 
  I know I have to do something with  or set variable that gets the body. But I am not sure, how I would add keys and modify its name. Any example of Azure API Management doing this would be very helpful</p>