Hello everyone. I am trying to retrieve the contents of a Page I created via the Confluence REST API using the Python library atlassian-pyton-api (or even the REST API), but I don't seem to understand or see how to retrieve the contents of the page you created.
There's a lot of metadata, but I don't see the actual content I POST'd to the API. How does one do that?
Hi @Phillip Dudley ,
To get the page content, use
https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-page/#api-pages-id-get
e.g.
curl --request GET \ --url 'https://{your-domain}/wiki/api/v2/pages/{id}' \ --user 'email@example.com:<api_token>' \ --header 'Accept: application/json'
If you need the actual content, add the parameter "body-format" as a query parameter (e.g. "storage"):
https://<your-domain>.atlassian.net/wiki/api/v2/spaces/{space-id}/pages?body-format=storage
Thank you! This helped inform my usage of the atlassian-python-api client package.
"""Maybe get the page content?
"""
page_content = confluence.get_page_by_id(page_id=page_status['id'],
expand='body.view')
page_content
This will return the page's content as part of the response.
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.