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

What keyFile key does google.auth.GoogleAuth() need?

Goal Using googleapis with firebase functions. Get a JWT token so firebase functions can use a service account with domain-wide delegation to authorize G Suite APIs like directory and drive. Question What goes in path.join(); What is __dirname What…
4
votes
1 answer

What's the simplest way to run a node.js script periodically on Google's Cloud Platform?

I've written a node js script that does a scraping job (selenium) and logs the results to Google sheets (Google sheets api). I need to make the script run completely automatically- not me running it daily on my system. What would be the simplest way…
4
votes
1 answer

Using Slack's API dialog_open from Firebase Cloud Functions

Goal A Slack Event-Subscription event is hitting my Firebase Endpoint, and then, a Firebase Cloud Function is using the dialog_open endpoint to open a dialog in Slack with some values from Firebase. Issue When the Firebase Cloud function hits…
4
votes
1 answer

how to get tasks that have a due date from task lists in nodejs Google Tasks API?

in this page there is a nodejs example to get all task lists from Google Tasks. I get it to work and I've been playing around to get the tasks of each task list that have a due date, but i haven't even been able to get all tasks associated to a task…
4
votes
1 answer

Decoding protoPayload from Google Logging API

I want to read BigQuery log entries to do some analysis. But I can't seem to get the protoPayload.value decoded. I've tried messing around with the google-proto-files and protocol-buffers packages, but I think I'm missing something really obvious…
4
votes
1 answer

Google DRIVE API V3 - Get a root folder ID with nodejs

I need to get root folder id and filter folders which have root folder as their parent folder. Using Nodejs and google drive API v3 . This is my code and how I change this code to get root folderId? const service = google.drive('v3'); …
4
votes
2 answers

Why does Google use backticks or "template literals" in these NodeJS require functions?

See the code below from lines 14-20 of this GitHub file. Why does Google use backticks or "template literals" in the require functions, instead of regular single or double quotes? The code is from a testing script in Google's tutorial for using…
4
votes
1 answer

Google Sign-in and Google Sheets API V4

I am trying without success to "Add Google Sign-In to Your Web App" and then use Node.js with Google Sheets API V4 to be able allow my app to use the sheets api on behalf of the user (with scope: https://www.googleapis.com/auth/spreadsheets). I'm…
4
votes
1 answer

Gmail API nodejs messages.list labelIds not working

I am using node.js in a server to access a user's Gmail Inbox. The OAuth2 part works great, but when I try to specify the INBOX to get a message list, it seems to be ignored. I get the complete array of message ids, not just ones in the INBOX. In…
4
votes
2 answers

Using Google Drive API

I am in the process of setting up data scraper that writes the data to an excel file and then I want to upload those files to a folder in my own drive account. This will be done once a day via a scheduler, so fully automated is the aim here. I am…
Richlewis
  • 15,070
  • 37
  • 122
  • 283
4
votes
0 answers

ID Token Verification doesn't actually require a client ID/audience?

While developing an iOS and Android app for a backend API, I'm using separate client IDs for each. However, I noticed something that I find odd, and I'm hoping someone can explain why this works and if it's ok to work this way. What I noticed is…
4
votes
2 answers

Node.js @google-cloud/logging-winston not working inside a GCE instance

I am using npm @google-cloud/logging-winston to send application log events to google stack-driver log sinks. Below is my code snippet and it works perfectly fine in my local macbook. When i try to run it inside a GCE instance (ubuntu 16.10 image…
4
votes
0 answers

How to avoid ETIMEDOUT on google api node js client?

I am using Google Api Nodejs Client and I receive frequently some timeouts on my API calls (the biggest part of my requests are on the Gmail Api). I can perform at the same time some Google Cloud SQL requests, so it does not seem to be a network…
4
votes
1 answer

How to use sheets.spreadsheets.batchUpdate() to apply formatting?

I am attempting to automatically apply new formatting to my spreadsheet, however while it does not appear to cause any errors, it is not working. My goal is to apply duration formatting to columns G and H (index 6 and 7) of my spreadsheet. I am…
David Hackett
  • 235
  • 2
  • 7
4
votes
3 answers

Google Authentication Token return doesn't contain refresh_token

I write an example about google api using. Google NodeJS Client library. I have followed the instruction set access_type : 'offline', however the object return doesn't contains refresh_token. My Code: var http = require('http'); var express =…