Working with the API > How Do I... > Delete an Instance |
To delete an instance, send an HTTP DELETE request on the instance resource or filtered collection.
On success, the returned HTML body contains the complete data of the deleted instance.
Caution: It is possible to delete all instances in a collection. Make sure you specify the instance ID or filter the collection.
Delete a defect |
Copy Code
|
---|---|
*** Request *** DELETE /qcbin/api/domains/DEFAULT/projects/REST/defects/5 HTTP/1.1 Host: my-server:8080 Connection: keep-alive Content-Length: 0 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36 Origin: chrome-extension://cokgbflfommojglbmbpenpphppikmonn Content-Type: text/plain;charset=UTF-8 Accept: application/json Accept-Encoding: gzip, deflate, sdch Accept-Language: en-US,en;q=0.8,he;q=0.6 Cookie: JSESSIONID=1234567890;QCSession=1234567890; ALM_USER=1234567890; XSRF-TOKEN=1234567890; LWSSO_COOKIE_KEY=1234567890 *** Response *** HTTP/1.1 200 OK Date: Tue, 23 Dec 2014 08:37:44 GMT Content-Type: application/json Content-Length: 896 Server: Jetty(9.1.3.v20140225) { "type": "defect", "has-change": null, "planned-closing-ver": null, "test-reference": null, "subject": null, "reproducible": null, "request-id": null, "request-server": null, "id": 5, "ver-stamp": 1, "has-others-linkage": "N", "description": "<html><body>\nRefuses to acknowledge her.\n</body></html>", "priority": "4-Very High", "name": "Willoughby dissaffected with Marianne", "has-linkage": "N", "run-reference": null, "cycle-reference": null, "dev-comments": null, "creation-time": "2014-11-30", "to-mail": null, "request-note": null, "closing-version": null, "cycle-id": null, "detection-version": null, "last-modified": "2015-01-15 10:37:23", "status": null, "closing-date": null, "detected-in-rcyc": null, "detected-in-rel": null, "severity": "2-Medium", "attachment": null, "extended-reference": null, "estimated-fix-time": null, "project": null, "target-rel": null, "detected-by": "steves", "environment": null, "step-reference": null, "owner": null, "target-rcyc": null, "actual-fix-time": null, "request-type": null } |