google-api-nodejs-client

nodejs googleapis, authClient.request is not a function

岁酱吖の 提交于 2019-12-22 03:34:00
问题 I am creating an oauth2client in one function like so and returning it. I actually do pass in the clien id, secret, redirect url, and credentials. Those are all correct from what I have checked. var OAuth2 = google.auth.OAuth2; var oauth2Client = new OAuth2(CLIENT_ID, CLIENT_SECRET, REDIRECT_URL); ... credentials = { access_token: accessToken, refresh_token: refreshToken }; oauth2Client.setCredentials(credentials); I then do this in the function where the oauth2client object is returned: var

Error every time I run datastore.runQuery: one of fields Query.query and Query.gql_query must be set

对着背影说爱祢 提交于 2019-12-20 07:01:13
问题 I'm trying to run a simple query against my Google Cloud datastore using google-api-nodejs-client. I want to query for all entities matching a given kind. When I run this query using the "Try it now" tool it works fine: Request POST https://www.googleapis.com/datastore/v1beta2/datasets/healthier-staging/runQuery?key={YOUR_API_KEY} { "query": { "kinds": [ { "name": "Subscriber" } ] } } Response 200 OK { "batch": { "entityResultType": "FULL", "entityResults": [ { "entity": { "key": {

Error every time I run datastore.runQuery: one of fields Query.query and Query.gql_query must be set

家住魔仙堡 提交于 2019-12-20 07:00:44
问题 I'm trying to run a simple query against my Google Cloud datastore using google-api-nodejs-client. I want to query for all entities matching a given kind. When I run this query using the "Try it now" tool it works fine: Request POST https://www.googleapis.com/datastore/v1beta2/datasets/healthier-staging/runQuery?key={YOUR_API_KEY} { "query": { "kinds": [ { "name": "Subscriber" } ] } } Response 200 OK { "batch": { "entityResultType": "FULL", "entityResults": [ { "entity": { "key": {

How to resumable upload with google drive node.js

会有一股神秘感。 提交于 2019-12-19 11:26:56
问题 Hey since google drive was changing their library I´am not able to upload anymore files bigger than 5MB with the basic upload drive.files.create . The docs told me that I have to choose resumable uploads instead. But google drive didn´t provide any sample code and aswell I can´t find anything on google. Maybe it´s important to know that I can upload files smaller than 5MB with the drive.files.create So there is no problem with the auth. https://developers.google.com/drive/v3/web/resumable

Error 500 backendError with Gmail API and Google APIs Node Client

喜欢而已 提交于 2019-12-19 07:25:26
问题 I'm trying to use the new Gmail API with the Google API Node client. I created a new project from the developer console, set up a new "Service Account" Client ID, and enabled access to the API. As a proof of concept, I am simply trying to list the threads in my inbox. When I enable the OAuth 2.0 toggle for the API explorer and enter my email address, the request succeeds and I see a JSON response with data. Now I try to do the same in Node: var googleapis = require('googleapis'); var SERVICE

Error 500 backendError with Gmail API and Google APIs Node Client

北战南征 提交于 2019-12-19 07:25:09
问题 I'm trying to use the new Gmail API with the Google API Node client. I created a new project from the developer console, set up a new "Service Account" Client ID, and enabled access to the API. As a proof of concept, I am simply trying to list the threads in my inbox. When I enable the OAuth 2.0 toggle for the API explorer and enter my email address, the request succeeds and I see a JSON response with data. Now I try to do the same in Node: var googleapis = require('googleapis'); var SERVICE

Get access token on server side javascript (nodejs) using google authorization code received from client side

二次信任 提交于 2019-12-18 13:27:50
问题 i have gone through this documentation :- https://developers.google.com/identity/sign-in/web/server-side-flow At the last step it receives the authorization code and after that it shows the example of receiving access token and refresh token using java or python libraries, but i cant find any similar example in nodejs. How can i replicate the same example using nodejs? Can't i just send a post or get request to some google oauth api and receive the access token using authorization code?

Inserting an event with the nodejs google calendar API returns 400: “Missing end time”

拥有回忆 提交于 2019-12-14 02:19:48
问题 I am trying to insert events via the Google Calendar API with a service account. The goal is to have one calendar that all users view: a server-to-server setup. As of now, I can properly call the calendar API and list the events on said calendar: var moment = require("moment"), googleapis = require("googleapis"), googleCal = googleapis.calendar("v3"); serviceEmail = "********@developer.gserviceaccount.com", serviceKeyFile = "./key.pem"; var authClient = new googleapis.auth.JWT( serviceEmail,

Google Translate service account 403 dailyLimitExceeded error

空扰寡人 提交于 2019-12-13 07:58:57
问题 I'm configuring a Node.JS server to use the Google Translate API. So far, I've done the following: Set up a Google account Add credit card and enable billing Create a project Enable Google Translate API for project Create two service accounts for project* and save the JSON key files *One service account for local development and one account for deployed application. Sample code (Typescript): import * as Translate from '@google-cloud/translate'; export async function translate(text: string, to

Inserting google plus moment using googleapis node.js api (google-api-nodejs-client)

白昼怎懂夜的黑 提交于 2019-12-13 06:05:21
问题 Using the example here: https://developers.google.com/+/api/latest/moments/insert and everyauth to handle the oauth login: (with the .withAuth() added) Or using my own simpler example I'm getting an "Invalid Value" status code: 400 error. {"domain":"global","reason":"invalid","message":"Invalid Value"} Has anyone been able to post a Google + moment using the google-api-nodejs-client library? I use everyauth to handle oauth and login. My initialization code is below: everyauth.google .appId