Hello,
I am currently working on a Python script that will connect to the Confluence cloud and create a page in my Confluence space. However, I am having an issue with the authorization process. I did try to authenticate using my email and API Token using both the request library and python-atlassian-api library to connect to the confluence cloud, but I am getting following error:
HTTPSConnectionPool(host='company.atlassian.net', port=443): Max retries exceeded with url: /wiki/rest/api/space?limit=500 (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x0000029414B3A710>, 'Connection to one-atlas-umzg.atlassian.net timed out. (connect timeout=75)'))
Python code using Request Library:
from requests.auth import HTTPBasicAuth
import requests
def authenticate(username, password, url):
auth = HTTPBasicAuth(username, password)
headers = {"Accept": "application/json",'Content-Type': 'application/json', 'X-Atlassian-Token': 'no-check'}
res = requests.get("https://one-atlas-umzg.atlassian.net/wiki", auth=auth, headers=headers)
print(res.status_code)
Python code using Request Library:
from atlassian import Confluence
def authenticate(username, password, url):
confluence = Confluence("https://one-atlas-umzg.atlassian.net/wiki", username=username, password=password, cloud=True)
confluence.get_all_spaces()