Наконец-то нашли решение:
curl -D- -u user:password -X GET -H "Content-Type: application/json" "<confluence_ url>/spaces/flyingpdf/pdfpageexport.action?pageId=123456789" > curl_ouput.txt
## Read response and extract URL for downloading file
FILE_LOCATION=$(grep "Location: " curl_ouput.txt | sed 's/Location: //g')
## Remove newline character at the end of the url
FILE_LOCATION=${FILE_LOCATION%?}
## Download PDF file
curl -D- -u user:password -X GET -H "Content-Type: text/html;charset=UTF-8" <confluence_url>${FILE_LOCATION} --output fileName.pdf
rm -f curl_ouput.txt