Hello Everyone,
I am trying to delete label from confluece page using rest api but its not working somehow. Please find below curl statement I am using.
curl -k -u username:pwd -X DELETE https://{url}/rest/api/content/{id}/label?name={labelName}
Could you please suggest what is way to delete label using restful apis?
Community moderators have prevented the ability to post new answers.
I know the OP is several years old, but in case someone else is looking for an answer like I was, I found the below to work:
curl -k -u username:pwd -X DELETE https://{url}/rest/api/content/{id}/label/{labelName}
It might be possible to use the undocumented API that Confluence itself uses:
DELETE /rest/ui/1.0/content/{contentId}/label/{labelId}
otherwise you can use the JSON-RPC (or XML-RPC) API (kinda similar to REST API, but slightly different syntax and technically deprecated, but unlikely to go away quite yet):
POST /rpc/json-rpc/confluenceservice-v2/removeLabelById
POST /rpc/json-rpc/confluenceservice-v2/removeLabelByName
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi vick,
I think you need to use a different REST endpoint to delete a label.
.../rest/api/content/{id}/label/{label}
Best regards,
Robert
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you Robert for your comment. I was trying that option too but it dint work.
curl -k -u username:passwd -X DELETE -H "Content-Type: application/json" https://{url}/rest/api/content/{id}/label/{label}
Got this message:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><status><status-code>404</status-code><message>null for uri
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.