Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create PUT request object with this library ? #30

Open
suchibharani opened this issue Mar 15, 2018 · 0 comments
Open

How to create PUT request object with this library ? #30

suchibharani opened this issue Mar 15, 2018 · 0 comments

Comments

@suchibharani
Copy link

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/[email protected]/settings/sendAs/[email protected]',
method : 'PUT',
json : true,
jwt: {
// use the email address of the service account, as seen in the API console
email: '[email protected]',
// 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: '[email protected]'
}
}, function (err, res, body) {
console.log(res);
});

I tried using "qs" to pass params but no luck.
Please help me on this.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant