Use a basic HTTP Authentication as the documentation of the API says..
<?php
$curl = curl_init('https://www.bugherd.com/api_v2/projects.json');
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($curl, CURLOPT_USERPWD, 'api key:x');
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$return = curl_exec($curl);
$json= trim($return,'1');
$jsdecarr = json_decode($json,true);
print_r($jsdecarr);
OUTPUT :
Array
(
[projects] => Array
(
[0] => Array
(
[id] => 39921
[name] => bugherd addon
)
[1] => Array
(
[id] => 40083
[name] => abcd
)
[2] => Array
(
[id] => 40250
[name] => fsdfgdg
)
)
[meta] => Array
(
[count] => 3
)
)