Hi Sir
I want to use python get my page by API ,but i have met an error:
https://github.com/atlassian-api/atlassian-python-api/tree/master/examples/confluence
my page addr:
https://nannan666.atlassian.net/wiki/spaces/CHARTGPT/pages/98517/Oscillation+Detection+Spec
Code:
# coding=utf-8
from atlassian import Confluence
confluence = Confluence(url="https://nannan666.atlassian.net/wiki", username="nannan666", password="xxxx")
# If you know Space and Title
content1 = confluence.get_page_by_title(space="CHARTGPT", title="page title")
print(content1)
# If you know page_id of the page
content2 = confluence.get_page_by_id(page_id=98517)
print(content2)
log:
urn complexjson.loads(self.text, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://nannan666.atlassian.net/wiki/rest/api/content?type=page&start=0&limit=1&spaceKey=CHARTGPT&title=page+title
Hello @nannan666 ,
Have you tried to access the URL from a third party application like Postman or Insomnia first?
This is a good place to start so you can confirm you are setting up the call correctly.
Consider request headers as well.
I am not familiar with the library you are using but try and get this working with the Python requests library or the http.client libraries first.
Also try and call yourself in the first instance.
/confluence/rest/api/user/current
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.