The Text Abusing Detection API is an API that detects and verifies abuse (prohibited words, spam advertisements) in text.

Preparation

Check if you have access to the Hive Console > AI Services > Abuse Detection > Chat Abusing Detection menu, and if not, refer to the Hive Console Permission Administration Guide to obtain menu access rights. Register a new project in Chat Abusing Detection.

Determining if Text is Abusive

After sending the text, it determines whether the text is spam advertising or contains prohibited words, and then returns the results.

Request URL

LIVE URL https://tads.withhive.com/cads2/send-text-data
Sandbox URL https://sandbox-tads.withhive.com/cads2/send-text-data
HTTP Method POST
Content-Type application/json

Request Body

Field Name Description Type Required
project_key Project Key String Y
text_log Text information Object Y

text_log

Field Name Description Type Required
text_array Array of objects containing the text and the time the text was sent Array(Object) Y
text_count Number of objects in text_array Integer Y

Object in text_array

Field Name Description Type Required
time_stamp Time the text was sent (UTC-based ISO format time string, example: 2024-01-30T10:35:49.95457+09:00) String Y
text_info A string encrypted with AES256 using the encryption key obtained from the Hive Console from a JSON object. The maximum size is 5KB. For more details on the encryption method, refer to the example code. String Y

text_info JSON Object

Create a JSON object according to the format below, and then encrypt it with AES256 to form the text_info string.

Field Name Description Type Required
user_id User’s unique ID number String Y
lang_code Language code (ISO 639-1)

  • Korean: ko
  • English: en
  • Japanese: ja
  • Simplified Chinese: zh-hans
  • Traditional Chinese: zh-hant
  • Spanish: es
  • Russian: ru
  • German: de
  • French: fr
  • Portuguese: pt
  • Italian: it
  • Thai: th
  • Indonesian: id
  • Turkish: tr
  • Malaysian: ms
  • Vietnamese: vi
String Y
text Text to check for abusing String Y
text_type If the text is chat text, it falls into one of the 3 chat formats below.

  • “chat_party”: Party chat
  • “chat_guild”: Guild chat
  • “chat_whisper”: Whisper
String N
room_num If the text is chat text, this is the chat room number. String N
channel_info If the text is chat text, this is the chat channel information. String N

Response

Field Name Description Type
result_code Response code String
result_text Description of the response code String
result_array Array containing detection results Array(Object)

result_array

Field Name Description Type
tads_result Detection result Object
text_result Result of applying masking to the original text based on the original text and the detection result Object

tads_result

Field Name Description Type
forbidden_yn Whether forbidden words were detected (0: No forbidden words found in the text, 1: Forbidden words found in the text) String
spam_yn Whether the text is detected as spam (0: Not detected as spam, 1: Detected as spam) String
aug_yn Whether the text is processed in a batch (0: Not batch processed, 1: Batch processed) String
long_yn Whether the text is a long string, which means that if it is over 5,000 characters the detection algorithm cannot be run on the the text (0: Less than 5,000 characters, 1: More than 5,000 characters) String
text_result
Field Name Description Type
text The text to check for abusing String
masking_text The text with masking applied (text will be identical if no masking settings have been made in the Hive console or if tads_result.forbidden_yn value is 0) String

Response Code

Code Text Remarks
200 “success” Success
500 “Incorrect request” There is an error in the request. Please check if the Request URL and Request Body are correct.
501 “Incorrect Data Count” The count of the passed text does not match. The value of text_count and the length of text_array must match.
502 “Incorrect Secret Key” The secret key value is incorrect. Please check the project secret key in Project Management.
503 “Unregistered ProjectKey” The project key value is incorrect. Please check the project key of the project in Project Management.
506 “System Error” This is an internal error, such as a network error. Please call the API again after some time.
507 “The size of message is too large” The size of the text is too large. The maximum size of text_array is 5KB. Please reduce the size of the message.

Request Example

Python

Java

Response Example