Hi, 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.
appreciate any help here.
$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));
@Joseph Ranjan
were you able to find solution?
I too facing same issues to access apis for jira software , i have provided granular scopes as well but for me listing boards not working , but plaform apis are working
my scopes are
"read:jira-user", "read:jira-work", "write:jira-work", "manage:jira-webhook", "read:board-scope:jira-software", "read:sprint:jira-software", "offline_access"
@Hemadri for me the issue was i was using api URL like this...
$allboards = $site_url.'/rest/agile/1.0/board'
but i was supposed to use another way of URL forming for api v3. when i changed it was working.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is a little bit out of my league -- but here are some observations.
Authorization=Basic Base_64_Encoded_API_Key
Authorization=Bearer API_Token
I noticed your CURL code has a result_decode statement not found in the documentation example. you also have to be very precise in the number of spaces (.e.g. 1) between the word Bearer and the actual token.
I hope that helps pinpoint the issue.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@David Nickell Thank you for your help. For me also the API is working with Jira Tokens. But not with Oauth Authorisation token (access_token).
My question is why it is not working with oauth2.0 generated access token ? Their documentation says the oauth2.0 is a valid authentication method... https://developer.atlassian.com/cloud/jira/software/rest/intro/#authentication-for-rest-api-requests
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.