Reputation: 87
I am trying to get gmail content(body) like Wrike(https://i.sstatic.net/6qftV.jpg) but getting the above error.
"Access denied: : Not allowed for full access to mail message"
Logger.log(mail.getPlainBody());
Upvotes: 1
Views: 1764
Reputation: 59
Found it. I replaced scope "https://www.googleapis.com/auth/gmail.addons.current.message.metadata" with "https://www.googleapis.com/auth/gmail.addons.current.message.readonly"
Note: scope was not added, it was replaced. With both entries, it seemed to revert to the lower permission scope (metadata) rather than the higher one (readonly).
Got the scope information I needed here: https://developers.google.com/gmail/add-ons/concepts/scopes
Upvotes: 1
Reputation: 1
Also try adding the body with the following section,
section.addWidget(CardService.newKeyValue()
.setTopLabel('Body')
.setContent(mail.getBody()));
Worked for me.
Upvotes: 0
Reputation: 269
Without seeing your code it seems to me that you need to include in your
"appsscript.json" file the correct scope.
// This scope allows you to: 'View your email messages and settings'
"oauthScopes": ["https://www.googleapis.com/auth/gmail.readonly"]
// This scope gives you full access to your Gmail - 'Read, send, delete, and manage your email'
"oauthScopes": ["https://mail.google.com/"]
see the scope documentation here: https://developers.google.com/identity/protocols/googlescopes#gmailv1
Upvotes: 2