Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

unable to attach pdf attachment to confluence page by rest API

azizuddin K
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!
September 12, 2017

curl -v -S -u username:passwd -X POST -H "X-Atlassian-Token: no-check" -F "file=@/home/test1234.pdf" -F "comment=this is my file1" "https://xxx.atlassian.net/wiki/rest/api/content/pageid/child/attachment" | python -mjson.tool

 

From Above Rest API i able to attach pdf but unable to publish on confluence page. please do the needful

1 answer

0 votes
Stephen Deutsch
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 14, 2017

If you want to publish on the Confluence page, then you'll have to download the page content, choose where on the page you want to insert it, insert the code for displaying the pdf, and then update the content of the page (don't forget to increment the version number).

In order to find the code you need for inserting the PDF, find a page that has an embedded PDF (or make one) and look at the storage format (under the ••• menu is "View Storage Format") and find the code that contains the name of the PDF. You can use this as a template for the code you need to insert.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events