This topic describes how to call the DescribeImageLib operation to query custom image libraries.

Description

Operation: DescribeImageLib

You can call this operation to query custom image libraries.

Request parameters

For more information about the common request parameters that must be included in all Content Moderation API requests, see Common request parameters.

The following table describes the parameters in the request body.
Parameter Type Required Description
ServiceModule String Yes The name of the service module to which the image library is applied. Valid value: open_api (indicates the Content Moderation API).

Response parameters

For more information about common response parameters that this operation returns, see Common response parameters.

The data parameter in the response body is a JSON array. The following table describes the parameters that each element of the JSON array contains.
Parameter Type Required Description
Id Numeric Yes The primary key ID of the image library.
ModifiedTime String Yes The last time when the image library was modified.
Name String Yes The name of the image library.
Code String Yes The code of the image library.
Note The code of the image library appears in the Alibaba Cloud Content Moderation console. The primary key ID is used to identify the image library in the operation.
ImageCount String Yes The number of images in the image library.
Category String Yes The category of the image library. Valid values:
  • BLACK: a blacklist.
  • WHITE: a whitelist.
Source String Yes The source of the image library. Valid values:
  • MANUAL: indicates that the image library is manually created.
  • FEEDBACK: indicates that the image library is automatically created based on user feedback.
ServiceModule String Yes The name of the service module to which the image library is applied. Valid value: open_api (indicates the Content Moderation API).
Scene String Yes The moderation scenario to which the custom image library applies. Valid values:
  • PORN: pornography detection.
  • AD: ad violation detection.
  • ILLEGAL: terrorist content detection.
BizTypes List No The business type of the custom image library that you set on the Moderation Policy tab (by choosing Settings > Moderation API).
Enable Boolean No Indicates whether the image library was enabled. A value of true indicates that the image library was enabled, and a value of false indicates that the image library was disabled.

Examples

Sample requests
{
  "ServiceModule": open_api
}
Sample success responses
{
  "requestId": "6CF2815C-C8C7-4A01-B52E-FF6E24F53492",
  "data": {
    "TotalCount": 5,
    "ImageLibList": [
      {
        "Name": "Test a",
        "Source": "MANUAL",
        "ImageCount": 191231231230,
        "BizTypes": [
          1,
          2,
          3
        ],
        "Category": "BLACK",
        "ServiceModule": "open_api",
        "Scene": "PORN",
        "ModifiedTime": "2018-03-19 10:45:44 +0800",
        "Id": 1279,
        "Code": "808003055",
        "Enable": true
      },
      {
        "Name": "Hello aa",
        "Source": "MANUAL",
        "ImageCount": 0,
        "BizTypes": [],
        "Category": "BLACK",
        "ServiceModule": "open_api",
        "Scene": "PORN",
        "ModifiedTime": "2018-03-01 19:20:37 +0800",
        "Id": 1222,
        "Code": "808003043",
        "Enable": true
      }
    ]
  },
  "code": 200,
  "success": true
}