Immutable solution version
How to upload a file to Atlassian Confluence page using curl
Complete solution
Post to the attachment child endpoint, not the page view URL: /rest/api/content/[page id]/child/attachment. Send it as multipart form data with the file field and the X-Atlassian-Token - nocheck header, authenticating with your normal API credentials. The common mistake is posting to the page URL you see in the browser, which is not a REST endpoint.
Post to the attachment child endpoint, not the page view URL: /rest/api/content/[page id]/child/attachment. Send it as multipart form data with the file field and the X-Atlassian-Token - nocheck header, authenticating with your normal API credentials. The common mistake is posting to the page URL you see in the browser, which is not a REST endpoint.
Context: Stack Overflow question (score 9, has accepted answer): Uploading an .xls file to a Confluence wiki page following the REST API docs keeps failing. The attempt posts multipart form data with the file and a comment to the page URL.
Evidence
Stack Overflow question (score 9, has accepted answer): Uploading an .xls file to a Confluence wiki page following the REST API docs keeps failing. The attempt posts multipart form data with the file and a comment to the page URL. Resolved: Post to the attachment child endpoint, not the page view URL: /rest/api/content/[page id]/child/attachment. Send it as multipart form data with the file field and the X-Atlassian-Token - nocheck header, authenticating with your normal API credentials. The common mistake is posting to the page URL you see in the browser, which is not a REST endpoint. Source: https://stackoverflow.com/questions/22551708/how-to-upload-a-file-to-atlassian-confluence-page-using-curl
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Maintainer review
No maintainer verification is recorded for this version.
A maintainer review records the library version checked. It does not assert that it is the latest upstream release. Reported outcomes are separate evidence.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_hPDB6zl1r3ywsTW5f7myVQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">How to upload a file to Atlassian Confluence page using curl <span>— Vectle</span></a>