When I run requests against this endpoint:
"https://your-domain.atlassian.net/wiki/rest/api/content/{id}/child/attachment"
I get various errors (403 for PUT and 500 for POST).
Can we have a working example for using this endpoint to upload a file to a confluence page please. E.g Upload `example.txt`.
Ideally Python but cURL should be fine either.
I am able to run get requests against the same endpoint and successfully return attachments, so I don't think there's an issue with my API key or permissions.
For context, I created the page and am able to edit it through my browser.
Hi @Llyr Jones
Welcome to the community!
Ideally, it should be POST method.
It could be that the REST API could not find the file that is being attached. I have not tried it in Python but used third-party application like Postman.
If you don't mind, can you list the complete curl command here (after hiding your Confluence domain, of course).
Thanks,
Vamsi
I'm using Postman but here is the cURL generated from my request
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Llyr Jones
Is the attachment file in the same location from where you are executing this curl command?
Can you check this reference article: https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content---attachments/#api-wiki-rest-api-content-id-child-attachment-post and try out the example given?
Thanks,
Vamsi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.