While making a cascade API call, a roadblock has been hit, here's a code:
$result = civicrm_api3('Contact', 'get', array(
'sequential' => 1,
'return' => "id",
'id' => array('IN' => array(168, 169)),
// Second call
'api.Relationship.get' => array(
'return' => "contact_id_a",
'contact_id_b' => "\$value.id",
'relationship_type_id' => 4,
'is_permission_b_a' => "1"),
// Third call
'api.Contact.get' => array('id' => array(
'IN' => array("\$value.api.relationship.get"))), // <-- here
));
It returns
{
"error_field": "id",
"type": "integer",
"error_code": 2001,
"entity": "Contact",
"action": "get",
"is_error": 1,
"error_message": "Error in call to Contact_get : id is not a valid integer"
}
What exactly returns third call and how these results should be properly "plugged in" to get correct output? Thanks anyone for any bit of advice!