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

How do you locate and delete the auth information that google saves to your disk file to connect to the api with a different email? NODE.JS on MAC OS

I ran a test run to learn how to connect to google calendar api via node.google auth with node js I re-walked through the steps to attempt to connect my actual project to google calendar api, but when i run node quickstart.js i get this error:…
0
votes
1 answer

Google Analytics Multiple Date Ranges - NodeJS

How can I get a report using multiple date ranges, like the example listed below, using nodeJS client library? It was taken from https://developers.google.com/analytics/devguides/reporting/core/v4/basics#multiple_date_ranges POST…
Marrone
  • 487
  • 2
  • 7
  • 18
0
votes
2 answers

why using var {google} instead of var google in google.auth.OAuth

This code is from oauth nodesjs. I want to ask why we are using '{}' around the var google? I also tried using it without '{}' and got error OAuth2 is undefined. i can't understand what is happening here. var {google} = require('googleapis'); var…
Dishank Jindal
  • 73
  • 1
  • 10
0
votes
1 answer

unable to get a response with people.connections.list

⚠️ I forgot a process.exit(0) in the main thread, so the app was terminated before the callback was executed. This code sample works like a charm. Here is the code from googleapis nodejs client I have issue on: First thing first, I would like to…
enguerran
  • 3,193
  • 3
  • 26
  • 42
0
votes
1 answer

Calendar API gives an error while inserting events using events.insert: There was an error contacting the Calendar service: Error: Missing end time

I used the code sample in Quickstart and tried inserting an event using the example on - https://developers.google.com/calendar/v3/reference/events/insert#examples I checked the resources available over the web and none of them seem to be working…
0
votes
2 answers

Youtube nodejs API process response

I have managed to upload video to YouTube via google nodejs API. But I didnt figure out a way to get the url of the video which has been uploaded. When i log the the data which i get as response it seems like { status: 200, statusText: 'OK', …
0
votes
1 answer

Check file exists before creating Google Drive API

I have put together a script that creates a file in a folder on Google Drive, when I make amendments to that file and push it back up it will create a new version (which is obviously correct). What I would like to do is check that the file exists…
Richlewis
  • 15,070
  • 37
  • 122
  • 283
0
votes
0 answers

What is needed to access a file in Google Drive using a Service Account and impersonate?

With a Google Suite Business plan, I need to get a file from some user and copy it to Team Drive folder owned by ANOTHER user through a Service Account properlly authorized by Domain-Wide-Delegation. My approach: considering that Service Account has…
0
votes
0 answers

With Google Drive API V3, Why setting permission to a recently copied file causes 'File not found' error?

The scenario is: with a OAuth 2.0 client created in https://console.developers.google.com/apis/credentials, I want to pick some file from a user Google Drive (user space) in G Suite Business and then copy it to some folder in a Team Drive of another…
0
votes
1 answer

Google APIs OAuth refresh token url return 401 on http redirect uri?

I had implemented the code to received authorization code as described in this step: https://developers.google.com/android-publisher/authorization#generating_a_refresh_token We deployed this code to one server that has "https://..." domain and this…
0xh8h
  • 3,271
  • 4
  • 34
  • 55
0
votes
0 answers

No results from promise in Express Routing

I'm using NodeJS, Express and GoogleApis en Google-oauth-jwt to authenticate. I'm having problems with getting data from my second promise function (getData). I can succesfully retrieve a token, when I use res.json(myToken) in the…
0
votes
0 answers

Directory API users.list returns 403 with service account

I'm trying to use a Service Account to programmatically create users with the Admin Directory API. The service account has been granted domain-wide delegation and has been authorized by an admin with the…
0
votes
0 answers

Facebook graph API to crawl my 'news feed'

I'm creating a small app that uses text mining from several different social networks. The Twitter API was really useful and easy to use, but with facebook i'm having some troubles understanding which features i need to use. My goal is to get real…
0
votes
1 answer

Is it possible to load contact pictures using google's people api?

I'm trying to find my way around Google's People API. So far, I've been able to load the contact groups using try{ contact_groups = await new Promise(function(resolve, reject){ people.contactGroups.list({ auth: oauth2Client …
0
votes
1 answer

How to handle Google API access_token expired without using google-api-nodejs-client?

I've implemented the code to get access_token, refresh_token and expire_date. All these values are stored in the database already. Now I need a way to get another access_token in case the old one is expired without using google-api-nodejs-client…
0xh8h
  • 3,271
  • 4
  • 34
  • 55