You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Below is the example code.
// obtain a JWT-enabled version of request
var request = require('google-oauth-jwt').requestWithJWT();
request({
url: 'https://www.googleapis.com/gmail/v1/users/xx.xx@goldenequator.com/settings/sendAs/xxx@xxx.com',
method : 'PUT',
json : true,
jwt: {
// use the email address of the service account, as seen in the API console
email: 'xxx-email-sign@xxx-email-signature.iam.gserviceaccount.com',
// use the PEM file we generated from the downloaded key
keyFile: 'xxx-email-sign.pem',
// specify the scopes you wish to access - each application has different scopes
scopes: ['https://mail.google.com/','https://www.googleapis.com/auth/gmail.modify',
'https://www.googleapis.com/auth/gmail.readonly','https://www.googleapis.com/auth/gmail.settings.basic',
'https://www.googleapis.com/auth/gmail.settings.sharing'],
delegationEmail: 'xxxx@xxx.com'
}
}, function (err, res, body) {
console.log(res);
});
I tried using "qs" to pass params but no luck.
Please help me on this.
Thanks
The text was updated successfully, but these errors were encountered:
Below is the example code.
// obtain a JWT-enabled version of request
var request = require('google-oauth-jwt').requestWithJWT();
request({
url: 'https://www.googleapis.com/gmail/v1/users/xx.xx@goldenequator.com/settings/sendAs/xxx@xxx.com',
method : 'PUT',
json : true,
jwt: {
// use the email address of the service account, as seen in the API console
email: 'xxx-email-sign@xxx-email-signature.iam.gserviceaccount.com',
// use the PEM file we generated from the downloaded key
keyFile: 'xxx-email-sign.pem',
// specify the scopes you wish to access - each application has different scopes
scopes: ['https://mail.google.com/','https://www.googleapis.com/auth/gmail.modify',
'https://www.googleapis.com/auth/gmail.readonly','https://www.googleapis.com/auth/gmail.settings.basic',
'https://www.googleapis.com/auth/gmail.settings.sharing'],
delegationEmail: 'xxxx@xxx.com'
}
}, function (err, res, body) {
console.log(res);
});
I tried using "qs" to pass params but no luck.
Please help me on this.
Thanks
The text was updated successfully, but these errors were encountered: