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v0pIV2UzgFww6sY8igQjNuA3gtieMyFDM8CVOTVAO1tlKhVmlbDP8N-RyNSP_Dmex1TB6mMVnEsKDNiM5SRjf93Ivdt15ma8runRe1Tlda4yM9LZ6nxcml7XJo1m3YEldxWX628999cy0MBnjD6JBIAK4vD_irrqky5OAQetVqIrxg-CdvTFsJQelWFjdiyYAYeMnssKx9ofDKlOAqhLuxwj90iYVi4s0nTJHq3mehH1_N042U5ElXEBH4Vg21iIMVrJKasd9IO1vksOzzWGQyCM0FEwZg"
token = {
"access_token":access_token,
"token_type": "Bearer"
}
oauth2_dict = {
"client_id": "kMnhO5DCamDeoMH9EeHIX6UN0i9yvs9q",
"token": token
}
page_ids = ["1081345"]
space_key = "712020cf3666c4544f429497d5354cae6253b5"
reader = ConfluenceReader(base_url=base_url, oauth2=oauth2_dict)
print(reader)
documents = reader.load_data(space_key=space_key, include_attachments=True, page_status="current")
documents.extend(reader.load_data(page_ids=page_ids, include_children=True, include_attachments=True))
print(documents)
When i run this test function i get the error :-
requests.exceptions.HTTPError: Current user not permitted to use Confluence
The trace being :-
documents = reader.load_data(space_key=space_key, include_attachments=True, page_status="current")
File "C:\Users\LENOVO\miniconda3\envs\myenv\lib\site-packages\llama_hub\confluence\base.py", line 148, in load_data
self._get_data_with_paging(
File "C:\Users\LENOVO\miniconda3\envs\myenv\lib\site-packages\llama_hub\confluence\base.py", line 233, in _get_data_with_paging
results = self._get_data_with_retry(
File "C:\Users\LENOVO\miniconda3\envs\myenv\lib\site-packages\retrying.py", line 56, in wrapped_f
return Retrying(*dargs, **dkw).call(f, *args, **kw)
File "C:\Users\LENOVO\miniconda3\envs\myenv\lib\site-packages\retrying.py", line 266, in call
raise attempt.get()
File "C:\Users\LENOVO\miniconda3\envs\myenv\lib\site-packages\retrying.py", line 301, in get
six.reraise(self.value[0], self.value[1], self.value[2])
File "C:\Users\LENOVO\miniconda3\envs\myenv\lib\site-packages\six.py", line 719, in reraise
raise value
File "C:\Users\LENOVO\miniconda3\envs\myenv\lib\site-packages\retrying.py", line 251, in call
attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
File "C:\Users\LENOVO\miniconda3\envs\myenv\lib\site-packages\llama_hub\confluence\base.py", line 281, in _get_data_with_retry
return function(**kwargs)
File "C:\Users\LENOVO\miniconda3\envs\myenv\lib\site-packages\atlassian\confluence.py", line 567, in get_all_pages_from_space
return self.get_all_pages_from_space_raw(
File "C:\Users\LENOVO\miniconda3\envs\myenv\lib\site-packages\atlassian\confluence.py", line 530, in get_all_pages_from_space_raw
response = self.get(url, params=params)
File "C:\Users\LENOVO\miniconda3\envs\myenv\lib\site-packages\atlassian\rest_client.py", line 285, in get
response = self.request(
File "C:\Users\LENOVO\miniconda3\envs\myenv\lib\site-packages\atlassian\rest_client.py", line 257, in request
self.raise_for_status(response)
File "C:\Users\LENOVO\miniconda3\envs\myenv\lib\site-packages\atlassian\confluence.py", line 3078, in raise_for_status
raise HTTPError(error_msg, response=response)
requests.exceptions.HTTPError: Current user not permitted to use Confluence
I kindly ask the community for assistance in comprehending and addressing this issue. Your guidance and support in resolving this matter would be greatly appreciated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.