Is it possible to access all GSuite domain users ContactsApp by script?

51 views
Skip to first unread message

Alejandro del Campo

unread,
Nov 15, 2019, 9:10:48 AM11/15/19
to Google Apps Script Community
Hi everybody.

I've made a script to clean certain contacts from user (private) address book that the company needs to eliminate.

It uses ContactsApp.getContactsByEmailAddress to access contacts list to delete.

It's a simple script that need to be executed on every gsuite domain account and our domain has near 250 accounts.

Does anyone knows if exists an easy way to do it? 

We wish to avoid to count on user disposition to run it.


Thanks in advance.
Alejandro

Rubén Rivera

unread,
Nov 15, 2019, 12:56:05 PM11/15/19
to Google Apps Script Community
Hi Alejandro

Instead of ContactsApp you should use the Google Contacts API and domain wide delegation of authority

The above because ContactsApp is able to access the contacts of the effective user but not the contacts of other users.

Cheers,
Rubén
Reply all
Reply to author
Forward
0 new messages