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 vote
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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

774 views 23 12
Join discussion

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