I'm developing the GMail Add-on that pulls out all user's contacts to card:
var contacts = ContactsApp.getContacts();
I already enabled ContactsAPI in Google API Console and added scope: https://www.googleapis.com/auth/contacts.readonly
But the error is still there and the Contacts API is missing in the project's Advanced Google Service pop-up.
Through trial and error, and this hard-to-find list I managed to get
ContactsApp.getContacts()
to work. You need to add this scope:There is no need to enable Contacts API and set the scope when using the ContactsApp. When using this, upon reviewing the permission to be used, your app will automatically select the necessary permission for ContactsApp to work properly.
I've use the same code as yours:
Here is the result I received:
Kindly check and review your code, you might have missed something.
Hope this helps.