Elance API on WordPress Without WP Plugin

Elance has gone now and merged with Odesk to establish a new company Upwork. Once I successfully used Elance API on my wordpress website without using wordpress plugin. I know it’s a bad practice but it’s work anyway. Here is how to do it:

  1. Make sure you already registered on elance (https://elance.com) and have any elance key. If not go to https://developers.elance.com and get the keys (API Key, API secret, redirect URL, etc). Here is the keys:
    SORRY, ONLY ADMIN CAN SHOW THIS!
  2. I created a new wordpress template page with name ‘My Elance Jobs’ in a new file ‘my_elance_page.php’ in the active wordpress theme (currently the active theme is Sorbet). Based on some PHP example to use Elance API, Here is the complete content:

    Just read the code. Try to comprehend it by yourself :). I also need to add a new file ‘elance-auth-lib.php’ for the elance API PHP wrapper in the same directory. The class ‘ElanceAuthentication’ in the file would authenticate the access to the API.

     
  3. On the wordpress admin, create a new page (not post) with title ‘Elance’ then use template ‘My Elance Jobs’ then Save! It would create a new url: http://www.advchaweb.com/elance/. The url is must be same with our redirect url above!elance-api
  4. OK. Now we can use the API from our wordpress page.wp-elanceJust click the link ‘Elance’ or http://www.advchaweb.com/elance
  5. First, It’d redirect us to elance page and please log in!elance-loginSORRY, ONLY ADMIN CAN SHOW THIS!
  6. After successful login, I supposed to get the authorization page but because it is already closed, I got this page instead 🙁elance-closedSOMEHOW when I click the ‘Continue to Elance’ button, I still get the authorization page!!!
    SORRY, ONLY ADMIN CAN SHOW THIS!elance-authOK. Click ‘Allow’ button
  7. It would be redirected back to my wordpress page. Because there is no job anymore on elance, I got no data!elance-redirectSORRY, ONLY ADMIN CAN SHOW THIS!

     

Leave a Reply

Your email address will not be published. Required fields are marked *