Deletes image data from an Image Search instance.
Before you call this operation, you must specify the instanceName parameter in a URL to specify the instance from which you want to delete images. You must also specify other parameters in a specified format to construct a request body. The request URL includes /item/delete.
Request parameters
Parameters in the URL
Parameter
Type
Required
Description
instanceName
String
Yes
The name of the Image Search instance.
Parameters in the request body
Parameter
Type
Required
Description
item_id
String
Yes
The ID of the product or the image to be deleted.
pic_list
List
No
The list of the names of the images to be deleted. If this parameter is not specified, the system deletes all the images under the specified item_id.
Body structure
The body is in the following format:
key1,key1_start_offset,key1_end_offset#...#keyn,keyn_start_offset,keyn_end_offset^key1_content...keyn_content
The body is divided into two parts: image metadata and image content, which are separated with a circumflex (^). The metadata includes a set of keys and the offset of each key value in the content. Keys are separated with number signs (#). Each key includes a key name, a start offset value, and an end offset value, which are separated with commas (,). The start offset value and the end offset value represent the start position and end position of the key the image content. The pic_list parameter specifies Base64-encoded image names that are separated with commas (,). The pic_map parameter specifies Base64-encoded image content. Each key that is specified in the pic_map parameter must be paired with a key that is specified in the pic_list parameter.
Response parameters
Parameter | Type | Description |
Success | Boolean | Indicates whether the request is successful. |
RequestId | String | The ID of the request. |
Code | int | The error code. The value 0 indicates a request success. A value that is not 0 indicates a request failure. |
Message | String | The returned message. |
Response format
{
"Message":"success",
"RequestId":"73B5133C-84EE-4F0A-B972-23CCCBFB7CD5",
"Success":true,
"Code":0
}
Examples
The following example shows how to delete images whose item_id is 1000 and names are shoes1.jpg and shoes2.jpg from the goodssearch instance. The following request is provided:
URL: /item/delete? instanceName=goodssearch
POST Body:
item_id,0,4#pic_list,4,37^1000c2hvZXMxLmpwZw==,c2hvZXMyLmpwZw==
Note: c2hvZXMyLmpwZw== represents the Base64-encoded image name shoes1.jpg and c2hvZXMxLmpwZw== represents the Base64-encoded image name shoes2.jpg.