I am on a 14-day trial to decide whether to propose a Confluence solution to clients.
I am trying to determine the viability of accessing Confluence with Python.
I am the admin of the site and I am the only user.
I have created a API token, not yet expired.
My code:
# pip install atlassian-python-api
# Python 3.11
from atlassian.confluence import Confluence
url = 'https://xxx.atlassian.net'
token = 'ATATT3x...wI7c34=4EA6D8ED'
confluence = Confluence(url=url, token=token)
user = confluence.get_user_details_by_accountid('712020:c9586404-a094-4c1f-8c28-bd78a644b3a8')
RETURNS: The calling user does not have permission to view users
WHEN I log into my browser and replace the URL with
https://xxx.atlassian.net/wiki/rest/api/user?accountId=712020:c9586404-a094-4c1f-8c28-bd78a644b3a8
IT WORKS, and returns expected user data.
I have also tried these patterns:
confluence = Confluence(url=url, username='MY EMAIL ADDRESS', password='****')
confluence = Confluence(url=url, username='MY USER NAME', password='****')
confluence = Confluence(url=url, username='MY USER NAME', password='****')
confluence = Confluence(url=url, username='MY USER NAME', password='****', token=token)
and every type of combination I could think of.
I have tried other various APIs, like reading all documents, only to get a similar 401 error.
Is this an issue with the 14-day trial?
Or something I'm just doing wrong?