Feature Overview
This API (DELETE Object tagging) is used to delete the existing tags of an object.
If a sub-account needs to call this API (
DELETE Object tagging), ensure that the root account has authorized it to do so.Versioning
If you have enabled versioning for the bucket and want to delete tags from an object of a specific version, include the
VersionId parameter in the request.Requests
Sample Request
DELETE /<ObjecKey>?tagging&VersionId=VersionId HTTP 1.1Host:<BucketName-APPID>.cos.<Region>.myqcloud.comDate:dateAuthorization: Auth String
Note
Host: <BucketName-APPID>.cos.<Region>.myqcloud.com, where <BucketName-APPID> is the bucket name with the APPID suffix, such as examplebucket-1250000000. You can refer to the Bucket Overview > Basic Information and Bucket Overview > Bucket Naming Convention documentation. <Region> represents the available regions for COS, which can be found in the Regions and Access Domain Names documentation.
Authorization: Auth String (For more information, see Request Signature.)
Request Parameters
Name | Description | Local Disk Types | Required |
versionId | Version ID of the object (if versioning is enabled). If this parameter is not specified, tags of the latest-version object will be deleted. | string | Not required |
Request Header
Request Body
The request body of this request is empty.
Response
Response Header
Response Body
No special response body is returned for this request.
Error Codes
Examples
Sample 1: deleting object tags (with versioning disabled)
Requests
The following example deletes all existing tags from the
exampleobject.txt object in the examplebucket-1250000000 bucket:DELETE /exampleobject.txt?tagging HTTP/1.1User-Agent: curl/7.29.0Accept: */*Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.comAuthorization: Auth StringContent-Length: 0Content-Type: application/xml
Response
HTTP/1.1 204 No ContentContent-Type: application/xmlConnection: closeDate: Fri, 19 Jan 2020 11:40:22 GMT
Sample 2: deleting object tags (with versioning enabled)
Requests
The following example deletes all existing tags from the
exampleobject.txt object whose version ID is MTg0NDUxNTgwODg2MTEzMTQyOTI in the examplebucket-1250000000 bucket:DELETE /exampleobject.txt?tagging&VersionId=MTg0NDUxNTgwODg2MTEzMTQyOTI HTTP/1.1User-Agent: curl/7.29.0Accept: */*Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.comAuthorization: Auth StringContent-Length: 0Content-Type: application/xml
Response
HTTP/1.1 204 No ContentContent-Type: application/xmlConnection: closeDate: Fri, 19 Jan 2020 11:45:22 GMT