Basecamp API Query
Query the Basecamp API and return the result as an array
More information about the Basecamp API can be found at https://github.com/37signals/bcx-api/
Example: <? printr(bcresults('/people/me.json','99999999','dhjfksdhfjksdhfij32')); ?>
<?
function bc_results($api_url,$bc_account_id,$bc_user_token){
if($api_url){
$api_url='https://basecamp.com/'.$bc_account_id.'/api/v1'.$api_url;
$ch=curl_init();
$options=array(
CURLOPT_URL => $api_url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => array('Content-type: application/json','Authorization: Bearer '.$bc_user_token),
CURLOPT_USERAGENT => 'SampleAppName (test@testington.com)'
);
curl_setopt_array($ch,$options);
return json_decode(curl_exec($ch),'true');
}
}
?>
Written by Brendan Murty
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Php
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#