You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi.
I am trying to set up a call to upload files to pages, but I keep hitting a snag where it tells me 415 Unsupported Media Type.
I'm trying to go by what this documentation says:
https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content---attachments/#api-wiki-rest-api-content-id-child-attachment-put
In Postman I've set up other calls, that work fine. including a GET on /wiki/rest/api/content/{pageid}/child/attachment
For the POST I have set up the header
X-Atlassian-Token with value nocheck
The body is:
According to the documentation you linked you are missing the Content-Type header in your request, the Content-Type should be set to multipart/form-data for file uploads.
Try adding the following header to your request:
Content-Type: multipart/form-data
Also, make sure that the file path you are using in your request body is correct and that the file exists.
This was part of the issue.
But I only got it to work after I switched from using Raw , to form-data in the body in Postman.
Added a line with they key st to file.
Under value I browsed for the file I wanted to upload.
I had to show the Content type field under form-data, and set it to multipart/form-data for that file.
Seems this call can send multiple files, and you have to specify content type pr file. Which makes sense once you know its a multi file call, not single file.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.