AddImage
Adds image information to an Image Search instance.
Operation description
Usage notes
This operation adds image information to an Image Search instance.
QPS limits
For an instance with a maximum image capacity of 100,000, the default concurrency is 1. This means the instance can process up to 1 image addition request per second. For instances with other image capacities, the default concurrency is 5. This means the instance can process up to 5 image addition requests per second.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
imagesearch:AddImage |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceName |
string |
Yes |
The name of the Image Search instance. The name can be up to 20 characters in length. If you have already purchased an Image Search instance, you can log on to the Image Search console to view the instance name. If you have not purchased an Image Search instance, refer to Activate the service and Create an instance. Note
The instance name is different from the instance ID. Make sure to distinguish between them. |
demoinstance1 |
| ProductId |
string |
Yes |
The product ID. The ID can be up to 256 characters in length. Note
A product can have multiple images. |
2092061_1 |
| PicName |
string |
Yes |
The image name. The name can be up to 256 characters in length. Note
|
2092061_1.jpg |
| PicContent |
string |
Yes |
The image content.
Note
|
AAAANSUhEUgAAAPcAAAEVCAYAAAA8d3NuAAAAAXNSR0IArs......RK5CYII= |
| CategoryId |
integer |
No |
The image category. For more information, see Category reference. Note
|
88888888 |
| Crop |
boolean |
No |
Specifies whether to perform subject identification. Default value: true.
For fabric image search, this parameter is ignored and the system searches based on the entire image. |
true |
| Region |
string |
No |
The subject area of the image. The format is Note
|
280,486,232,351 |
| CustomContent |
string |
No |
The custom content. The content can be up to 4,096 characters in length. Note
This parameter is returned in query results. For example, you can add text such as the image description. |
zidingyi |
| IntAttr |
integer |
No |
The integer attribute. You can use this parameter to filter query results. This parameter is returned in query results. |
22 |
| StrAttr |
string |
No |
The string attribute. The attribute can be up to 128 characters in length. You can use this parameter to filter query results. This parameter is returned in query results. Note
Special characters such as \¥$&% are not supported. |
ss |
| IntAttr2 |
integer |
No |
The integer attribute. You can use this parameter to filter query results. This parameter is returned in query results. |
22 |
| StrAttr2 |
string |
No |
The string attribute. The attribute can be up to 128 characters in length. You can use this parameter to filter query results. This parameter is returned in query results. Note
Special characters such as \¥$&% are not supported. |
ss |
| IntAttr3 |
integer |
No |
The integer attribute. You can use this parameter to filter query results. This parameter is returned in query results. |
33 |
| StrAttr3 |
string |
No |
The string attribute. The attribute can be up to 128 characters in length. You can use this parameter to filter query results. This parameter is returned in query results. Note
Special characters such as \¥$&% are not supported. |
ss |
| IntAttr4 |
integer |
No |
The integer attribute. You can use this parameter to filter query results. This parameter is returned in query results. |
44 |
| StrAttr4 |
string |
No |
The string attribute. The attribute can be up to 128 characters in length. You can use this parameter to filter query results. This parameter is returned in query results. Note
Special characters such as \¥$&% are not supported. |
ss |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| Message |
string |
The error message. Note
No data is returned for a successful request. An error message is returned for a failed request. |
success |
| RequestId |
string |
The request ID. |
E0845DE6-52AF-4B50-9F15-51ED4044E6AB |
| Code |
integer |
The error code.
|
0 |
| PicInfo |
object |
The category prediction and subject identification results. |
|
| Region |
string |
The subject identification result. The subject area of the image. The format is |
94,691,206,650 |
| CategoryId |
integer |
The category prediction result. If a category is specified in the request, the specified category is used. |
88888888 |
| MultiRegion |
array<object> |
The collection of subject identification results. Note
You must upgrade the SDK to V3.1.1 or later to use this parameter. |
|
|
object |
The subject identification result. |
||
| Region |
string |
The subject identification result. The subject area of the image. The format is x1,x2,y1,y2, where x1,y1 specifies the upper-left corner and x2,y2 specifies the lower-right corner. If a subject area is specified in the request, the specified subject area is used. |
94,691,206,650 |
| AllCategories |
array<object> |
All categories supported by the system. |
|
|
object |
All categories supported by the system. |
||
| Name |
string |
The category name. |
Other |
| Id |
integer |
The category ID. |
88888888 |
| Success |
boolean |
Indicates whether the request is successful. |
true |
Examples
Success response
JSON format
{
"Message": "success",
"RequestId": "E0845DE6-52AF-4B50-9F15-51ED4044E6AB",
"Code": 0,
"PicInfo": {
"Region": "94,691,206,650",
"CategoryId": 88888888,
"MultiRegion": [
{
"Region": "94,691,206,650"
}
],
"AllCategories": [
{
"Name": "Other",
"Id": 88888888
}
]
},
"Success": true
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | BadRequest | The request has invalid parameters. | Invalid parameter. |
| 400 | InstanceStatusError | Your instance is unavailable. | |
| 400 | InvalidInstance | The specified instance name is invalid. | The instance name is invalid. |
| 400 | NoCaretSeperator | The body content is missing the ^ separator. | The request body is missing a required symbol. |
| 400 | EmptyMeta | The body content has an empty meta field. | The request body contains empty fields. |
| 400 | InvalidMetaItem | The meta field is invalid. | The metadata field is invalid. |
| 400 | NoPicList | The body content is missing the pic_list parameter. | The pic_list field is not specified. |
| 400 | NoSpecifiedPic | The content of an image is not specified in the HTTP POST body. | The image is not specified. |
| 400 | NoSpecifiedSearchPic | The search image is not specified. | |
| 400 | InvalidCategory | The specified category is invalid. | The category ID is invalid. |
| 400 | OverflowMaxResultNum | The specified number of total results exceeds the maximum of 500. | The maximum return result limit of 500 has been exceeded. |
| 400 | OverflowMaxReturnNum | The specified number of results for each request exceeds the maximum of 100. | The number of results returned in a single request exceeds the limit of 100. |
| 400 | InvalidStartParameter | The specified parameter s is inavlid. | |
| 400 | InvalidNumParameter | The specified parameter n is invalid. | |
| 400 | NoSpecifiedAddPic | The image to insert is not specified. | |
| 400 | NoSpecifiedItemId | The item_id parameter is not specified. | |
| 400 | InvalidIntAttr | The specified int_attr field is invalid. | The int filter field is invalid. |
| 400 | UnsupportedPicFormat | The specified image format is invalid. | The image format is invalid. |
| 400 | InvalidFilterClause | The specified filtering condition is invalid. | The filter condition is invalid. |
| 400 | InstanceOverQuota | The number of items exceeds the limit. | The number of images in the instance exceeds the limit. |
| 400 | IncorrectOrientation | The image contains incorrect rotation flags in the meta data. | The image contains an unsupported rotation parameter. |
| 400 | UnsupportedPicPixels | The specified pixels is not supported. | The image pixel value is not supported. |
| 400 | SearchTimeout | The request is timed out. | |
| 400 | PicNotExist | The search picture does not exist. | |
| 400 | NoSpecifiedProductId | The parameter ProductId no specified. | |
| 400 | NoSpecifiedPicName | The parameter PicName no specified. | |
| 400 | NoSpecifiedPicContent | The parameter PicContent no specified. | |
| 400 | InvalidType | The specified parameter Type is not valid. | |
| 400 | InvalidProductId | The specified parameter ProductId is not valid. | |
| 400 | InvalidPicName | The specified parameter PicName is not valid. | |
| 400 | InvalidStrAttr | The specified parameter StrAttr is not valid. | Invalid StrAttr |
| 400 | InvalidCustomContent | The specified parameter CustomContent is not valid. | |
| 400 | InvalidPicContent | The specified parameter PicContent length greater than 4 * 1024 * 1024. | |
| 400 | TimeoutForTransferImage | Timeout after 5 seconds waiting for images transfer to complete. | |
| 400 | InvalidPicUrl | The search picture does not exist at the specific url. | |
| 400 | InvalidInstanceName | The parameter instanceName is not specified. | |
| 400 | InvalidRequestId | The parameter requestId is not specified. | |
| 400 | InvalidRequestIdTooLarge | The parameter requestId is too large. | |
| 400 | InvalidRegion | The specific region is illegal. | |
| 400 | RegionError | region. | |
| 400 | InvalidStrAttr2 | The specified parameter StrAttr2 is not valid. | Invalid |
| 400 | InvalidStrAttr3 | The specified parameter StrAttr3 is not valid. | Invalid StrAttr3 |
| 400 | InvalidStrAttr4 | The specified parameter StrAttr4 is not valid. | Invalid StrAttr4 |
| 400 | InvalidIntAttr2 | The specified parameter IntAttr2 is not valid. | Invalid IntAttr2 |
| 400 | InvalidIntAttr3 | The specified parameter IntAttr3 is not valid. | Invalid IntAttr3 |
| 400 | InvalidIntAttr4 | The specified parameter IntAttr4 is not valid. | Invalid |
| 400 | PictureError | [download] Img Download Failed. | Picture download failed, please check the picture |
| 400 | UnsupportedOperationType | The specified action is not supported. | An internal error occurred: the action is not supported. |
| 500 | UnknownException | An internal server error occurred. | An unknown exception occurred. |
| 500 | NetworkException | A network error occurred. | An internal error occurred due to a network exception. |
| 500 | RequestTimeout | The request is timeout. | |
| 500 | ExtractFeatureTimeout | The request was timed out while extracting features. | |
| 500 | AccessEngineFailed | An error occurred while accessing the search engine. | |
| 500 | InternalOssError | An internal OAS error occurred. | Internal error: An internal algorithm error occurred. |
| 500 | InternalSwiftError | An internal SWIFT error occurred. | Internal error: An internal MSMQ fault occurred. |
| 500 | InternalTableStoreError | An internal Table Store error occurred. | Internal error: A feature storage error occurred. |
| 500 | ConnectionDVException | Failed to obtain collection. | internalError |
| 403 | NoPermission | You are not authorized to perform this operation. | The action is unauthorized. |
| 403 | DeniedRequest | Your request was denied due to instance flow control. | The request was denied because the traffic throttling threshold of the instance was exceeded. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.