We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello i'm trying to make a simple bot for blogspot with insert publish delete
but i'm stuck on oauth2Client, can you help me ?
What i try :
1° get the token code :
const oauth2Client = new google.auth.OAuth2( 'CLIENT_ID , 'CLIENTE SECRET ID ', 'REDIRECT URL ' ); const scopes = [ 'https://www.googleapis.com/auth/blogger' ]; const url = oauth2Client.generateAuthUrl({ // 'online' (default) or 'offline' (gets refresh_token) access_type: 'offline', scope: scopes });
console.log(url);
2° paste de url in the browser to login on google
3° then with the tonken code
const {tokens} = oauth2Client.getToken('TOKEN CODE THAT WAS RETURN ) oauth2Client.setCredentials({ access_token: tokens, // Optional, provide an expiry_date (milliseconds since the Unix Epoch) expiry_date: (new Date()).getTime() + (1000 * 60 * 60 * 24 * 7) }); const blogger = google.blogger({ version: 'v3', auth: oauth2Client }); async function runSample () { console.log("running") const res = blogger.posts.insert({ blogId: 'BLOGID', requestBody: { title: 'Hello from the googleapis npm module!', content: 'Visit https://github.com/google/google-api-nodejs-client to learn more!' } }); console.log(res.data); return res.data; } runSample();
the response is
Error: No access, refresh token or API key is set
i already refresh the keys and same old thing
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello i'm trying to make a simple bot for blogspot with
insert
publish
delete
but i'm stuck on oauth2Client, can you help me ?
What i try :
1° get the token code :
console.log(url);
2° paste de url in the browser to login on google
3° then with the tonken code
the response is
Error: No access, refresh token or API key is set
i already refresh the keys and same old thing
The text was updated successfully, but these errors were encountered: