I am making a gmail addon in which i am trying to get the user's contact groups (labels) using the code:
var groups = ContactsApp.getContactGroups();
I already have added required scope : https://www.google.com/m8/feeds
in manifest file (appsscript.json) but it returns "Exception: Unexpected error while getting the method or property getContactGroups on object ContactsApp". This method was working fine when it was a default apps script project. I started getting this expection after linking my apps script project with Google cloud project. I am also using People API in my project. When I add https://www.google.com/m8/feeds
in scopes on consent screen of Google cloud platform it does
not show up there. Instead, https://www.googleapis.com/auth/contacts
is shown in the scopes list. It might be because I am using People api and both of these scopes are for read/write user's contacts. And My consent screen on Google cloud platform is still under verification.
Also,I am not able to use any of the methods provived by ContactsApp
class. I am getting the same exception when I used var contact = ContactsApp.getContact("abc@gmail.com");
Any help would be appreciated.
Thanks