I need help building APIM policy for one of my task.
I have two payloads.
One that gets “UniqueID” from an external service, and verifies that webhook is coming from that external service.
The other payload goes in the request body, when sending in the request.
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.
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.
Payload1
{
"DocumentID": "221",
"UniqueID": "1001",
"dependentee_name": {
"first": "Tony",
"last": "Stark"
},
"insurer_first_name": "Steve",
"insurer_last_name": "Rogers"
}
Payload2
{
"insurer": {
"firstName": "Steve",
"lastName": "Rogers"
},
"dependentee": {
"firstName": "Tony",
"lastName": "Stark"
}
}
Payload3 - expected
{
"DocumentID": "221",
"UniqueID": "1001",
"insurer": {
"firstName": "Steve",
"lastName": "Rogers"
},
"dependentee": {
"firstName": "Tony",
"lastName": "Stark"
}
}
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
