API V8 filtering Contacts on account info

I’ve been trying to use the V8 API to filter Contacts by account

Have tried the following with no success
/V8/module/Contacts?filter[operator]=and&filter[account_id][eq]=de769b13-1e69-fbb3-5386-5eabd953de5e
/V8/module/Contacts?filter[operator]=and&filter[accounts_contacts.account_id][eq]=de769b13-1e69-fbb3-5386-5eabd953de5e
/V8/module/Contacts?filter[operator]=and&filter[Accounts.account_id][eq]=de769b13-1e69-fbb3-5386-5eabd953de5e
/V8/module/Contacts?filter[operator]=and&filter[Accounts.id][eq]=de769b13-1e69-fbb3-5386-5eabd953de5e

I get the following response
{
“errors”: {
“status”: 400,
“title”: null,
“detail”: “Database failure. Please refer to suitecrm.log for details.”
}
}Database failure. Please refer to suitecrm.log for details.

Is it possible to use the API to do this and, if so, how do I get it to work? Please note all other filtering on simple contact attributes works fine.

Any help would be much appreciated.

Hi @StuRegan,

Welcome to the Community!! :tada:

Remember that the accounts arnt actually stored on the record but as a relationship.

Not actually sure the best way for searching for this but the below may help
GET {{suitecrm.url}}/V8/module/{moduleName}/{id}/relationships/{relatedModuleName}

@pgr @Dillon-Brown Any clues?

Thanks for that. That should work for me.

1 Like