I'm trying to use the Confluence UI REST API and do a POST request to add a label to an attachment. I tried using curl to do this, but I keep getting an error in HTML, with title "Oops - an error has occurred - Confluence." My command looks like this:
curl -u $username:$password -X POST -H "Content-Type:application/json" -d @data.json ${hostname}/rest/uri/1.0/attachment/${attachmentID}/labels
The data.json file contains:
{"name": "test", "id": 8787878}
I am able to use the the GET and DELETE methods in the Confluence UI REST API with cURL. I'm not sure if the data from the JSON file is in the correct format or even the correct data and I am providing an arbitrary id.