When I try sample code given here:
from langchain.document_loaders import ConfluenceLoader
loader = ConfluenceLoader(
url="<my confluence link>", username="<my user name>",
api_key="<my token>"
)
documents = loader.load(space_key="<my space>", include_attachments=True, limit=1, max_pages=1)
I get an error:
AttributeError: 'str' object has no attribute 'get'
Here is the last part of the stack:
554 """
555 Get all pages from space
556
(...)
568 :return:
569 """
570 return self.get_all_pages_from_space_raw(
571 space=space, start=start, limit=limit, status=status, expand=expand, content_type=content_type
--> 572 ).get("results")
Any ideas? I see an issue here but it is still open.
I have now also opened bug specifically for this issue.
Here is the summary of the fixes required in the original code:
- Do not suffix the URL with /wiki/home
- suffix the user name with @ your domain name
- use ID of the space as in the URL and not its display name
then it works. The error handling is poor to point to these issues otherwise.
ConfluenceLoaderusesatlassian-python-apigithub source and document reference.confluence.pyexpects a successful response from Confluence. exampleshttps://simpleappdesigner.atlassian.net/wiki/spaces/~61dc5d78e67ea2006b1efbc0/pages/65676/Debug+the+python+issue, thenconfluence_link='https://simpleappdesigner.atlassian.net'andspace_key="~61dc5d78e67ea2006b1efbc0"and documents as:
documents = loader.load(space_key=space_key, include_attachments=True, limit=5, max_pages=5)with the above changes, i was able to run the following code:
One can access through postman, while debugging, following is the way(watch the api url in the below screen snap :) ):
Hope this helps.Will be happy to help further or in case have questions.