Upload file through external service

Ryan Kafoor May 6, 2024

Hi, 

I want to use an external service to be able to upload a file to a specific field in a confiforms form that I have. Afaik Confiforms REST API Version 0 has an endpoint to do this but not through an external service as it is not capable of authorization. While Version 1 on the other hand does not support an endpoint to upload a file. What would my best route be in this case to achieve this?

Any help would be much appreciated. Thanks

1 answer

0 votes
Andrii Maliuta May 7, 2024

Hello @Ryan Kafoor ,

As you specified the Server/Data Center version of Confluence, you should use the https://docs.atlassian.com/ConfluenceServer/rest/8.9.0/#api/content/{id}/child/attachment-createAttachments REST API (for your Confluence version).

E.g.:

curl -D- -u admin:admin -X POST -H "X-Atlassian-Token: nocheck" -F "file=@myfile.txt" -F "comment=This is my File" http://myhost/rest/api/content/123/child/attachment

So you add the child item to the necessary page as an attachment.

Ryan Kafoor May 7, 2024

Hi, if it was not clear enough before, I was referring to APIs for conffiforms to be able to upload to a file to a confiform field

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events