In this example, we will be making 2 GET requests and a POST request to first find the contact_id, check to see if they have been active, and if so award them a perk.
To use the chain, we would simply make one call via POST, as such:
http://api-multi-request.demos.mikestowe.com/influitive/api/multirequest
[
{
"doOn": "always",
"href": "/members?email=email@mycompany.net",
"method": "get",
"data": {},
"return": true
},
{
"doOn": "200",
"href": "/events?contact_id=${body[0].id}",
"method": "get",
"data": {},
"return": true
},
{
"doOn": "${body.events}",
"href": "/perks/reward/dnf9whr893nf39ih-fh89h4598fh4",
"method": "post",
"data": {"contact_id" : "${body.events[0].contact_id}", "message" : "Great job!"},
"return": true
}
]