CheckImageExists

Updated at:

Checks whether an image exists.

Operation description

Usage notes

This operation queries image information in an Image Search instance based on an image.

QPS limits

You can view the default maximum queries per second (QPS) for query operations in the console. The QPS is based on your purchase and supports 1 QPS, 5 QPS, and 10 QPS.

SDK version notes

The Image Search SDK is upgraded to V3.1.1, which supports the multi-subject identification and similarity score features. For more information, see Java SDK.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

imagesearch:CheckImageExists

get

*All Resource

*

None None

Request syntax

POST  HTTP/1.1

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 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.

2092061_1

PicName

string

Yes

The image name.

2092061_1

Response elements

Element

Type

Description

Example

object

The response.

Msg

string

The error message.

success

RequestId

string

The request ID.

B3137727-7D6E-488C-BA21-0E034C38A879

Auctions

object

The description of all returned products.

ProductId

string

The product ID.

2092061_1

PicName

string

The image name.

2092061_1.jpg

CategoryId

integer

The image category.

88888888

CustomContent

string

The custom content.

zidingyi

IntAttr

integer

The integer attribute.

2

IntAttr2

integer

The integer attribute.

2

StrAttr

string

The string attribute.

test

StrAttr2

string

The string attribute.

test

StrAttr3

string

The string attribute.

test

StrAttr4

string

The string attribute.

test

IntAttr3

integer

The integer attribute.

2

IntAttr4

integer

The integer attribute.

2

Code

integer

The error code. Valid values:

  • 0: success.

  • Non-0: failure.

0

Success

boolean

Indicates whether the request is successful.

true

Exists

boolean

Indicates whether the image exists.

true

Examples

Success response

JSON format

{
  "Msg": "success",
  "RequestId": "B3137727-7D6E-488C-BA21-0E034C38A879",
  "Auctions": {
    "ProductId": "2092061_1",
    "PicName": "2092061_1.jpg",
    "CategoryId": 88888888,
    "CustomContent": "zidingyi",
    "IntAttr": 2,
    "IntAttr2": 2,
    "StrAttr": "test",
    "StrAttr2": "test",
    "StrAttr3": "test",
    "StrAttr4": "test",
    "IntAttr3": 2,
    "IntAttr4": 2
  },
  "Code": 0,
  "Success": true,
  "Exists": true
}

Error codes

HTTP status code

Error code

Error message

Description

400 BadRequest The request has invalid parameters.
400 InstanceStatusError Your instance is unavailable.
400 TimeoutForTransferImage Timeout after 5 seconds waiting for images transfer to complete.
400 InvalidInstance The specified instance name is invalid.
400 NoCaretSeperator The body content is missing the ^ separator.
400 EmptyMeta The body content has an empty meta field.
400 InvalidMetaItem The meta field is invalid.
400 NoPicList The body content is missing the pic_list parameter.
400 InvalidPicList The specified pic_list parameter is invalid.
400 NoSpecifiedPic he content of an image is not specified in the HTTP POST body.
400 NoSpecifiedSearchPic The search image is not specified.
400 InvalidCategory The specified category is invalid.
400 OverflowMaxResultNum The specified number of total results exceeds the maximum of 500.
400 OverflowMaxReturnNum The specified number of results for each request exceeds the maximum of 100.
400 InvalidStartParameter The specified parameter start is inavlid.
400 InvalidNumParameter The specified parameter num 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.
400 UnsupportedPicFormat The specified image format is invalid.
400 InvalidFilterClause The specified filtering condition is invalid.
400 InstanceOverQuota The number of items exceeds the limit.
400 IncorrectOrientation The image contains incorrect rotation flags in the meta data.
400 UnsupportedPicPixels The specified pixels 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 2 * 1024 * 1024.
400 InvalidStrAttr4 The specified parameter StrAttr4 is not valid. Invalid StrAttr4
400 InvalidStrAttr3 The specified parameter StrAttr3 is not valid. Invalid StrAttr3
400 InvalidStrAttr2 The specified parameter StrAttr2 is not valid. Invalid
400 InvalidIntAttr4 The specified parameter IntAttr4 is not valid. Invalid
400 InvalidIntAttr3 The specified parameter IntAttr3 is not valid. Invalid IntAttr3
400 InvalidIntAttr2 The specified parameter IntAttr2 is not valid. Invalid IntAttr2
400 UnsupportedOperationType The specified action is not supported.
400 UnsupportedInstanceType The instance type is not supported.
500 InternalError An internal server error occurred.
500 NetworkException A network error occurred.
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.
500 InternalSwiftError An internal SWIFT error occurred.
500 InternalTableStoreError An internal Table Store error occurred.
403 NoPermission You are not authorized to perform this operation.
403 DeniedRequest Your request was denied due to instance flow control.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.