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

Google API, drive.files.list and returning child files only

I am using the 'googleapis' library in NodeJS and I am trying to return the list of files and folders in the currently specified folder, but instead I find drive.files.list returns all files that the user has been granted permissions to read. My…
Andre M
  • 6,649
  • 7
  • 52
  • 93
4
votes
1 answer

How can I post a comment on a YouTube video? (Node.js)

I want to post a comment on a YouTube video programmatically using google-api-nodejs-client. Any ideas how can I do so? I would really appreciate if a code sample is provided. Thanks!
AboulEinein
  • 1,101
  • 3
  • 13
  • 27
4
votes
0 answers

Token validation from backend for Google+ Login on Android Application

I am following this link to validate the token. It is mentioned in the link that for more than 100 requests we should follow below approach. Using one of the Google API Client Libraries is the recommended way to validate Google ID tokens in a…
Ashwani K
  • 7,880
  • 19
  • 63
  • 102
4
votes
2 answers

Send email using Google API with only access token

I want to send an email through Google API without the unnecessary OAUTH2 parameters. I only have the access_token and the refresh_token of that user. How can I send an email through Gmail API through a basic POST request in NodeJS, with Request npm…
Yagiz
  • 1,033
  • 2
  • 21
  • 47
4
votes
1 answer

Video upload using youtube/google API directly from server using node.js?

I am trying to upload videos from server without any manual authentication by user in the client side . I tried the below code snippet for video upload but it authenticates the user in the browser and asks for the acceptance of the app. var…
4
votes
1 answer

"socket hang up" error when calling Google API via node client

Below code calls the Google Analytics Reporting API using Google's nodejs client version 0.7 here. It returns a socket hang up error on some executions but not always. Would this be errors on Google's servers' end? Is there an easy way to debug? BTW…
4
votes
0 answers

Inserting Google Analytics Content Experiments using the Node.JS Client Library

I'm trying to configure a content experiment using the Node.js Client Library, and have not been able to work out the syntax. Where do I put the body (an Experiment resource) as described here?…
4
votes
1 answer

How to make POST API calls with google-api-nodejs-client?

I am trying to make a Google Calendar push notification API call (https://developers.google.com/google-apps/calendar/v3/push). I figured out how to make a calendar list call. So, I am fairly confident that my Oauth 2.0 authentication piece is…
Jason Liu
  • 186
  • 5
3
votes
2 answers

How to call Google Drive API from Cloud Function for Firebase on behalf of a user?

I want to interact with the Google's Drive API from a Cloud Function for Firebase. For authentication / authorization, I am currently relying on getClient, which I believe uses the Service Account exposed in the Cloud Function environment: import {…
3
votes
1 answer

How to create draft in gmail api

I am trying to create a new draft for a user with the gmail api, however i am getting an error I dont understand. I searched but can't find a way to fix this error in gmail api, i know how to fix it please help error code: 403, errors: [ { message:…
3
votes
2 answers

Application Default Credentials http trigger GCP function from local nodejs application

I want to trigger a GCP cloud function from a simple nodejs app running locally. Reading the documentation it should be simple: run gcloud auth application-default login to write ADC to file used by client libraries. use google-auth-library to get…
3
votes
1 answer

Is OAuth 2.0 required for accounts.locations.reviews.list "My Business API"?

I have a React Application which is going to leverage Google My Business API to get review data of a business. I was expecting to use the API-KEY via REST approach however Authorization Scope mentions that OAuth 2.0 is required to use this…
3
votes
0 answers

How to convert audio.mp3 to audio.flac?

Google cloud speech to text only accepts flac or raw formatted audio files. I want to convert an audio.mp3/wav file to audio.flac but the converter functions I am using is not working properly. Can anyone suggest me a better way to convert…
3
votes
1 answer

google-auth-library has missing dependencies when installed

I am trying to use google-auth-library with a react app but am getting various errors which seem to indicate missing dependencies. The errors are all in a format similar to this: Module not found: Error: Can't resolve 'buffer' in…
3
votes
1 answer

Google Analytics RunReport return 7 PERMISSION_DENIED: User does not have sufficient permissions for this property

I want to run a google analytics report using runReport. I have followed the instructions at https://developers.google.com/analytics/devguides/reporting/data/v1/quickstart-client-libraries and made a copy of the code that uses json-credentials at…