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.
Usage note
Operation: DescribeKeywordLib
You can call this operation to query custom text libraries. For more information about how to construct an HTTP request, see Request structure. 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 send up to 10 requests per second to call this operation by using your Alibaba Cloud account. If you send an excessive number of requests, throttling is implemented, and your business may be affected.
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 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, click
. 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 | The source of the custom text library. Valid values:
|
BizTypes | StringArray | ["bizTypeA","bizTypeB"] | The business scenario of the custom text library. The name of the business scenario is specified when you create a business scenario on the BizType Manage tab. To go to the tab, choose in the left-side navigation pane. |
ResourceType | String | TEXT | The resource type of the text library. Valid values:
|
LibType | String | textKeyword | The type 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
}