unable to attach pdf attachment to confluence page by rest API

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 Community Champion Sep 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
Community showcase
Published yesterday in Confluence Cloud

Happy holidays from our team to yours!

Hi Community!  2018 was filled with changes for our team, both big and small, and we've taken a lot of time to both celebrate our wins and recognize areas of improvement. One thing that we're a...

104 views 1 14
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you