monicahq / monica

Personal CRM. Remember everything about your friends, family and business relationships.
https://beta.monicahq.com
GNU Affero General Public License v3.0
21.59k stars 2.16k forks source link

Search Contact Field in API #932

Open degan6 opened 6 years ago

degan6 commented 6 years ago

It would be great if we could add a way to select a contact field and search for a match in that field with any contact.

I want to use the API as a contact look when someone calls my voip phone but i need a way to check if their phone number is in Monica through the API.

mattdp commented 5 years ago

+1 to this - with the API for importing contacts coming online, and especially with no great way of merging duplicates, it's important to be able to programmatically tell if someone exists or not. If an API import breaks in the middle, or if you're importing from multiple systems (like both Facebook and LinkedIn), this would let you know when there's a collision.

However, right now there's not a way I know of for an API query to check "does someone with email address X exist in the database already", or allow the original requestor to check phone numbers.

Ideally, I'd suggest a method/new index on Contact Fields to allow searching by string, but I'm very open to different suggestions to achieve the goal.

LukasRos commented 5 years ago

I think this is an essential feature because it makes all kinds of integrations with external systems possible through matching the people based on contact identifiers. I've checked the implementation of the API and I feel comfortable implementing this myself, so I'm volunteering to do it. Would you be interested in a PR?

mattdp commented 5 years ago

@djaiss in case you didn't see this, would you be interested in a PR from @LukasRos here?