Questions tagged [google-api-nodejs-client]

google-api-nodejs-client is Google's officially supported node.js client library for accessing Google APIs, it also supports authorization and authentication with OAuth 2.0.

This client comes with an OAuth2 client that allows you to retrieve an access token and refreshes the token and re-try the request seamlessly if token is expired. The basics of Google's OAuth 2.0 implementation is explained on Google Authorization and Authentication documentation.

Note: This library is currently in alpha status.

The project's home page can be found on GitHub

816 questions
3
votes
0 answers

googleapis revokeCredentials not returning a result in successful callback

According to the test suite the callback function passed to revokeCredentials gets a result object if the operation was successful which should contain a success property. However, when I use this snippet: oauth2client.revokeCredentials(function…
JaKXz
  • 1,665
  • 1
  • 14
  • 34
3
votes
2 answers

Google Contacts API nodejs

I've been looking through the Google NodeJS API docs, but I don't see one listed for the Contacts API. Am I missing something or is that not included in the module?
3
votes
2 answers

how to use the refreshAccessToken method to generate a new accesstoken in google-api-nodejs-client

I see that this pull request adds a method to refresh the access token using a saved refresh token. It is not clear to me how to use it. I have saved the tokens (including the refresh token) from the original getToken request and am now retrieving…
kpg
  • 7,644
  • 6
  • 34
  • 67
3
votes
1 answer

Google Drive API push notifications can't be stopped / cancelled

I am watching a Drive resource. Setting up the watch (using the googleapis 0.2.13-alpha client with node.js and drive.file.watch): exports.subscribeDriveCallbacksCmd = function( user, fileId ){ var userId = user.id; var baseUrl =…
Prisoner
  • 49,922
  • 7
  • 53
  • 105
2
votes
2 answers

Google authentication using passport: Unable to force the user to pick an account again when he tries to sign-in after the first time

I have successfully implemented authentication using gmail account in my app. The problem is when the user signs-in again, the browser automatically picks the previous account which breaks the flow as I will explain below. p Based on my research,…
2
votes
2 answers

Document AI Contract Processor - batchProcessDocuments ignores fieldMask

My aim is to reduce the json file size, which contains the base64 image sections of the documents by default. I am using the Document AI - Contract Processor in US region, nodejs SDK. It is my understanding that setting fieldMask attribute in…
redvivi
  • 83
  • 8
2
votes
1 answer

insufficient_scope when trying to use Google admin.directory.group API with ADC

I am trying to use ADC to use Google Admin directory/groups API but getting insufficient_scope error. My email address attached to ADC is a super admin in Google workspace. I am not sure whats going wrong, here is the code: const {google} =…
2
votes
1 answer

Google calendat events list UnhandledPromiseRejectionWarning: Error: Insufficient Permission

trying to get google calnedar events list but getting error UnhandledPromiseRejectionWarning: Error: Insufficient Permission here is my code example const oauth2Client = new google.auth.OAuth2( process.env.GOOGLE_CLIENT_ID, …
2
votes
0 answers

I am not able to give permission to created folder in google drive using google drive APIs

I have been trying to create a folder with a service account using google drive APIs in google drive. I can see that folder in the google folder list API but not in the google drive GUI. Here is the code which I tried to create a google drive…
2
votes
1 answer

How can I add new training phrases to an intent in Dialogflow CX using its API?

I want to know if it's possible to train Dialogflow CX through API. By placing the new training phrases in my code (I am using NodeJS) and automatically update the list of phrases in that intent. One thing to add, I want to add a new phrase to the…
2
votes
0 answers

Googleapi Invalid feed id

I'm working with googleapi for nodeJS and as I'm trying to insert a new product I get this error: { error: { code: 400 , message: '[feedId] Invalid feed id: **feed id**' , errors: [ { message: '[feedId] Invalid feed id: **feed id**', domain: …
2
votes
1 answer

Unable to write through service account access in google spread sheet api (node js)

I have a google sheet and I am able to read from google sheet by giving access to service account. Below is the snippet of code for reading. // configure a JWT auth client let jwtClient = new google.auth.JWT( privatekey.client_email, …
2
votes
1 answer

How to refresh an access token for the youtube-data-api v3

I'm using v3 of the youtube data api for my server. So far I'm able to create a token by getting a code from the redirect. oauth2Client.getToken(req.query.code, function(err, token) { if (err) { …
2
votes
1 answer

What are REDIRECT_URI and REFRESH_TOKEN needed for in the Google Drive API?

I have doubts about how the Google Drive API works and how should I use it for my use cases. I have a REST API (based on NodeJS) which uploads documents in the drive. The only user that is actually accessing the drive is the one that runs the REST…
2
votes
0 answers

Gmail api with workload identity federation

I have created a workload identity pool with a third-party (auth0) provider. I have configured my service account with a domain-wide delegation and have enabled GMAIL API as well. I could generate STS token successfully but while executing mail…