sync-google-contacts icon indicating copy to clipboard operation
sync-google-contacts copied to clipboard

Migrate to People API in light of impending Contacts API deprecation on June 15,2021

Open RandallKent opened this issue 5 years ago • 12 comments

Google announced the deprecation of the Contact API effective June 15, 2021. They recommend moving to the People API which provides feature parity with the exception of working with "Other Contacts". A Migration Guide is also provided.

Relevant Docs/Notes:

Pull Contacts

Update Contacts

RandallKent avatar Apr 01 '21 23:04 RandallKent

Hi Randall. Any progress on this?

mrmattwilkins avatar Jun 04 '21 02:06 mrmattwilkins

No, I've not written any code.

RandallKent avatar Jun 04 '21 02:06 RandallKent

Damn. I totally rely on this code, I worked on it a number of years ago putting in the adding-new-user thing, and it took ages to figure it all out. Not looking forward to the people API migration, and was hoping someone else might have started on it!

mrmattwilkins avatar Jun 04 '21 02:06 mrmattwilkins

Hi, The changes were substantial, so I just did it from scratch. https://github.com/mrmattwilkins/google-contacts-sync Welcome to use it if you want Cheers Matt

mrmattwilkins avatar Jul 02 '21 23:07 mrmattwilkins

Is Michael Adler's code no longer working? It seems like it has stopped sync'ing over the last few days (it had been working flawlessly since October).

fleapower avatar Jul 11 '21 20:07 fleapower

Trying to do some troubleshooting...I am getting an error which looks like a local error, "The system cannot find the path specified." Don't know how Google would be causing it on their end. Any suggestions before I go deeper on this? Thanks!

fleapower avatar Jul 11 '21 20:07 fleapower

@fleapower - Google announced the deprecation of the Contact API effective June 15, 2021. Michael's code was written on the Contact API so it is no longer working since the API has been deprecated.

RandallKent avatar Jul 11 '21 20:07 RandallKent

@fleapower - Google announced the deprecation of the Contact API effective June 15, 2021. Michael's code was written on the Contact API so it is no longer working since the API has been deprecated.

Thanks. Any alternatives you know of? I see @mrmattwilkins has written a new contact sync based on the People API, but it apparently doesn't sync groups which I really need.

fleapower avatar Jul 11 '21 21:07 fleapower

Sorry about that (lack of groups). I just didn't need it, and got the syncing to the point of usefulness for me. You might want to check out the repo though, the syncing was surprisingly easy, there isn't a lot of code to it, so adding groups might not be too difficult. Cheers Matt

On Mon, Jul 12, 2021 at 9:23 AM fleapower @.***> wrote:

@fleapower https://github.com/fleapower - Google announced the deprecation of the Contact API effective June 15, 2021 https://developers.google.com/contacts/v3/announcement. Michael's code was written on the Contact API so it is no longer working since the API has been deprecated.

Thanks. Any alternatives you know of? I see @mrmattwilkins https://github.com/mrmattwilkins has written a new contact sync based on the People API, but it apparently doesn't sync groups which I really need.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/michael-adler/sync-google-contacts/issues/15#issuecomment-877863670, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACVF756DPYGZTQGBH4A5FJLTXIDW3ANCNFSM42H6HXDA .

mrmattwilkins avatar Jul 11 '21 21:07 mrmattwilkins

Thanks. I'm a complete Python noob, but I'll take a look. I'll let you know if I figure it out.

On Sun, Jul 11, 2021, 17:32 mrmattwilkins @.***> wrote:

Sorry about that (lack of groups). I just didn't need it, and got the syncing to the point of usefulness for me. You might want to check out the repo though, the syncing was surprisingly easy, there isn't a lot of code to it, so adding groups might not be too difficult. Cheers Matt

On Mon, Jul 12, 2021 at 9:23 AM fleapower @.***> wrote:

@fleapower https://github.com/fleapower - Google announced the deprecation of the Contact API effective June 15, 2021 https://developers.google.com/contacts/v3/announcement. Michael's code was written on the Contact API so it is no longer working since the API has been deprecated.

Thanks. Any alternatives you know of? I see @mrmattwilkins https://github.com/mrmattwilkins has written a new contact sync based on the People API, but it apparently doesn't sync groups which I really need.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub < https://github.com/michael-adler/sync-google-contacts/issues/15#issuecomment-877863670 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/ACVF756DPYGZTQGBH4A5FJLTXIDW3ANCNFSM42H6HXDA

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/michael-adler/sync-google-contacts/issues/15#issuecomment-877864578, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEAMOKCU7LOCWI2VJE4ROHLTXIEYBANCNFSM42H6HXDA .

fleapower avatar Jul 11 '21 21:07 fleapower

I'm going off-topic for a moment. This new people API is have me a way.. need some help with my little code

my setup is that i have a google form that link to google sheet and every new contact that get added my code below would run in google app script and add or update my google contact. it was work over a few years now but a couple days ago it stop work. can you rewrite this with the new people api. thanks inadvance

App script code below

function fromSubmitted(e){ const info = e.namedValues; const contactArray = ContactsApp.getContactsByPhone(info["WhatsApp Number"]); if(contactArray.length === 0){ addContact(info); } else { updateContact(contactArray[0],info); } }

function addContact(info) { const c = People.People.createContact(info["User Name"], info["Last Name"], info[""]); c.addPhone(ContactsApp.Field.MOBILE_PHONE, info["WhatsApp Number"]); c.setMiddleName(info["Birth Year"]); c.setSuffix(info["Parish"]); c.setPrefix(info["Gender"]); c.addCompany(info[""],info[""]); c.setNotes(info["Phone Network"]); const cg = ContactsApp.getContactGroups(); c.addToGroup(cg[4]);

}

function updateContact(c,info) { c.setGivenName(info["First Name"]); c.setMiddleName(info["Birth Year"]); c.setSuffix(info["Parish"]); c.setPrefix(info["Gender"]); c.setNotes(info["Phone Network"]); c.addCompany(info[""],info[""]); c.setFamilyName(info["Last Name"]);

}

watsapptv avatar Aug 03 '21 03:08 watsapptv

Matt, been awhile. Well, I really needed group sync, so I wrote a Google script from scratch to do contacts sync which includes group sync. It resembles more of Frankenstein's monster than pretty code. It is a work in progress, but it is functional. I've been using it for a couple of weeks with four accounts. You (or anyone) are welcome to try it if you'd like.

https://github.com/fleapower/Google-Script-Contacts-Sync

fleapower avatar Dec 13 '21 13:12 fleapower