View
 

API Libraries

The following libraries allow for quick development on the oDesk platform. These libraries support authentication and all available API calls.

 

Why use our libraries?

  1. All the heavy lifting with authentication, signing and adding a token to your request is taken care of.
  2. You don't have to worry about the frob or tokens at all.
  3. Work faster!

 

How do our libraries work?

See our detailed explanation here (also good for a better understanding of how the API works).

 

Currently we only offer libraries on PHP, Ruby and Java, but we will be updating this list as we roll out support for other platforms.

 

PHP

 

Users familiar with PHP will find this library and it's examples helpful when developing on other platforms.

The library can be used for web-based applications, it means that type of your key must be "web".

 

Download and view oDeskAPI.lib.php

*library updated to version 0.3.1 on 8.10.2011

  - The library now supports multidimensional parameters

*library updated to version 0.3 on 7.27.2010

  - The library now supports non web-based applications (e.g. running from desktop or console)
  - proxy support is now included (with and w/o authorization) and configurated via proper options
  - The following configurable options are now supported:
    a/ mode: web(default)|nonweb
    b/ verify_ssl: true|false (whether or not to verify an SSL certificate)
    c/ proxy: proxy server in format <server>:<port>
    d/ proxy_pwd: proxy credentials that are in the format <username>:<password>
    e/ cookie_file: required only "mode=nonweb", path to cookie file


View our example using this library in the examples section.

 

Note: This library will only work with PHP 5.3.x and is incompatible with PHP 4.

 

Available library methods:

 

  • auth() - takes care of the authentication process.
  • get_request( string url, [array paramaters] ) - sends a GET request.
    • requires a URL string (request URL) and (optional) an array of additional params for the request.
  • post_request( string url, [array paramaters] ) - sends a POST request
    • requires a URL string (request URL) and (optional) an array of additional params for the request. 
  • put_request( string url, [array paramaters] ) - sends a PUT request
    • requires a URL string (request URL) and (optional) an array of additional params for the request.
  • delete_request( string url, [array paramaters] ) - sends a DELETE request
    • requires a URL string (request URL) and (optional) an array of additional params for the request

 

Ruby on Rails

 

The Ruby on Rails library was developed by Ahmed ElDawy.

 

View a live example of this library here: http://simple-desk.heroku.com/

 

Sample application:
http://github.com/aseldawy/simple-desk

Ruby Desk (gem):
http://github.com/aseldawy/ruby_desk

RoR Desk (plugin)
http://github.com/aseldawy/ror_desk

 

Ruby

 

The library can be used for nonweb-based applications such as desktop apps, it means that type of your key must be "desktop".

 

Ruby library available in zip, tar.gz, tar.bz2 formats.

 

View our example using this library in the examples section.

 

Available library methods:

 

  • auth - takes care of the authentication process.
  • get_request( string url, [hash paramaters] ) - sends a GET request.
    • requires a URL string (request URL) and (optional) a hash of additional params for the request.
  • post_request( string url, [hash paramaters] ) - sends a POST request
    • requires a URL string (request URL) and (optional) a hash of additional params for the request. 
  • put_request( string url, [hash paramaters] ) - sends a PUT request
    • requires a URL string (request URL) and (optional) a hash of additional params for the request.
  • delete_request( string url, [hash paramaters] ) - sends a DELETE request
    • requires a URL string (request URL) and (optional) a hash of additional params for the request

 

Java

 

The library can be used for nonweb-based applications such as mobile/desktop apps, it means that type of your key must be mobile/"desktop".

 

Note: This library tested under Android platform and can be used in your Android's applications.

 

Java library available in ready to use format (download jar and import into your project) or as source files (download sources).

 

View our example using this library in the examples section.

 

Available library methods:

 

  • getAuthUrl() - return authentication url. The URL can be opened in system's browser for authorizing access to application.
  • getApiToken() - takes care of finilizing auth process and return token.
  • getRequest(String url, [HashMap<String, String> parameters]) - sends a GET request.
    • requires a URL string (request URL) and (optional) a HashMap of additional params for the request
  • postRequest(String url, [HashMap<String, String> parameters]) - sends a POST request.
    • requires a URL string (request URL) and (optional) a HashMap of additional params for the request
  • putRequest(String url, [HashMap<String, String> parameters]) - sends a PUT request.
    • requires a URL string (request URL) and (optional) a HashMap of additional params for the request
  • deleteRequest(String url, [HashMap<String, String> parameters]) - sends a DELETE request.
    • requires a URL string (request URL) and (optional) a HashMap of additional params for the request

 

Python

 

The library "python-odesk" can be used for web-based applications, it means that type of your key must be "web".

All the documentation for this library available here

 

Lisp

 

The project exists almost a year and by this time was used to create: 

  • restas-odesk - plugin for RESTAS Web Framework
  • 2 websites that used oDesk API not only for auth

It is available under BSD license at GitHub 

Comments (0)

You don't have permission to comment on this page.