# This code sample uses the 'requests' library:
# http://docs.python-requests.org
import requests
from requests.auth import HTTPBasicAuth
import json
print("url")
url = "https://domain-name.atlassian.net/rest/api/2/project/search"
print(" url is done")
auth = HTTPBasicAuth("gmail_id@gmail.com", "API-TOKEN")
print("authenticated")
headers = {
"Accept": "application/json"
}
print("headers ")
response = requests.request(
"GET",
url,
headers=headers,
auth=auth
)
print(json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": ")))