GoogleContactsEventsNotifier icon indicating copy to clipboard operation
GoogleContactsEventsNotifier copied to clipboard

Possible chance to simplify the script and let Google do the heavy lifting (data merging)

Open rowanthorpe opened this issue 6 years ago • 4 comments

I noticed in the docs for the latest (3.0) API for Contacts at the top there is the following note:

Note: For read and write access to users' contacts, use the People API, which provides
both contact and profile information using JSON instead of the older GData protocol.

which links to the People API, which seems to be a merged datasource for contact info and profile data from various sources (I'm guessing primarily Google+). I haven't dived deeply into it (I am not registered for anything other than Contacts, and am hesitant to start registering for other things just to test this API). It would be nice if someone who already has access to Google+ etc wants to test whether this API is relevant and adds any value, or is just a red-herring...

rowanthorpe avatar Mar 19 '18 15:03 rowanthorpe

I think I had looked into this while performing the major rewrite of version 3, but it could have changed and/or I could be misremembering, so feel free to correct me on this: I'll look into it accurately as soon as I can.

I don't think the People API is integrated into Google Scripts: if we wanted to use it we would need to implement OAuth which would make it impossible for users to simply copy-paste and deploy.

GioBonvi avatar Mar 19 '18 16:03 GioBonvi

Ah, OK. That sounds suspiciously like either a red herring, or a way-too-much-effort-for-too-little-return thingy. I'll leave it up to you when/if to close this then, based on how motivated you or anyone else feels.

rowanthorpe avatar Mar 19 '18 16:03 rowanthorpe

...actually, on this page when you look at Google Contacts API it says "GData version is still live. Replaced by Google People API for read-only access." which seems to fit with the quote in my previous comment saying "use the People API ...using JSON instead of the older GData protocol.". It seems the way we are talking to Google Contacts has been deprecated either way, unless I am misreading it.

rowanthorpe avatar Mar 19 '18 16:03 rowanthorpe

I don't think our way has been deprecated, since we do not use the Google Contacts API directly, but the ContactsApp class (which I imagine uses the API behind the scenes).

The documentation is not exactly clear regarding this topic, but this is what I think I have understood:

  • there are a great number Google APIs which require some form of authentication to be used (API keys, OAuth...) making them unsuitable for us given the choices we have made for this project.
    In the last years some of these APIs have been transitioning from v1 to v2 and very recently v3 making important changes and bringing in new features (like the one you found out)
  • a small subset of these APIs are made accessible in Google Scripts via some special classes. These do not require any other form of authorization other than the "granting rights" step we all know.
    The complete list of these APIs can be found in the left side menu of this page: those labeled as "G Suite Services" are available in Google script with no setup, while those listed under "Advanced Google Services" needs to be enabled in the settings of the project like the Calendar and Google+ APIs we already use.

GioBonvi avatar Mar 19 '18 21:03 GioBonvi