Deleting annotations
You use the HTTP DELETE request to delete an annotation for an object. You cannot delete annotations for old versions of an object.
Access permission
To delete an annotation, you need delete permission.
Request header
DELETE /rest/directory/file?type=custom-metadata&annotation=annotation HTTP/1.1
Parameter | Required | Description |
directory | Yes | Folder name. |
file | Yes | Name of the file, including file extension. |
type | Yes | Use the value custom-metadata . |
annotation | No | Use a value of the name of the annotation. You can omit this parameter for the default annotation.Used in conjunction with the type parameter. |
Response headers
This operation does not return any request-specific response headers.
Return codes
The table below describes the HTTP return codes that have specific meaning for this request.
Code | Meaning | Description |
200 | OK | HCP successfully deleted the annotation. |
204 | No Content | The specified object does not have the specified annotation. |
400 | Bad Request |
The request specified a conditional header, such as If-Match. If more information about the error is available, the HTTP response headers include the HCP-specific |
403 | Forbidden |
One of:
If more information about the error is available, the response headers include the HCP-specific |
404 | Not Found |
One of:
|
409 | Conflict | HCP could not delete the annotation because it is currently being written to the namespace. |
Example: Deleting an annotation for an object
Here’s a sample HTTP DELETE request that deletes the report_data annotation for an object named Q1_2012.ppt located in the quarterly_rpts directory.
Request with curl command line
curl -k -iX DELETE -H "Authorization: HCP bXl1c2Vy:3f3c6784e97531774380db177774ac8d" "https://finance.europe.hcp.example.com/rest/quarterly_rpts/Q1_2012.ppt ?type=custom-metadata&annotation=report_data"
Request in Python using PycURL
import pycurl curl = pycurl.Curl() curl.setopt(pycurl.HTTPHEADER, ["Authorization: HCP bXl1c2Vy:3f3c6784e97531774380db177774ac8d"]) curl.setopt(pycurl.URL, "https://finance.europe.hcp.example.com \ /rest/quarterly_rpts/Q1_2012.ppt?type=custom-metadata \ &annotation=report_data") curl.setopt(pycurl.SSL_VERIFYPEER, 0) curl.setopt(pycurl.SSL_VERIFYHOST, 0) curl.setopt(pycurl.CUSTOMREQUEST, "DELETE") curl.perform() print curl.getinfo(pycurl.RESPONSE_CODE) curl.close()
Request headers
DELETE /rest/quarterly_rpts/Q1_2012.ppt?type=custom-metadata &annotation=report_data HTTP/1.1 Host: finance.europe.hcp.example.com Authorization: HCP bXl1c2Vy:3f3c6784e97531774380db177774ac8d
Response headers
HTTP/1.1 200 OK X-HCP-ServicedBySystem: hcp.example.com X-RequestId: E62EFD408DBB7B8F X-HCP-Time: 1334829227 Content-Length: 0