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

How do I acknowledge an android in app purchase in nodeJS

At the moment, I am authenticating as my linked android apps google service account to verify and try to acknowledge android in app Subscriptions. I can verify them using the GET call, but when i make the POST and append :acknowledge to the end of…
2
votes
1 answer

googleapi/drive in node.js

I am trying to integrate googleapi/drive using Node.js and also I need to integrate the API in React.js. What issue I am facing into is that I am getting a couple of weird error messages in the front-end. I have the following codes in Node.js. …
2
votes
1 answer

Google Drive API - Invalid service account credentials

I am learning to use the Google Drive API and started with a small script isloated away from anything: import * as fs from "fs"; import * as gdrive from "@googleapis/drive"; const auth = new gdrive.auth.GoogleAuth({ keyFile: "creds.json", …
2
votes
2 answers

errorMessage: "Error: ENOENT: no such file or directory, open '/var/task/credentials.json'" errorType: "Runtime.UnhandledPromiseRejection"

I am working on a Next JS app using google Sheet api for a personal project. Now this works completely fine on my local. But when I am deploying it to Netlify, this error pops up. Can someone put up a solution? Thanks! Here is my code: import {…
2
votes
1 answer

Why is @google-cloud/profiler throwing 'permission_denied' errors when running inside a GKE instance?

I have been following the instructions on https://cloud.google.com/profiler/docs/profiling-nodejs#gke to use the gcloud profiler for my nodejs application: I added RUN npm install @google-cloud/profiler to my dockerfile. And I…
2
votes
1 answer

invalid_grant error trying to refresh access token for googleapis

We use the googleapis for our web app and store and manage the access token and refresh token to our database. When we refresh the access token of users using refresh token, rarely we had the GaxiosError: invalid_grant. Now, we use the google api…
2
votes
1 answer

How to use googleapis google.auth.GoogleAuth() for google API service account in Twilio serverless function?

How to use googleapis google.auth.GoogleAuth() for google API service account in Twilio serverless function, since there is no FS path to provide as a keyFile value? Based on the example here (…
2
votes
1 answer

google calenderID nodejs doesn't work with specified CalendarID

I would like to use a google calendar, if I choose the calendar ID not as primary but with the specified one, I get an error message in line 46 (const eventsArray = res.data.calendars.calID.busy). The Error message looks like this (node:49993)…
2
votes
1 answer

Authentication is not working for google cloud API authentication with NodeJS

I am trying to download a file from google drive using Google service account. For that I have created a project, created a service account and keys. Now when I am trying to use google auth api, It is returning undefined. Please find the code…
2
votes
1 answer

Sheets API values.get sporadically returns Loading... when I try to get values for a cell

Scenario: Using API, do the following: Write a value on A1 Write another value on B1 A custom formula present on C1 computes the result Get the value from C1 Sporadically the value for C1 will end up being Loading... which is a placeholder value…
2
votes
1 answer

How to print all folder names from the parent folder in google drive?

I am trying to print all folder names from the parent folder in google drive I tried so many methods but not working.. const drive = google.drive({ version: 'v3', auth }); console.log("Drive => ", drive.drives.appdata); drive.files.list({ …
mkHun
  • 5,891
  • 8
  • 38
  • 85
2
votes
1 answer

How to validate JWT token from Google pub/sub push (No pem found for envelope)

Context I'm following Google's RTDNs guide on enabling Real-Time Developer Notifications. I've successfully created the topic and subscription and have received the push notifications sent to the API that I have created. I would now like to…
2
votes
1 answer

Google calendarList not returning new calendar resources using a service account

I have an application used for the room booking which connects to a G Suite calendar and allows you to list/book/cancel meetings. To do so, a request is made initially to collect the list of email resources associated to a service account, like…
2
votes
1 answer

Do batch requests for the YouTube Data API work?

I send a request to https://www.googleapis.com/batch/youtube/v3, but I get a 404 anyway. Perhaps I am sending the request incorrectly, but most likely the endpoint is not working. As well as, I use Postman to test with next creds: 1. POST request to…
2
votes
2 answers

Calling google drive api from nodejs backend with authorisation from front end

I currently have an application that requires me to call the google drive api from the client and the server. Right now, I've already authenticated the user on the front end with auth 2.0 and I can upload files just fine. Most of the code for this…