Coder Social home page Coder Social logo

node-odesk's Introduction

Node-oDesk

Node.JS bindings for oDesk API

Installation

To install node-odesk please run the following command:

$ npm install node-odesk

Usage

Quick start

Before you may use oDesk APIs, you will need to obtain your pair of API keys. Visit the oDesk API Center documentation for full details. Please note, that Node-oDesk uses authorization via OAuth and it needs keys with auth type "OAuth".

Initializing the client:

var odesk = require('node-odesk');
var o = new odesk(key, secret);

Shows the authorization url:

o.OAuth.getAuthorizeUrl(function(error, url, requestToken, requestTokenSecret) {
    console.log(url, requestToken, requestTokenSecret);
});

Also you may specify your custom callback url for authorize url:

o.OAuth.getAuthorizeUrl('http://example.com/complete', function(error, url, requestToken, requestTokenSecret) {
    console.log(url, requestToken, requestTokenSecret);
});

Getting accessToken:

o.OAuth.getAccessToken(requestToken, requestTokenSecret, verifier, function(error, accessToken, accessTokenSecret) {
    console.log(accessToken, accessTokenSecret);
});

Set accessToken:

o.OAuth.accessToken = accessToken;
o.OAuth.accessTokenSecret = accessTokenSecret;

Get user info from oDesk API:

o.get('auth/v1/info', function(error, data) {
    console.log(error || data);
});

Also you can use POST, PUT or DELETE methods:

o.put('team/v1/snapshots/<company>/<username>/<timestamp>', {memo: "Testing..."}, function(error, data) {
    console.log(error || data);
});

node-odesk's People

Contributors

boobsd avatar dglittle avatar xjamundx avatar

Watchers

 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.