nylas / sync-engine

:incoming_envelope: IMAP/SMTP sync system with modern APIs
https://nylas.com/docs/platform
GNU Affero General Public License v3.0
3.5k stars 354 forks source link

Include contacts provider in contacts API #140

Open Eagles2F opened 9 years ago

Eagles2F commented 9 years ago

I've tested the contacts api with my own gmail account. The result is I got 5378 contacts from the sync engine, which number seems quite strange to me since I only have 160 gmail contacts.

There is no definition on the documentation explains what does the word "contacts" here mean. Can someone explain it to me? Apparently it is quite different from what I understood.

grinich commented 9 years ago

Hi @Eagles2F. First of all, thanks for digging into the sync engine! :)

The "contacts" API endpoint is generated from your address book, but also emails that you have sent and received. (This is similar to Gmail's "other contacts" section in the web UI.)

Most developers want to use the contacts endpoint for typeahead autocompletion, and so we decided to provide a richer set of names+emails.

We should definitely refine this in our documentation to be more clear!

Eagles2F commented 9 years ago

@grinich Thanks. From my understanding, there needs further local classification(since there is no filter for this differentiation) between gmail contacts(which is small) and other contacts(which is huge). Is this correct?

grinich commented 9 years ago

what do you mean "there needs further local classification" ?

Eagles2F commented 9 years ago

@grinich Sorry to be unclear, I'm trying to say after I get contacts from the API call, I don't have any information about the contact other than name and email. Under this circumstance, I need to use some local logic to figure out what kind of contact it is. Hope this could explain my idea more clear!

grinich commented 9 years ago

Are you wanting to get only the contacts in the address book?

Eagles2F commented 9 years ago

@grinich , Yep, exactly.

ubermensch commented 9 years ago

I also have this issue - no way to differentiate between retrieved contacts from address book vs email communication. Are there plans to include this? Thanks @grinich!

spang commented 9 years ago

We're planning a very significant update to the contacts API for the future. No ETA yet, but stay tuned. (The current API is very much the bare minimum basics.)