google-api-nodejs-client

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

吃可爱长大的小学妹 提交于 2019-12-05 15:23:56
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? https://developers.google.com/analytics/devguides/config/mgmt/v3/mgmtExperimentsGuide#insert This code, for listing existing experiments, works as expected: var listExperiments = function(){ googleapis .discover('analytics', 'v3') .execute(function(err, client) { var request = client .analytics.management.experiments.list({ accountId : accountId, webPropertyId : webPropertyId, profileId : profileId })

Datastore on flex nodejs appengine stopped working - bad gateway 502

假如想象 提交于 2019-12-05 05:42:56
问题 After making some updates to an app I'm working on, I pushed the app up via gcloud app deploy --version dev and everything seemed to push just fine, but upon further inspection, any of my calls (get or post) that use the @google-cloud/datastore package fail with Bad Gateway 502 - nginx error. I've put in console.logs everywhere and they never get past the line before any datastore.whatever() calls. tested with .save, .runQuery, and .update. Weirder still, i can access the datastore just fine

Accessing a public calendar using Google API without requiring a user to log in

雨燕双飞 提交于 2019-12-05 01:10:13
I'd like to access a public calendar using Google's REST API. Google's calendar API suggests I need an OAuth token to get access to calendars: https://developers.google.com/google-apps/calendar/auth However, I'm accessing a public calendar and am doing this from the server so can't/shouldn't have to ask the user to authenticate. I'm using the node.js api: googleapis .discover('calendar', 'v3').execute(function(err, client) { client.calendar.calendars.get({ calendarId: '***@group.calendar.google.com' }) .execute(function (err, response) { console.log('response from google', response); }); });

Google Fitness API returns only {} as result

浪子不回头ぞ 提交于 2019-12-04 20:24:34
Here am not getting any error, but I didnt get any result from the Google fit. Am trying to getting Google Fit values for third user(example1@gmail.com). User(AuthUser@gmail.com) profile are getting properly and access token valid. But while trying to get the third party user (example1@gmail.com) and Auth user (AuthUser@gmail.com) information it show only {} as result. Any one can help me to get the fitness values from Google Fit. //oauth2Client.js getAccessToken(oauth2Client, function() { // retrieve user profile plus.people.get({ userId: 'me', auth: oauth2Client }, function(err, profile) {

Refresh token of google api do not work properly in nodejs

时光毁灭记忆、已成空白 提交于 2019-12-04 10:49:11
I am using google api nodejs , I try to get data from google Anaytics var google = require('googleapis'); var OAuth2Client = google.auth.OAuth2; var CLIENT_ID = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; var CLIENT_SECRET = 'xxxxxxxxxxxxxxxxxxxxxx'; //var REDIRECT_URL = 'http://yieldops.co/oauth2Callback'; var REDIRECT_URL = 'http://localhost:8000/oauth2Callback'; var oauth2Client = new OAuth2Client(CLIENT_ID, CLIENT_SECRET,REDIRECT_URL); var credentials={} credentials.expiry_date= "1463514280558", credentials['refresh_token']="aaaaaaaaa" credentials['access_token']="aaaaaaaaaaaaaaa" oauth2Client

How to send multipart/mixed request for google indexing batch request in NodeJs?

為{幸葍}努か 提交于 2019-12-03 15:47:27
I am using Nodejs to connect with GoogleApis v35.0.0 to tell Google to update or remove pages from the Google index. And I stuck in the multipart/mixed request, the body of multipart when I send the request through Google indexing batch request . I could able to send an individual page update request to Google by following the indexing API documentation . But since Google has the limited quota at maximum of 200 requests per day and I need to update more URL's than that. So, I am trying to use google indexing batch request which can group at maximum of 100 individual requests and it counts as 1

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

天涯浪子 提交于 2019-12-02 07:56:30
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": { "partitionId": { "datasetId": "s~healthier-staging" }, "path": [ { "kind": "Subscriber", "name": "+1215XXXXXXX" }

how to use the refreshAccessToken method to generate a new accesstoken in google-api-nodejs-client

我的梦境 提交于 2019-12-01 22:42:22
I see that this pull request adds a method to refresh the access token using a saved refresh token. It is not clear to me how to use it. I have saved the tokens (including the refresh token) from the original getToken request and am now retrieving the token from the Database in a new session. How do I set the credentials on OAuth2Client so that I can call refreshAccessToken and get a new accesstoken? kpg I had missed the paragraph on setting credentials on the github readme , so here is some sample code in case anybody else needs it. var googleOauth2Client = new OAuth2Client(googleClientId

gmail with table in message body is not getting displayed in mail but table data is displayed

泪湿孤枕 提交于 2019-12-01 14:02:00
This is my actual output This is my expected output when a mail is sent with html table along with file attachment(like image, pdf, etc.), table format is not displayed in mail but content of table is displayed. But when I inspect mail body table is present. Problem is that its not shown in table format. But when mail sent with html table without attachment, table format is getting displayed in mail. How to fix it. let user = await db.model('User').findOne({ _id: userId }); let filepath = fs.readFileSync(req.file.path).toString('base64'); let from = user.crmOptions.email; let raw = [ 'MIME

browserify Error : http.createServer is not a function

Deadly 提交于 2019-12-01 13:25:42
I tried to browserify this node js script : var phantom = require('phantom') phantom.create(function(ph) { ph.createPage(function(page) { page.open("editor.html", function(status) { console.log("opened diagram? ", status); page.evaluate(function() { return document.getElementById("GraphImage").src; }, function(result) { //console.log(result); ph.exit(); }); }); }); }); So I used this command: browserify myscript.js > bundle.js and when I run bundle.js from an html file I get this error: http.createServer is not a function it seems that browserify does not support httpserver. How can I resolve