HTTP Response
Update:
HTTP response:
Content-Type: application/json;charset=UTF-8
The result is in JSON format, please refer to the following example.
- Example of HTTP response:
Description of returning json field:
Field name
Type
Description
errorCode
Number
Error code: 0 means success
errorMessage
String
Error message
textSpam
json object
Resut message
warning
Boolean
Customize the alarm information of advertising words, and configure it when adding a blacklist on the console
taskId
String
Unique identifier to distinguish different calls
startTime
Number
Timestamp, representing the detection text call time
endTime
Number
Timestamp, representing the return time of the detected text result
textSpam:
Field name
Type
Description
content
String
After the detection is complete, sensitive words will change to asterisks if they contain sensitive words, and other content will be returned normally.
result
Number
0: Pass, 1: Recommended for review, 2: Fail
tages
json array
Classified information
wordList
json array
List of sensitive words
tags:
Field name
Type
Description
tag
Number
Classified information:
100: politics, 110: violence, 120: prohibited, 130: eroticism, 150: advertisement, 160: insults, 170: Hate speech, 180: Minor protection, 190: sensitive hot spots,410:Irregular Emoticons, 420:Nickname,300:advertising law,220:private transaction,900: other, 999: customization
tagName
String
Detect first-level type names for text hits
tagNameEn
String
Detect first-level type names for text hits(English)
level
Number
Classification level,0:Normal,1:Suspected,2:Abnormal
confidence
Number
confidence,between 0 and 100,oney when tag=150,confidence is not null; The higher the value, the more likely to be an advertisement
subTags
json object
Secondary classification of sensitive information
subTags:
Field name
Type
Describe
subTag
Number
Secondary classification information reference Classification Code
subTagName
String
Detect secondary type names for text hits
subTagNameEn
String
Detect secondary type names for text hits(English)
wordList
array of strings
hit details
-
Response example :
JSON response
{
"errorCode": 0,
"textSpam": {
"content": "****",
"result": 2,
"tags": [
{
"tag": 160,
"level": 2,
"tagName": "辱骂",
"tagNameEn": "insults",
"subTags": [
{
"subTag": 160001,
"subTagName": "谩骂人身攻击",
"subTagNameEn": "insults and personal attacks",
"wordList": [
"fuck"
]
}
]
}
],
"wordList": [
"fuck"
]
},
"taskId": "c01b212f-3e31-4a2e-8346-b6f6ce3a3456",
"startTime": 1660103900367,
"endTime": 1660103900374
}
错误码:
HTTP Status Code
Error code
Error message
Cause of error
200
0
This field will be ommitted
429
1104
Out of Rate Limit
Frequency of requests exceeds the limit
405
1004
Method Not Allowed
The http request method can only be get or post. If it is post, header must have content-type,and its value should be application/x-www-form-urlencoded
400
1002
API Not Found
The corresponding API was not found according to the path of the http request.
400
1003
Bad Request
Parsing request failed
400
2000
Missing Parameter
Missing parameters content
400
2102
Input Too Long
The length of the parameter content exceeds the limit.
401
1102
Unauthorized Client
Parameter appId invalid
401
1106
Missing Access Token
Missing Authorization
401
1107
Invalid Token
Incorrect Authorization
401
1108
Expired Token
Expired timeStamp
401
2000
Missing Parameter
Missing timeStamp
401
2001
Invalid Parameter
TimeStamp format error
HTTP response:
Content-Type: application/json;charset=UTF-8
The result is in JSON format, please refer to the following example.
- Example of HTTP response:
Description of returning json field:
Field name | Type | Description |
---|---|---|
errorCode | Number | Error code: 0 means success |
errorMessage | String | Error message |
textSpam | json object | Resut message |
warning | Boolean | Customize the alarm information of advertising words, and configure it when adding a blacklist on the console |
taskId | String | Unique identifier to distinguish different calls |
startTime | Number | Timestamp, representing the detection text call time |
endTime | Number | Timestamp, representing the return time of the detected text result |
textSpam:
Field name | Type | Description |
---|---|---|
content | String | After the detection is complete, sensitive words will change to asterisks if they contain sensitive words, and other content will be returned normally. |
result | Number | 0: Pass, 1: Recommended for review, 2: Fail |
tages | json array | Classified information |
wordList | json array | List of sensitive words |
tags:
Field name | Type | Description |
---|---|---|
tag | Number | Classified information: 100: politics, 110: violence, 120: prohibited, 130: eroticism, 150: advertisement, 160: insults, 170: Hate speech, 180: Minor protection, 190: sensitive hot spots,410:Irregular Emoticons, 420:Nickname,300:advertising law,220:private transaction,900: other, 999: customization |
tagName | String | Detect first-level type names for text hits |
tagNameEn | String | Detect first-level type names for text hits(English) |
level | Number | Classification level,0:Normal,1:Suspected,2:Abnormal |
confidence | Number | confidence,between 0 and 100,oney when tag=150,confidence is not null; The higher the value, the more likely to be an advertisement |
subTags | json object | Secondary classification of sensitive information |
subTags:
Field name | Type | Describe |
---|---|---|
subTag | Number | Secondary classification information reference Classification Code |
subTagName | String | Detect secondary type names for text hits |
subTagNameEn | String | Detect secondary type names for text hits(English) |
wordList | array of strings | hit details |
-
Response example :
JSON response
{ "errorCode": 0, "textSpam": { "content": "****", "result": 2, "tags": [ { "tag": 160, "level": 2, "tagName": "辱骂", "tagNameEn": "insults", "subTags": [ { "subTag": 160001, "subTagName": "谩骂人身攻击", "subTagNameEn": "insults and personal attacks", "wordList": [ "fuck" ] } ] } ], "wordList": [ "fuck" ] }, "taskId": "c01b212f-3e31-4a2e-8346-b6f6ce3a3456", "startTime": 1660103900367, "endTime": 1660103900374 }
错误码:
HTTP Status Code | Error code | Error message | Cause of error |
---|---|---|---|
200 | 0 | This field will be ommitted | |
429 | 1104 | Out of Rate Limit | Frequency of requests exceeds the limit |
405 | 1004 | Method Not Allowed | The http request method can only be get or post. If it is post, header must have content-type,and its value should be application/x-www-form-urlencoded |
400 | 1002 | API Not Found | The corresponding API was not found according to the path of the http request. |
400 | 1003 | Bad Request | Parsing request failed |
400 | 2000 | Missing Parameter | Missing parameters content |
400 | 2102 | Input Too Long | The length of the parameter content exceeds the limit. |
401 | 1102 | Unauthorized Client | Parameter appId invalid |
401 | 1106 | Missing Access Token | Missing Authorization |
401 | 1107 | Invalid Token | Incorrect Authorization |
401 | 1108 | Expired Token | Expired timeStamp |
401 | 2000 | Missing Parameter | Missing timeStamp |
401 | 2001 | Invalid Parameter | TimeStamp format error |