May 29, 2020

403 error with 'Request had insufficient authentication scopes.' as message insufficientPermissions

Hello

by trying to send email from my gmail account with below code (which provided in https://developers.google.com/gmail/api/v1/reference/users/messages/send) i got error, with error code 403, message 'Request had insufficient authentication scopes.' and reason is like 'insufficientPermissions'

what should i do, need some quick help


sendEmail(userId, email, callback) { // Using the js-base64 library for encoding:
// https://www.npmjs.com/package/js-base64

gapi.load('client:auth2', () => {
gapi.client.load('gmail', 'v1', () => {
console.log('Loaded Gmail');
let base64EncodedEmail = Base64.encodeURI(email);
let request = gapi.client.gmail.users.messages.send({
'userId': userId,
'resource': {
'raw': base64EncodedEmail
}
});
request.execute(callback);
});
})
}
Locked
Informational notification.
This question is locked and replying has been disabled.
Community content may not be verified or up-to-date. Learn more.

No replies yet

false
8477189242364302207
true
Search Help Center
true
true
true
true
true
99729
false
false
false
Search
Clear search
Close search
Main menu