Hello stackoverflow community. I need to build a PHP app using oDesk API, I know that oDesk has a report section where I can retrieve the Worked hours of all the contractors in all the contracts, these reports gives me a table that I can download in a CSV format, after this I can format it and print it; however I need to do this several times a day, and I really would like to automatize this using oDesk API and PHP, I need to get these reports from several computers, in different places, so for that reason I chose PHP.
Basically, my idea is build the PHP app and upload it to a hosting, so I will access to that app using a web browser and I will be able to print the reports from there. I've already checked the developer documentation in oDesk, it is too old (2010) all the examples are old too, I followed the examples, of course first I've generated the API keys, return url, I downloaded the libs for PHP from oDesk API site but when I try to execute the script it redirects to oDesk Authorization, so I authorize the app and after the site displays an orange page with Error code 1, with some funny message like Holy Guacamole, Nothing to do here Fellas, and others, it never redirects to Return Url that I setup with my API keys.
Can someone help me out with this?
My code is index.php:
<?php
require 'oDeskAPI.lib.php';
$secret = 'my_secrey_key';
$api_key = 'my_api_key';
$company = 'my_company_id';
$url = 'https://www.odesk.com/api/team/v1/teamrooms/'.$company.'.json';
$api = new oDeskAPI($secret, $api_key);
$api->auth();
$params = array('online' => 'all');
$response = $api->get_request($url, $params);
$data = json_decode($response);
var_dump($data->teamroom->snapshot[0]->report_url);
My secret key, api key, and company id are correct. I setup a host virtual in my local computer, something like this http://odeskapp.webfererwork.com and I setup as the return url in oDesk API keys.
Thank you very much for your time.