Menu

Welcome, Guest
Username: Password: Remember me

TOPIC: Filtering contacts via API

Filtering contacts via API 3 days 21 hours ago #69314

  • pl@langheinrichco.de
  • pl@langheinrichco.de's Avatar
  • Offline
  • New Member
  • Posts: 14
  • Karma: 0
Hi,

I am trying to filter contacts while accessing them via API. I tried the following requests:
https://[CRM-URL]/api/v8/modules/Contacts?filter[Contacts.some_custom_field_c]=[eq]1
https://[CRM-URL]/api/v8/modules/Contacts?filter[Contacts.some_custom_field_c]=1

Both give me blank JSON (no message whatsoever), which - in my interpretation - means that no record could be found. However, I checked in the database and there is one record with the flag. The request itself works because then I remove the filter the records get extracted.

Any idea on this issue is highly appreciated. :-)

Best,
Peter
The administrator has disabled public write access.

Filtering contacts via API 3 days 18 hours ago #69318

  • pgr
  • pgr's Avatar
  • Offline
  • Administrator
  • Posts: 6868
  • Thank you received: 1048
  • Karma: 244
Do you have XDEBUG and an IDE set up? You could try debugging through the API code. That's the bright side of having a fully open-source system.

I'm sorry that I don't have simpler answer to your question, I don't have experience using the API...
The administrator has disabled public write access.

Filtering contacts via API 2 days 13 hours ago #69328

  • pl@langheinrichco.de
  • pl@langheinrichco.de's Avatar
  • Offline
  • New Member
  • Posts: 14
  • Karma: 0
I don't think I am able to go through the SuiteCRM code. I am not developer enough for that. :-)
The administrator has disabled public write access.

Filtering contacts via API 1 day 19 hours ago #69351

  • pgr
  • pgr's Avatar
  • Offline
  • Administrator
  • Posts: 6868
  • Thank you received: 1048
  • Karma: 244
Ok, no problem.

Start by trying double brackets around the "eq" operator, that's how the examples are in the Docs.
https://[CRM-URL]/api/v8/modules/Contacts?filter[Contacts.some_custom_field_c]=[[eq]]1

If that doesn't work, have a look in your logs at the time of the failed search.

suitecrm.log
php_errors.log (or whatever your web server log is called)
The administrator has disabled public write access.

Filtering contacts via API 14 hours 23 minutes ago #69482

  • l.horstink
  • l.horstink's Avatar
  • Offline
  • Administrator
  • Head of Marketing
  • Posts: 30
  • Thank you received: 8
  • Karma: 1
Did the double brackets around the "eq" operator work?
The administrator has disabled public write access.
Time to create page: 0.099 seconds
Powered by Kunena Forum