curl -X POST -H "Authorization: Bearer <access_token>" -H "Content-Type: application/json" -H "Cache-Control: no-cache" -d '{"conditions":[{"address":"/sensors/30/config/battery","value":"20","operator":"lt"}],"name":"battery low","actions":[{"body":{"alert":"select"},"address":"/groups/0/action","method":"PUT"}]}'
The trace in Edge (before any policies in the Bridges proxy are executed) shows that the values in the payload (json body) seem stringified in Apigee:
{"conditions":"[{\"address\":\"\\\/sensors\\\/30\\\/config\\\/battery\",\"value\":\"20\",\"operator\":\"lt\"}]","name":"battery low","actions":"[{\"body\":{\"alert\":\"select\"},\"address\":\"\\\/groups\\\/0\\\/action\",\"method\":\"PUT\"}]"}
Notice the quotes and escapes for the values for address and groups? What is happening here? There is nothing between the machine (checked with charles) and this report in the proxy before any policies are executed.
Thanks!
Solved! Go to Solution.
For those that are interested in this issue:
After filing a ticket with Apigee, I learned from customer support that the actual JSON body remains intact and that this is an issue with the Trace UI, showing escape characters in the sent payload.
Naturally, I asked to file a CR for this, as showing payloads that do not reflect the actual JSON will lead any integration team to stop looking for issues elsewhere in the roundtrip.