Retrieving the content of a page you created through the Confluence REST API

Phillip Dudley
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!
February 7, 2025

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?

1 answer

1 accepted

2 votes
Answer accepted
marc -Collabello--Phase Locked-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 7, 2025

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

 

Phillip Dudley
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!
February 10, 2025

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.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events