hhsb
hhsb

Reputation: 582

Unable to access gmail contacts via gmail addon (oauth scopes included already)

I am trying to execute this in my addon and I get an error

You do not have permission to call getContact [line: 37, function: addOnLogic, file: app]

var contact = ContactsApp.getContact('[email protected]');

I've added the following scopes.

"oauthScopes": [
"https://www.googleapis.com/auth/gmail.addons.execute", 
"https://www.googleapis.com/auth/gmail.readonly",
"https://www.googleapis.com/auth/gmail.compose",
"https://www.googleapis.com/auth/gmail.addons.current.action.compose", 
"https://www.googleapis.com/auth/script.external_request",
"https://www.google.com/m8/feeds/",
"https://www.googleapis.com/auth/contacts" ]

Permission : Permissions

Upvotes: 0

Views: 110

Answers (1)

MαπμQμαπkγVπ.0
MαπμQμαπkγVπ.0

Reputation: 6729

From this SO post, it was suggested to add this scope.

"oauthScopes": [
  "https://www.google.com/m8/feeds",

for the ContactsApp.getContacts() to work.

Upvotes: 1

Related Questions