How to export pdf via REST API?

ABoerio November 5, 2020

Hi, 

I'm trying to write a simple Groovy script to communicate with our Confluence server instance and get done automatically the export to pdf o a page whose ID number is known.

I already communicate with Confluence this way to get information about pages, etc... but for this particular task I'm not getting to a solution.

How to get the pdf exported and downloaded to my local download folder, which is what normally happens when I click on the pdf export button?

In the picture the code I'm trying to use and the response I get from the call.

Immagine 2020-11-05 175815.jpg

 

Thanks, ciao, Andrea

2 answers

1 vote
Urban_Pettersson
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!
April 11, 2024

Having struggled with this for a bit I took the liberty of creating a GitHub gist detailing the necessary steps. The gist is using NodeJs, but should hopefully be easy to translate to any language.

Iker Gómez Eiras May 31, 2024

I was trying to figure out how to do exports through powershell, and your code has been a god damned light in the darkness! Sure, I can't use it in powershell, but it helped me understand how the process works and manage to more-or-less reproduce the same steps.

Thank you!

0 votes
Brant Schroeder
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 31, 2020

@ABoerio here is a previous community post on this using other languages but the web service call will be the same.  https://community.atlassian.com/t5/Confluence-questions/Export-page-to-pdf-using-rest-call/qaq-p/1085529

ABoerio February 24, 2021

Hi @Brant Schroeder sorry for very late feedback. Thanks for your hint. I'll give it a try for sure.

Like Brant Schroeder likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
7.4.1
TAGS
AUG Leaders

Atlassian Community Events