i have a oauth2.0 access token obtained via authentication flow and by using it am trying to access this 'get all boards' api.
i also noticed only 'platform' apis are working with this access token and all these 'software' type api's are not working.
On a logged in browser when i access this on browser... i was able to get the response on browser screen.
https://myaccount.atlassian.net/rest/agile/1.0/board
But via php curl call am unable to. Here is my code. the $result_decode['access_token'] is carrying valid access token.
$ch = curl_init();
$allboards = $site_url.'/rest/agile/1.0/board';
echo '<br /><b>Calling all boards link:</b>'.$allboards.'<br />';
curl_setopt($ch, CURLOPT_URL, $allboards);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Accept: application/json',
'Authorization: Bearer ' . $result_decode['access_token']
]);
$allboardsdata = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo 'code:'.$httpcode.'-----<br />';
var_dump(json_decode($allboardsdata));
The result am getting is response code 401 and 'Client must be authenticated to access this resource.' value is null.
The required access scope (mentioned in api doc) :
read:board-scope:jira-software , read:project:jira
also set for oauth flow and i double check with this endpoint 'https://api.atlassian.com/oauth/token/accessible-resources' to confirm the same. still same 401.
appreciate any help here.