This topic describes how to call the DescribeKeywordLib operation to query the custom text libraries that have been created. You can use text libraries for text anti-spam. The effect of managing custom text libraries by calling API operations is the same as that of managing custom text libraries in the Alibaba Cloud Content Moderation console.
Description
Operation: DescribeKeywordLib
You can call this operation to query custom text 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.
Parameter | Type | Required | Description |
---|---|---|---|
ServiceModule | String | Yes | The name of the service module to which the text 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.
Parameter | Type | Required | Description |
---|---|---|---|
Id | Numeric | Yes | The primary key ID of the text library. |
ModifiedTime | String | Yes | The last time when the text library was modified. |
Name | String | Yes | The name of the text library. |
Code | String | Yes | The code of the text library.
Note The code of the text library appears in the Alibaba Cloud Content Moderation console.
The primary key ID is used to identify the text library in the operation.
|
Count | String | Yes | The number of terms in the text library. |
Category | String | Yes | The category of the text library. Valid values:
|
Source | String | Yes | The source of the text library.
Note The value is fixed to MANUAL, which indicates that the text library is manually added.
|
ServiceModule | String | Yes | The name of the service module to which the text library is applied. Valid value: open_api (indicates the Content Moderation API). |
BizTypes | List | No | The business type of the custom text library that you set on the Moderation Policy tab (by choosing Settings > Moderation API). |
ResourceType | String | Yes | The resource type of the text library. Valid values:
|
LibType | String | Yes | The type of the text library in each moderation scenario. Valid values:
|
MatchMode | String | No | The matching method. Valid values:
|
Enable | Boolean | No | Indicates whether the text library was enabled. A value of true indicates that the text library was enabled, and a value of false indicates that the text library was disabled. |
Examples
{
"ServiceModule": open_api
}
{
"requestId": "795D8871-4889-4C0F-A8B1-C7D2B990FF61",
"data": {
"TotalCount": 11,
"KeywordLibList": [
{
"Name": "test1sdkdk",
"Source": "MANUAL",
"BizTypes": [],
"Category": "BLACK",
"ServiceModule": "open_api",
"Count": 3,
"ResourceType": "TEXT",
"Id": 2147,
"ModifiedTime": "2018-09-04 14:17:56 +0800",
"Code": "710001",
"LibType": "textKeyword",
"MatchMode":"fuzzy",
"Enable":"true"
},
{
"Name": "Audio test",
"Source": "MANUAL",
"BizTypes": [],
"Category": "BLACK",
"ServiceModule": "open_api",
"Count": 3,
"ResourceType": "VOICE",
"Id": 2693,
"ModifiedTime": "2018-09-03 17:11:04 +0800",
"Code": "932001",
"LibType": "voiceText",
"MatchMode":"fuzzy",
"Enable":"true"
}
]
},
"code": 200,
"success": true
}