i am using in this way
url = f"https://api.atlassian.com/ex/jira/{cloud_id}/rest/api/2/agile/1.0/board?projectKeyOrId=BUN"auth1 = HTTPBasicAuth(JIRA_EMAIL, api_token)headers1 = {"Accept": "application/json"}r = requests.get(url, headers=headers1, auth=auth1)print(r.status_code)print("Jira Json Response --->>> ", r.text)
these are the scopes I added
I got this response401Jira Json Response --->>> {"code":401,"message":"Unauthorized; scope does not match"}
Hi @AdnanFakhar Training Material
The Software API has no granular scopes, so you can't use a scoped API token with the software API endpoint.
Firstly, change the URL host and pathUse your Jira site, not the Atlassian gateway, and the Agile API path:https://<your-site>.atlassian.net/rest/agile/1.0/board?projectKeyOrId=BUN.https://developer.atlassian.com/cloud/jira/software/rest/api-group-board/?utm_source=chatgpt.com
https://<your-site>.atlassian.net/rest/agile/1.0/board?projectKeyOrId=BUN
Keep Basic Auth (email + API token)Basic auth is valid for simple scripts against your site domain.
import requestsfrom requests.auth import HTTPBasicAuth
SITE = "your-site.atlassian.net"url = f"https://{SITE}/rest/agile/1.0/board?projectKeyOrId=BUN"
auth = HTTPBasicAuth(JIRA_EMAIL, API_TOKEN) # same token you already haveheaders = {"Accept": "application/json"}
r = requests.get(url, headers=headers, auth=auth, timeout=30)print(r.status_code)print(r.text)
Hello @AdnanFakhar Training Material
First, the documentation for the Get all boards endpoint says that it requires two OAuth 2.0 scopes:
But according to the information you have provided, you didn't add the second scope to your OAuth scoped API token. Is there a reason why you did that??
Second, you said you are using an OAuth scoped token, but the code you've provided shows that you are trying to make a connection using Basic auth and submitting an email address + API token instead of a Bearer token. Is there a reason why you're doing that??
Hi Gor Greyanthe code which you gave me is " without scoped " apiI want to use it with scoped api to get board data.can you code me what steps i need to get it
Hi AndrewI tried it with the scope you asked..but not work says " Jira Json Response --->>> {"code":401,"message":"Unauthorized; scope does not match"} "can you code me , how i achieve it, although I get all user info using scoped by this code
url = f"https://api.atlassian.com/ex/jira/{cloud_id}/rest/api/2/users/search?startAt=0&maxResults=1000"auth = HTTPBasicAuth(JIRA_EMAIL, api_token)headers = {"Accept": "application/json"}# Make the GET requestresponse = requests.get(url, headers=headers, auth=auth)print(response.text)
I have these permissions:
Hi MarcWhat does it mean that Software API has no granular scopes?You mean with Scoped API cannot get board/sprint info via api.
Hi @AdnanFakhar Training MaterialMaybe this will help? I didn't do with scoped api.https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps/
Yes, that's exactly what I mean.
You can also see that at the API endpoints that no Granular options are available.
@Marc -Devoteam- is that still true?
Trying to reconcile what you're saying with this documentation page:
https://developer.atlassian.com/cloud/jira/software/rest/api-group-board/#api-group-board
Which mentions the 2 granular scopes in the context of OAuth2 Apps:
read:board-scope:jira-software
read:project:jira
It looks like you're new here. Sign in or register to get started.