Hi! Is it possible to make calls to the Jira API using Basic Auth and a Service Account? I've tried the Get all projects endpoint, but I can't get it to work no matter which scopes I set on my generated API token (even if enabling all the scopes under Classic).
Is it just not possible to use the Jira API with Service Accounts and Basic Auth? Or am I doing something wrong? This is the Python script I'm using to test:
import requests
from requests.auth import HTTPBasicAuth
import json
mail = <service account mail>
token = <service account token>
auth = HTTPBasicAuth(mail, token)
headers = {
'Accept': 'application/json'
}
api_url = "https://<company name>.atlassian.net/rest/api/latest/project"
response = requests.request("GET", api_url, headers=headers, auth=auth)
print("Status Code:", response.status_code)
projects = json.loads(response.text)
print("Number of projects:", len(projects))
This script always returns a status code of 200, and 0 projects (which is what I've understood will happen if the token does not have the correct access).
NOTE: I can get the script working if I use my own e-mail and create a non-scoped token using that, but it would be much better if we could use a service account for this.