google-api-nodejs-client

Error: invalid_request getToken

久未见 提交于 2019-12-13 05:22:05
问题 Steps I have taken Using Google's developper console: I have created a project and created a client for that project. I have activated Youtube API Data I set a the callback to http://localhost:3000/callback I have downloaded the "client_secrets". Node server initial steps: Using "client_secrets" I have created a new OAuth2Client instance that I named oauth2Client I generated the URL with oauth2Client variable specifying the following: var url = oauth2Client.generateAuthUrl({ access_type:

Google+ insert moment with nodejs client

久未见 提交于 2019-12-12 04:06:43
问题 Has anyone been able to get the google-api-nodejs-client to successfully insert a moment? Whatever I try, I get a generic 400 "Invalid value" error but am unable to narrow down the invalid value because the API Explorer doesn't work either. Would it be because of the missing data-requestvisibleactions parameter? I'm using passport.js's require('passport-google-oauth').OAuth2Strategy for handling oauth access, and that part is working fine, but I have no idea how to incorporate

gmail API for sending users messages in nodejs javascript failes

我是研究僧i 提交于 2019-12-11 14:14:57
问题 My nodejs program fails to send messages using the Gmail api. The solution from Gmail API for sending mails in Node.js does not work for me. I encode an email with var {google} = require('googleapis'); // to and from = "some name <blaw.blaw.com" function makeBody(to, from, subject, message) { var str = ["Content-Type: text/plain; charset=\"UTF-8\"\r\n", "MIME-Version: 1.0\r\n", "Content-Transfer-Encoding: 7bit\r\n", "to: ", to, "\r\n", "from: ", from, "\r\n", "subject: ", subject, "\r\n\r\n",

Google Analytics - invalid_grant: Invalid JWT Signature

邮差的信 提交于 2019-12-11 09:09:34
问题 I need to authorize from Google analytics to get the response data. var google = require('googleapis'), q = require('q'), SERVICE_ACCOUNT_EMAIL = '838823084353-cjjoiv9di67fuh7geqgggociibataf9v@developer.gserviceaccount.com', SERVICE_ACCOUNT_KEY_FILE = __dirname + '/google-services-private-key.pem'; var def = q.defer(); var gAnalytics = google.analytics('v3'); var authClient = new google.auth.JWT( SERVICE_ACCOUNT_EMAIL, SERVICE_ACCOUNT_KEY_FILE, null, ['https://www.googleapis.com/auth

@google-cloud/bigquery Query API returning empty Promise when used in Cloud Function

末鹿安然 提交于 2019-12-11 08:19:34
问题 I'm trying to use the '@google-cloud/bigquery' library to query BigQuery from a Google Cloud function. When the Promise returns, all I get back is an Array with another empty Array inside it, even though when I run the same query from the Big Query console I get a non-empty response back. I've tried using an async function instead of a promise, but that was not successful. I also gave my Service Account "BigQuery Admin" and "Editor" privileges but that has not worked out either. I do know the

Tagging proper GCE Instance name in Stackdriver logging

非 Y 不嫁゛ 提交于 2019-12-11 05:49:00
问题 I am using Google Compute Engine Instance running on Debian for running a service written in Node.js. For logging purpose, I am using Stackdriver logging. The logs are getting generated, however, The log entries are not getting filtered under proper GCE Instance name. Here's how the resource flags are in a log entry resource: { labels: { instance_id: "6000000000000000000" //A numeric id project_id: "my-project" zone: "" } type: "gce_instance" } The instance id is getting generated as a

How to send a mail with an attachment in gmail api using google-api-nodejs-client for nodejs

时间秒杀一切 提交于 2019-12-11 02:59:45
问题 I wish to send an email with an attachment through gmail. I'm using google-api-nodejs-client for node.js. My current message sending code is: var gmailClass = google.gmail('v1'); gmailClass.users.messages.send({ auth: OAuth2Client, userId: 'me', resource: { raw: base64EncodedEmail }, } ,function(err, results) { if (!err) { //do something } else { //do something } }); Is there a way to add an attachment to the send function? 回答1: Your attachment should be in the "raw" base64EncodedEmail you're

Function not found: group_concat

本小妞迷上赌 提交于 2019-12-11 02:27:08
问题 I'm interesting in execute a query using the "group_concat" BigQuery function. When I execute the query directly in the BigQuery interface, the query ends successfully, but when I try to execute that query via Node js, the bellow error appeared: errors: [ { domain: 'global', reason: 'invalidQuery', message: 'Function not found: group_concat at [4:3]', locationType: 'other', location: 'query' } ] The code is not the problem since it executes a simple query without any problem. My query: SELECT

Use of node.js with Google Drive API insert / upload

…衆ロ難τιáo~ 提交于 2019-12-11 01:59:52
问题 The documentation at https://developers.google.com/drive/v2/reference/files/insert for JavaScript is intended for use of the client-side JS library. Trying to use the corresponding node.js library, I'm running into problems calling request(), since there doesn't appear to be one. Short of making the network call directly without use of the library, is there an equivalent for the gapi.client.request() function? 回答1: I was also looking for similar alternative when using nodejs and calling

google API calendar watch doesn't work but channel is created

 ̄綄美尐妖づ 提交于 2019-12-11 01:46:38
问题 I try to listen on my calendar change events (google-apps/calendar/v3/reference/events/watch). I did everything from Google console side, domains - OK, everything is verified and I succeeded to create channel. Also i succeeded to get sync message with right headers (see below). From docs: Sync message After creating a new notification channel to watch a resource, the Google Calendar API sends a sync message to indicate that notifications are starting. The X-Goog-Resource-State HTTP header