Queries custom text libraries. You can use text libraries for text anti-spam. The information about custom text libraries returned by the API operation is consistent with that about custom text libraries in the Alibaba Cloud Content Moderation console.
Description
Operation: DescribeKeywordLib
You can call this operation to query custom text libraries. For more information about how to construct an HTTP request, see Request syntax. You can also select an existing HTTP request. For more information, see SDK overview.
Billing: This operation is free of charge.
QPS limit
You can call this operation up to 10 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
Request parameters
For more information about the common request parameters that must be included in all Content Moderation API requests, see Common parameters.
Parameter | Type | Required | Example | Description |
ServiceModule | String | Yes | open_api | The name of the service module. Set the value to open_api. A value of open_api indicates that you want to query the text libraries used in the Content Moderation API. |
Response parameters
For more information about common response parameters that this operation returns, see Common response parameters.
Parameter | Type | Example | Description |
Id | Integer | 2147 | The ID of the text library. |
ModifiedTime | String | 2018-09-04 14:17:56 +0800 | The time when the text library was last modified. |
Name | String | test1sdkdk | The name of the text library. |
Code | String | 710001 | The code of the text library. Note In the left-side navigation pane of the console, choose . On the page that appears, you can view the codes of text libraries. A code is used to identify a text library in the console, whereas an ID is used to identify a text library when you call API operations. |
Count | String | 3 | The number of text entries in the text library. |
Category | String | BLACK | The category of the text library. Valid values:
|
Source | String | MANUAL | Indicates how the custom text library was created. Valid values:
|
BizTypes | StringArray | ["bizTypeA","bizTypeB"] | The business scenario. For more information, see CreateBizType. |
ResourceType | String | TEXT | The category of the text library. Valid values:
|
LibType | String | textKeyword | The category of the text library in each moderation scenario. Valid values:
|
MatchMode | String | fuzzy | The matching method. Valid values:
|
Enable | Boolean | true | The status of the text library.
|
Examples
http(s)://green.cn-shanghai.aliyuncs.com/?
Action=DescribeKeywordLib&ServiceModule=open_api
&<Common request parameters>
{
"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": "Test001",
"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
}