I am looking to get a list of all contacts with active memberships, and their respective tags. I went about this by starting from an api call to give me all current memberships owned by a company.
CRM.api3('Membership', 'get', {
"sequential": 1,
"return": ["contact_id.tag","contact_id.id"],
"status_id": "Current",
"contact_id.contact_type": "Organization"
}).done(function(result) {
// do something
});
Running the above only gets me the default returns vals of the contact_id and id of the membership. It does not return the tags.
When I run this by itself:
$result = civicrm_api3('EntityTag', 'getsingle', array(
'sequential' => 1,
'contact_id' => 137402,
));
I get what I want, the tag ids for the contact.
What am I doing wrong here?