- json_decode: documentation ( source)
- base64_encode: documentation ( source)
<?php
$company = "broadstreet";
$key = "elvis437tide";
$action = "projects.json";
$channel = curl_init();
curl_setopt( $channel, CURLOPT_URL, "https://". $company .".teamwork.com/". $action );
curl_setopt( $channel, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $channel, CURLOPT_HTTPHEADER,
array( "Authorization: BASIC ". base64_encode( $key .":xxx" ))
);
echo curl_exec ( $channel );
curl_close ( $channel );
echo json_decode($channel);