I have added the attachment in the page but they are not being displayed in page body .
Kindly help me in solving this using api.
Hello Nisha,
Happy to help you with this.
When you're adding an attachment to a page via REST API, you are only adding it to the list of attachments. If you want to put the attachment in the body content, then you need to modify the body content.
I was able to find a thread on this that can help you:
For more details, you can refer to our Confluence Cloud REST API Documentation.
Regards,
Shannon
Hi Shannon,
Thanks for the update .I have tried to post the content as specified in the thread you shared.But i couldn't find anything posted in the page .Please find the query i am using,
curl -u username:token -X PUT -H 'Content-Type: application/json' -d'{"id":"contentid","type":"page","title":"Requirement","version":{"number":12}},"body":{"storage":{"value":"<p>Hi</p>","representation":"storage"}}}' "https://domain.atlassian.net/wiki/rest/api/content/{content id}?status=current"
Nisha,
The instructions I provided are for Confluence Server. If you are on Confluence Cloud, you can check the following article for advice on how to do that:
Your example still has the test domain URL in it as well as the contentID placeholder. I am assuming that here you have included your Cloud instance URL and the contentID you obtained from the GET command that you ran prior to the PUT command?
I am able to update the contents of the Page with text now .Thanks for the help.
I am using the following command:
curl -u username:password -X PUT -H 'Content-Type: application/json' -d'{"id":"927662202","type":"page","title":"Requirement","space":{"key":"~621441701"},"body":{"storage":{"value":"<p>This is the updated text for the new page</p>","representation":"storage"}},"version":{"number":17}}' https://domain.atlassian.net/wiki/rest/api/content/927662202 | python -mjson.tool
But my actual aim is to update the csv sheet to th page or embedd the contents of the csv into page
this comment is to get my username.
It looks like you're new here. Sign in or register to get started.