Delete Label using REST API

vick May 10, 2016

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?

3 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Leland Irwin January 22, 2019

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}

0 votes
Stephen Deutsch
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 17, 2016

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

https://developer.atlassian.com/confdev/confluence-rest-api/confluence-xml-rpc-and-soap-apis/remote-confluence-methods

0 votes
Robert Krause
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 10, 2016

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

vick May 11, 2016

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events