There is a problem when searching for person records by email. If the person record has one email then the search works as it is supposed to. But if the record has more than one emails then the search returns empty result.
The api call I’m making is:
/api/v1/persons/search/?api_token=^^^^^&limit=1&start=0&term=^^^^^^
Hi! The search function should work even with multiple e-mails. For example, I was able to receive results for a contact who has two e-mails (see screenshots below).
Could it be an issue with visibility rights (meaning, the user whose API token you’re using doesn’t have rights to see the contact in UI either)?
If you have verified that visibility is not the problem, could you please create a dummy contact and post similar screenshots like mine to show the empty result?
After I saw your screenshot I did more tests. It turns out if I edit the record in pipedrive portal (the website), the search is fixed and I can find the record, but not before that. I compared two records, one not searchable and one that I fixed after editing it in the portal. Structure wise they look identical, but one is searchable and the other is not (not until I manually edit it). The problematic records were imported from csv so something must have went wrong there but still the JSON I get for both records is identical. So now I know how to fix the problem, I need to go through all not searchable records and manually edit them, but why the problem appears in the first place is a mystery. It’s also interesting that the search in pipedrive website works fine and I can find those persons without doing the edit trick, but the API doesn’t find them.
Since the persons have two emails there might have been also a merger at some point of duplicate records and that could have cause the problem (not the import) I don’t know.
All in all pretty strange problem given also that the JSON structure is identical so it’s not obvious what is different with those records that are not searchable.
That’s interesting and frustrating! It sounds like you’ve done a thorough job investigating the issue. It’s peculiar that the records are not searchable via the API but work fine on the Pipedrive website after manual edits. Given that the JSON structure is identical, it does suggest that there might be a hidden factor affecting searchability.
The possibility of mergers or duplicate records is a factor. Data inconsistencies or conflicts arising from such operations can sometimes lead to unexpected behavior. Since the problem seems related to records imported via CSV and potentially affected by mergers, it might be worth checking if any hidden fields or metadata could influence the search functionality.
In the meantime, it sounds like you’re on the right track with manually editing the records to restore searchability. Good luck with resolving the issue, and thanks for sharing your findings—it might help others facing similar problems!