Reputation: 582
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" ]
Upvotes: 0
Views: 110
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