Coder Social home page Coder Social logo

podiojs's Introduction

Podio API Client Library for nodejs

This is a thin wrapper around the Podio API for nodejs. It handles authentication and maintains access/refresh tokens for you. It is also my first nodejs project so comments and pull requests are welcome.

Usage

// Initialize and specify client id and secret
var podio = require('podiojs');
podio.client.client_id = 'CLIENT_ID';
podio.client.client_secret = 'CLIENT_SECRET';

podio.on('error', function(request, response, body) {
  console.log('There was a problem with a request to ' + request.path+'. Error was "'+body.error_description+'" ('+body.error+')');
});

podio.on('rateLimitError', function(request, response, body) {
  console.log('You hit the rate limit');
});

podio.authenticate('password', {'username': 'USERNAME', 'password': 'PASSWORD'}, function(response, body){
  podio.get('/user/status', {}, function(response, body){
    console.log(body);
  });
});

Install

npm install git://github.com/haugstrup/podiojs.git

Methods

podio.authenticate(grant_type, attributes, [callback])
podio.request(method, url, attributes, [options], [callback])
podio.get(url, attributes, [options], [callback])
podio.post(url, attributes, [options], [callback])
podio.put(url, attributes, [options], [callback])

Callback receives two arguments: response (ClientResponse object) and body (JSON object of the HTTP body)

TODO

  • Handle gzip/deflate

podiojs's People

Contributors

haugstrup avatar ehevutov avatar auchenberg avatar

Watchers

James Cloos avatar Shelson Ferrari avatar  avatar

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.