HI,
iam using rest api to get spaces list from confluence using php curl . But iam getting the error .please check my code
$url = "https://xxxxxxx.atlassian.net/rest/api/space?spaceKey=xxx";
$ch = curl_init();
$headers = array(
'Accept: application/json',
'Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxx' // this is the oauth token
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_URL, $url);
$result = curl_exec($ch);
$ch_error = curl_error($ch);
if ($ch_error) {
echo "cURL Error: $ch_error";
} else {
echo $result;
}
curl_close($ch);
Response is {"error": "Failed to parse Connect Session Auth Token"}