I am trying to use api3 to get all participants to an event of a certain type. In SQL I would use an inner join for this, using api chaining I do:
$result = civicrm_api3('Participant', 'get', array(
'sequential' => 1,
'api.Event.get' => array('event_type_id' => $type_id),
));
However this results in all event participants, to every type of event, being returned. The ones who haven't participated in an event of the type get no events tacked to them. Is there a way in the API to filter these participants out?