I was trying to load confluence data using llama_index library.
Here's the code snippet :
from llama_index import download_loader
token = {
"access_token": "<access_token>", #created it in https://developer.atlassian.com/console
"token_type": "Bearer"
}
oauth2_dict = {
"client_id": "<client_id>", #created it in https://developer.atlassian.com/console
"token": token
}
base_url='https://<domain>.atlassian.net/wiki'
space_key='<space_key>'
confluence_reader = download_loader('ConfluenceReader')
reader = confluence_reader(base_url=base_url, oauth2=oauth2_dict)
print(reader)
# Attempt to load data
try:
documents = reader.load_data(space_key=space_key, include_attachments=True)
print("Data loaded successfully.")
except Exception as e:
print(f"Error loading data: {e}")
Facing below error :
Error loading data: 403 Client Error: Forbidden for url: https://<domain>.atlassian.net/wiki/rest/api/content?spaceKey=<space_key>&expand=body.storage.value&type=page
Hey there,
If you have created an OAuth 2.0 App, make sure you have selected the right scope for API calls to work. It is under permissions
If it's different than the one explained, please let me know.
Thanks,
Pramodh
Hi Pramodh,
Thanks for the response.
Yes, I have added all the permissions.
Attaching the screenshot for your ref.
still facing same error.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.