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
2 answers

Google Drive API Progress Bar Bug

I wrote the following code to upload a file to my Google Drive account. It works just fine. Then i tried to add some upload progress tracker but i ran into some issues. It works but the progress goes almost instantly to 100%, way before the upload…
3
votes
1 answer

Google Sheet Api get function returning undefined value in nodejs

function changeData(auth,sheetId) { var sheets = google.sheets('v4'); sheets.spreadsheets.values.update({ auth: auth, spreadsheetId: sheetId, range: 'Sheet1!D6', valueInputOption: "USER_ENTERED", resource: { values: […
Mushfiq
  • 49
  • 4
3
votes
1 answer

googleapis "appProperties" field not being returned for files in node

I'm trying to get the appProperties field to be returned with my files on gdrive, but currently unable to get it working. "googleapis": "^29.0.0" Here's my scopes and fields: scopes: [ "https://www.googleapis.com/auth/drive", …
Mk-Etlinger
  • 174
  • 1
  • 13
3
votes
2 answers

Current method to get new access token from refresh token

I see some questions about this with solutions that seem to be deprecated in the Google APIs Node.js Client OAuth API (e.g., this and this). There's no documentation I can see regarding using the refresh token to get a new access token (docs…
alexbea
  • 1,311
  • 14
  • 25
3
votes
3 answers

Error: connect ECONNREFUSED 127.0.0.1:3306 when using cloud sql for MYSQL from NodeJS app

I followed all the steps mentioned in this sample app link. GitHubLink. When running the script (npm run init-cloudsql) to initialize mysql database, I get an error…
3
votes
1 answer

Google People API connections list returns empty response

I am trying to fetch the list of a person's contacts using Google People Api. It works well on the "try this interface" on the google developer console. But while trying to fetch responses using googleapis or HTTP Call…
Baljeet
  • 41
  • 9
3
votes
1 answer

GCS - The project exceeded the rate limit for creating and deleting buckets

I am using node.js application running on Google Compute engine to create GCS bucket for each user. The bucket creation is a one time activity for each user. But when I try to run the program to create unique buckets for 20 users in parallel, I am…
Remya
  • 31
  • 2
3
votes
4 answers

File Upload With Loopback

I created a simple file uploading application with loopbackjs. In the application's client side I used simple HTML and Javascript code, calling a loopback api with an AJAX call: $('#upload-input').on('change', function () { var files =…
3
votes
1 answer

Google Drive API Service Account inside domain

I have to download/upload/delete files from a folder on Drive with a Node.js server. That folder is inside the G Suite of the company, and only a few people in the company has access. I have to use a Service Account to do this, the question is: is…
3
votes
1 answer

Google API invalid request after access token expires

This is the comment that led me to ask this question. I've got a server side Node.js app, using googleapis package. Users log in with their Google accounts, and I store tokens in their session. The credentials I get are as follows { access_token:…
user6362927
3
votes
2 answers

Google OAuth2 API Refresh Tokens

I'm using the google-auth-library-nodejs library to integrate into a number of GMail accounts, to get lists of emails. My process flow is simple: 1) Try to authorize the client, using this function: function _authorise(mailBox, callback) { let…
go4cas
  • 1,171
  • 5
  • 14
  • 27
3
votes
0 answers

how to automatically get the authorization token for node google apis for gmail

I'm having trouble figuring out how to get the authorization to be automatic for a user. I need to get the oauth token automatically becuase my software is all voice command, but when you try and retrieve a users email it gives you a like to go and…
Grant Zukel
  • 1,153
  • 2
  • 24
  • 48
3
votes
1 answer

node.js(Javascript) google-api-nodejs-client - list messages

My question was voted down, so i am rewriting it hopefully this is more succinct I am stuck at writing a javascript function to list messages in inbox. Using - official "google-api-nodejs-client", node.js, electron, (and javascript) Goal: list…
david
  • 53
  • 6
3
votes
2 answers

Get upload progress for Google Drive NodeJS client?

After we get the request object from req = drive.files.insert how to use it find file upload progress ? I searched for it in the req string by calling it multiple times but to no avail. function uploadFile(){ var path =…
skwalker
  • 329
  • 2
  • 15
3
votes
3 answers

Node JS - Youtube API Is Blank

I downloaded and installed the google apis with npm install googleapis and now i'm trying to access the api in my node js file with this code: var google = require('googleapis') var youtube = google.youtube({version: 'v3', auth: API_KEY}) However,…