It's all about the answers!

Ask a question

How can I delete a service provider link, or the entire collection, using the REST API with curl?

Ryan McBryde (361923) | asked Sep 08, 9:12 a.m.

 I have a curl script that will step through my list of active RDNG projects and will present me with a list of the Associations that each project has with other projects, such as RTC for Change Requests, or RQM for Test Cases. I am using REST API calls found here:  The API call that I use to present the list looks like this:  curl -k -b cookies.txt -H "Accept: application/xml" "https://<host>:9443/rm/process/project-areas/_01KIgzQjEeazXZOTb1V8ow/links"

What I want to do is to remove one the Association links or in some cases remove all the links for the project.  I am struggling with the syntax to do the delete.  This is what I have tried to delete a single link:
curl -D - -k -b  cookies.txt -X DELETE "https://<host>:9443/rm/process/project-areas/_01KIgzQjEeazXZOTb1V8ow/links/_5ui5UTQjEeazXZOTb1V8ow"
When I do I get a nasty looking java error that concludes with the message: "You don't have permission to perform the following actions:   Modify project area properties (modify/other)"
I have also tried deleting the collection itself instead of the individual links using this command:
curl -D - -k -b  cookies.txt -X DELETE "https://<host>:9443/rm/process/project-areas/_01KIgzQjEeazXZOTb1V8ow/links"
That returns a "400 Bad Request" and the message, "Missing parameter "type"
I can see in the output from the listing curl command that each of the links shows a <jp:link-type> with "validated-by" or "implemented-by" or "tracked-by-cm"  but I can't seem to find the syntax to specify the type on the curl command itself.
This is in CLM 6.0.1 and we are archiving one of the CLM applications, such as RQM, and as part of the decommissioning process, I would like to do a bulk removal of all the Associations in each RDNG project and this seems to be a better way to do it than to open up each RDNG project and manually remove the association links.  I assume that I am close but just can't figure out the correct syntax.
Thank you

One answer

permanent link
Ralph Schoon (58.7k23642) | answered Sep 14, 9:13 a.m.
The documentation specified that the delete request requires two parameters.

The error indicates that a parameter is missing and the cURL code does not show that parameter either.

I would suggest to use RESTCLIENT in Firefox to play around with the API to find out how the request would look like and generate the cURL code once that works.

Your answer

Register or to post your answer.