Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How can I get actual content of Page, Blogpost and Comments using Confluence Cloud REST API?

To get the actual content I tried using Get Content by Id API : https://{{host}}/wiki/rest/api/content/:id?expand with providing value for expand parameter as body.view, body.storage, body.styled_view, in response it give data as value to body key however it returns data as html form

For attachment using Get Attachments API : https://{{host}}/wiki/rest/api/content/:id/child/attachment? it returns,  _links  object with webui, download key value in response, using which we can get actual content for attachment.

Please help to get actual content of Page, Blogpost and Comments using Confluence Cloud REST API.

Thank you.

1 answer

0 votes
huy Atlassian Team Sep 19, 2018

Are you looking for a plain text representation of the body content?

Yes, I am looking for plain text representation.

huy Atlassian Team Oct 05, 2018

Sorry, but this doesn't exist as content entered into confluence is rich and saved as such. To convert downward would be a loss of information and we'd have to make make opinionated choices as to how elements would be converted. For example maybe we could convert to markdown, but what if there is a table? Markdown doesn't natively support tables and as such we'd have to use an esoteric variant. Probably not what you wanted to hear, but I hope this gives you some insight into why we wouldn't want to support this.

Save the output of body.view to an output.html file, then use w3m -dump output.html to get a plaintext representation

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence Cloud

🏠 Say hello to the new Confluence Home!

Hi Atlassian Community, My name is DJ Chung, and I’m a Product Manager on the Confluence Cloud team. Today, I’m excited to share a new and improved version of Home. The new Home helps you ...

4,777 views 10 52
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you