Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export page not working #1409

Open
aguckenber-chwy opened this issue Jun 5, 2024 · 3 comments
Open

Export page not working #1409

aguckenber-chwy opened this issue Jun 5, 2024 · 3 comments

Comments

@aguckenber-chwy
Copy link

Has anyone tested this recently?

https://github.com/atlassian-api/atlassian-python-api/blob/master/examples/confluence/confluence_export_page.py

    confluence = Confluence(
        url='https://chewyinc.atlassian.net/',
        username='<<user>>',
        password='<<password>>',
        api_version='cloud',
    )
    # ...
    content = confluence.export_page(page_id)

When I run the code, it errors out with an invalid path.

image

If I remove api_version='cloud' then the call works but the PDF returned is invalid/corrupt and can't be opened.

@aguckenber-chwy
Copy link
Author

Update:

Not specifying the api_version returns the HTML of the exporter page not the PDF. Setting the cloud completely breaks the flow and errors out.

@Carthae
Copy link

Carthae commented Aug 14, 2024

For me those settings work:

...
    cloud=True,
    api_version='cloud')
...
with open('exported_page.pdf', 'wb') as pdf_file:
    pdf_file.write(content)

@abivolmv
Copy link

It's a bit misleading that if you don't specify cloud arg then it makes it True by default

            if "cloud" not in kwargs:
                kwargs["cloud"] = True

but if you don't specify api_version then it makes it latest

api_version="latest",

and then the pdf export returns html.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants