oDesk API wrapper

npm install odesk
1 downloads in the last week
23 downloads in the last month


Javascript wrapper for oDesk API


npm install odesk

Using OAuth

Init module

odesk.OAuth.init(key, secret);

Get request token

odesk.OAuth.getRequestToken(function (error, requestToken, requestTokenSecret, results) {
    console.log('error:', error);
    console.log('requestToken:', requestToken);
    console.log('requestTokenSecret:', requestTokenSecret);
    console.log('results:', results);

Get authenticate url

    var url = odesk.OAuth.getAuthenticateUrl(requestToken));

Get access token

odesk.OAuth.getAccessToken(requestToken, requestTokenSecret, verifier, function (error, accessToken, accessTokenSecret, results) {
    console.log('error:', error);
    console.log('accessToken:', accessToken);
    console.log('accessTokenSecret:', accessTokenSecret);
    console.log('results:', results);

    odesk.OAuth.accessToken = accessToken;
    odesk.OAuth.accessTokenSecret = accessTokenSecret;

ODesk API call

var params = {
    tq: 'SELECT SUM(hours)',
    tqx: 'out:json'

var userUID = 'my_usr_uid';
odesk.get("https://www.odesk.com/gds/timereports/v1/providers/" + userUID, params, function (error, data) {
    console.log('error:', error);
    console.log('data:', data);

For complete workflow see the example file.

npm loves you