All Products
Search
Document Center

Delete an image

Last Updated: Apr 28, 2019

Description

You can call this operation to delete a specified image from an Image Search instance.

Note: The operation is successful even if the specified image does not exist in the instance. You cannot use the response to determine whether an image exists.

Request URL

Protocol URL Method Parameter
HTTPS ${HOST}/v2/image/delete POST JSON

For more information about ${HOST}, see Request structure.

Request parameters

Name Type Required Description
InstanceName String Yes The name of the Image Search instance.
ProductId String Yes The ID of the product.
PicName String No The name of the image. If this parameter is not specified, all images under ProductId are deleted. If this parameter is specified, only the image specified by ProductId and PicName is deleted.

Response parameters

Name Type Example Description
Success Boolean true Indicates whether the call is successful. A value of true indicates that the call is successful. A value of false indicates that the call has failed.
RequestId String 36C43E96-8F68-44AA-B1AF-B1F7AB94A6C1 The ID of the request.
Code Integer 0 The error code. A value of 0 indicates that the call is successful. Other values indicate that the call has failed.
Message String success The error message.

Examples

Sample requests

  1. URL: ${HOST}/v2/image/delete
  2. POST Body:
  3. {
  4. "InstanceName": "demoinstance",
  5. "Name": "test",
  6. "ProductId": "1002"
  7. }

Sample responses

  1. {
  2. "Message": "success",
  3. "RequestId": "05BAAD52-4E88-4DAA-918D-13064C0D7A25",
  4. "Success": true,
  5. "Code": 0
  6. }

Error codes

For more information, see Error codes.