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
1 answer

Google Search Console API: How do I Solve "User does not have sufficient permission for site"? (When User Has Permissions)

I'm trying to use Google's Search Console API via their Node package, and my code looks like the following: const auth = new GoogleAuth({ scopes: 'https://www.googleapis.com/auth/webmasters.readonly', }); const webmasters =…
3
votes
1 answer

Listing folders and files within them from particular folder in Google drive

I am trying to get the list of files and folders from a particular folder in google drive using node.js. However I am only getting the list of folders and not the files within those folders. What am I doing wrong? Here is my code. app.get('/getFF',…
3
votes
2 answers

Not Authorized To Access This Resource/API (GCP)

I set up a service account with domain-wide delegation and I passed the client email, private key, scopes, and a user email the JWT method to impersonate a G-Suite user. I then get specific user info from the Admin API and use it to create an email…
3
votes
1 answer

Send live stream packets to youtube with nodejs?

So I'm trying to create an application that will be able to send packets to Youtube as a live stream. So basically I enter my url to the program (rtmp://a.rtmp.youtube.com/live2) and then it would start streaming and sending packets of an image of…
3
votes
1 answer

NodeJs and Google Colab

I need to pass an array/or parameters from NodeJS to a notebook of Colab or Notebook of Jupiter. How I can do that? There is possible some solution? Thank you!
3
votes
1 answer

NodeJS Invalid_grant gaxios.js:85:23

In my Node.js application I use googleapis with oauth2 authentication to send an email. Suddenly, I Found this error when I start the application. (node:1333) UnhandledPromiseRejectionWarning: Error: invalid_grant at Gaxios._request…
3
votes
1 answer

How to use Service Account to access GMAIL API for a GSuite email account

I want my service account to impersonate one of the users in the GSuite. I have created a project via GCP enabled GMail API in the project added a service account to that project enabled the domain-wide delegation in the service account settings on…
3
votes
1 answer

How to move file to trash using NodeJS and Google Drive API v3

How to move a file to trash using NodeJS and Google Drive API v3. Below lines are NOT working: await drive.files.update({ fileId, trashed: true }); // not working await drive.files.update({ fileId }, { trashed: true }); // not working
3
votes
3 answers

Get readable stream from drive.files.get

I am writing a nodejs function to transfer files from google drive to some other place Following is the sample code block to get file from drive var fileId = '0BwwA4oUTeiV1UVNwOHItT0xfa2M'; var dest =…
Solaris
  • 674
  • 7
  • 22
3
votes
1 answer

How to use Google Tag Manager in Node.js

I'm pushing a simple ecommerce object to the Google Tag Manager dataLayer on the client side. It's working fine but I need to move this to the server. I found the Google API Node.js Client Library but it's still pretty young and I'm not able to find…
3
votes
1 answer

Create Google Sheets document in a folder (without moving and deleting the old one)

I'm looking at: https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/create and there does not appear to be a 'parents=[]' parameter in the request input parameter to create a google sheet. sheets.spreadsheets.create(request,…
3
votes
1 answer

What's the difference between revokeCredentials and revokeToken?

revokeCredentials: Revokes access token and clears the credentials object revokeToken: Revokes the access given to token. What's the difference? There is no doc and sample for explaining these two methods here.
Lin Du
  • 88,126
  • 95
  • 281
  • 483
3
votes
1 answer

BigQuery - How to paginate over result

I have the following problem: We have a table (partitioned by timestamp) that saves data from IoT devices (a lot of data, the expected ratio for new incoming data is about every 30sec each device). The problem is that we will serving a query service…
sarasa
  • 75
  • 2
  • 11
3
votes
0 answers

Google Calendar API - Deeper insight into calendar usage limits exceeded errors

I have an application that's been running since 2015. It both reads and writes to approx 16 calendars via a service account, using the Google node.js library (calendar v3 API). We also have G Suite for Education. The general process is: Every 30…
John P.
  • 41
  • 3
3
votes
1 answer

Exponential backoff for google-api-nodejs-client

Does google-api-nodejs-client provide exponential backoff or does it handle the limit of API usage?