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

This widget could not be displayed.
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
Posted Monday in Confluence

Why start from scratch? Introducing four new templates for Confluence Cloud

Hi my Community friends!  For those who don't know me, I'm a product marketer on the Confluence Cloud team - nice to meet you! For those of you who do, you know that I've been all up in your Co...

532 views 7 6
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