Code Monkey home page Code Monkey logo

google-batch's People

Contributors

amoki avatar ionicabizau avatar pradeep-mishra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

google-batch's Issues

no such file or directory: transporters.js

batch_idea.js:

var googleBatch = require('google-batch');
var batch = new googleBatch();
 
// important, always require googleapis using google-batch require() method.
var google = googleBatch.require('googleapis'); 
node batch_idea.js

returns:

$ node batch_idea.js
C:\Users\travi\dev\Fullerton\node_modules\google-batch\index.js:164
                        throw error;
                        ^

Error: ENOENT: no such file or directory, open 'C:\Users\travi\dev\Fullerton\node_modules\googleapis\lib\transporters.js'
    at Error (native)
    at Object.fs.openSync (fs.js:642:18)
    at Object.fs.writeFileSync (fs.js:1348:33)
    at Function.GoogleBatch.require (C:\Users\travi\dev\Fullerton\node_modules\google-batch\index.js:156:14)
    at Object.<anonymous> (C:\Users\travi\dev\Fullerton\batch_idea.js:5:26)

cannot read property qs of null

Trying to do a gmail request, and following along with the doc. unfortunately I get a the following error:

/node_modules/google-batch/index.js:19
        opts.qs = opts.qs || { };
                      ^

TypeError: Cannot read property 'qs' of null

refresh_token not supported

Google-batch does not support refresh_tokens. You must provide a valid access-token.

I'm not sure what the protocol is for exchanging a refresh token for a new access token, but the standard gmail api client seems to do this automagically for all of the api calls I have used, so it was surprising when google batch was failing using the same auth input.

Here's my current work around. Perhaps there is a better one.

  1. Create an OAuth2 object with the refresh_token
  2. Pass this to a standard gmail api call
    (side effect of that call: update the OAuth2 object with a new access_token)
    3: Now use google-batch (batch.setAuth(...)) with the the updated OAuth2 object.

Gmail list/get threads and drafts

Does this API give us the option of making batch request for gmail.user.drafts or gmail.users.threads methods of the google Gmail API? Or is it just for batch requests on the gmail.users.messages object? And can I both list and get messages with this API?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.