Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to authenticate with confluence : 403 Client Error: Forbidden for url

vaibhav patil
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 14, 2023

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

 

 

 

1 answer

0 votes
Pramodh M
Community Champion
December 15, 2023

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

6.png

If it's different than the one explained, please let me know.

Thanks,
Pramodh

vaibhav patil
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 18, 2023

Hi Pramodh,

Thanks for the response.

Yes, I have added all the permissions.
Attaching the screenshot for your ref.

Screenshot (342).PNG

 

still facing same error.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events