atlassian-python-api icon indicating copy to clipboard operation
atlassian-python-api copied to clipboard

There is no content with the given id, or the calling user does not have permission to view the content

Open sherry-kaikai opened this issue 9 months ago • 1 comments

    # 读取wiki_key.txt
    with open('data/WIKI_key.txt', 'r', encoding='utf-8') as f:
        wiki_key = f.read()
        print(wiki_key) 
    confluence = Confluence(
        url='https://wiki.xxx.com',
        token = 'xxxxxxxxxxxxxxxxxx')
        # username='xxxxxxxxxxx',
        # password='xxxxxxxxxxxxx')
    

when use with open('data/WIKI_key.txt', 'r', encoding='utf-8') as f:

there is something wrong ,may read the '/n',but we cannot see ...

so its Error log: "There is no content with the given id, or the calling user does not have permission to view the content"

it is just a read error ! not api error...

sherry-kaikai avatar Apr 08 '25 07:04 sherry-kaikai

Hi! @sherry-kaikai I was browsing the issues backlog and noticed this one. So, If I got this right from example you provided, you are trying to read the content of file data/WIKI_key.txt but it's not clear how you are using the resulting wiki_key? Please try to do something like this:

with open('data/WIKI_key.txt', 'r', encoding='utf-8') as f:
    wiki_key = f.read().strip()

confluence = Confluence(
        url='https://wiki.xxx.com',
        token = wiki_key)

The mentioned error message is the one a number of methods (11 methods) will print out in case of Confluence API response status code is 403/404.

dunterov avatar May 11 '25 15:05 dunterov