0

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('john.doe@example.com');

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

hhsb
  • 560
  • 3
  • 23

1 Answers1

1

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

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

for the ContactsApp.getContacts() to work.

MαπμQμαπkγVπ.0
  • 5,887
  • 1
  • 27
  • 65