Radek
Radek

Reputation: 11121

how to save Google Contact ID?

when using integromat I am using Google Contact ID to make sure that I always work with the correct contact. Now I would like to save all Google Contact IDs. Ideally without using integromat. But I do not know how.

enter link description here

Upvotes: 1

Views: 428

Answers (1)

Tanaike
Tanaike

Reputation: 201523

I believe your goal as follows.

  • You want to retrieve the contact IDs like http://www.google.com/m8/feeds/contacts/kanshi000001%40gmail.com/base/### using Google Apps Script.

In this case, as a simple method, I think that you can use Contacts Service of Google Apps Script. The sample script is as follows.

Sample script:

When you use this script, please copy and paste the following script to the script editor and run myFunction. By this, the authorization screen is opened. So please authorize the scopes. (This authorization is only one time while the new scopes are not detected.) By this, the script works and you can see the contact IDs at the log.

function myFunction() {
  const ids = ContactsApp.getContacts().map(e => e.getId());
  console.log(ids)
}

Note:

  • Of course, you can also use People API with Advanced Google services. But when you can use Contacts Service, I think that above script is simpler.

References:

Upvotes: 2

Related Questions