Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Download certain page via API

krzychus April 26, 2015

Hello,

What I would like to do is create a button which will send to my API some kind of page ID (or whatever) on which the  button was clicked. Next, having this ID, I want to download the content of that page (I assume this will be done by the confluence API). Can you please explain me where can I find the appropriate API functions + the necessary data by which I can download the page?

 

After some investigation I have managed to create valid requests. BUT: I want to download the content of a certain page and generate PDF out of that - how can I do this? According to API specification after getting stuff from confluence there is no data I need sad (no text I wrote, just some info)

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
rrudnicki
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 27, 2015

Hi Szki, 

 

On this link you can find  many examples of REST commands to use with Confluence:

https://developer.atlassian.com/confdev/confluence-rest-api/confluence-rest-api-examples 

Since you already have the ID page, you could try to get the content like this:

curl -u admin:admin http://localhost:8090/confluence/rest/api/content/5210259?expand=body.storage | python -mjson.tool > page.html

However, if you want only the text you might need to work to get the output clean (with no codes together). 

To convert this in .pdf, I believe this will need to be done on your code. I mean, JAVA has your own way to convert text into .pdf, PHP has another way as well. 

 

Hope this helps. 

 

Regards, 

Renato Rudnicki

krzychus April 27, 2015

Thank you for the answer. Currently I'm using C# and I'm downloading the document through code (not curl). And there I need to generate PDF out of that.

Christopher Butler
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!
August 17, 2017

Do you have a code sample of this? did you figure out how to convert to pdf? I am looking to do the same thing. 

Thanks!

TAGS
AUG Leaders

Atlassian Community Events