Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

haugstrup/podiojs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Thin nodejs wrapper around the Podio API

Resources

License

Stars

Watchers

Forks

Packages

No packages published