I am following this API documentation using Python to send a simple request for content from my locally hosted confluence server.
I am getting the following error:
[HTTP Status: 500 >> ERROR {'X-ASEN': 'SEN-L14880621', 'Content-Type': 'text/html;charset=utf-8', 'Content-Language': 'en', 'Transfer-Encoding': 'chunked', 'Date': 'Thu, 23 Jan 2020 13:49:57 GMT', 'Connection': 'close'}]
I have generated an API token from the id.atlassian.com site and have built a string as follows
ACCESS_HEADER = base64.b64encode('<username>@localhost:8090:<password>'.encode('utf-8'))as described in the confluence API documentation.
I haven't been able to authenticate in any way so far. If anyone knows what I'm doing wrong, please help!
ALSO the following is my request:
url = 'http://localhost:8090/rest/api/content'
response = requests.get(url,
headers={
'Authorization': 'Basic {}'.format(ACCESS_HEADER),
'Content-Type': 'application/json',
"Origin": "http://localhost:8090"
}
)
if response.status_code == 200:
respJSON = response.json()
else:
respJSON = '[{0} >> ERROR {1}]'.format(response.status_code, response.headers)
print(respJSON)
Thanks in advance!! and please let me know if you require more details