Logo
他のインターフェース

NG単語 API

Create Forbidden Word Library

Basic Information

Endpoint: /forbidden_words

Method: POST

API Description: Upload a forbidden word list file to create a forbidden word dictionary.

Forbidden Word List File Format

A UTF-8 encoded text file with one forbidden word per line, each line not exceeding 10 characters, and no more than 10,000 lines. A total of 200 forbidden word dictionaries can be created.

File Example:

徳川家康
豊臣秀吉
織田信長

Request Parameters

Body (form-data)

NameTypeRequiredDescriptionDefault Value
namestringNoName of the forbidden word dictionaryNone
filefileYesSensitive word list file (UTF-8 encoded TXT format)Required
lang_typestringYesLanguage codeRequired

Response Parameters

NameTypeDescription
statusstringStatus code
messagestringStatus code description
dataobjectData

Request Example

curl -X POST '127.0.0.1:7100/forbidden_words' \
-F 'name=人物' \
-F 'file=@name.txt' \
-F 'lang_type=ja-JP'

Response Example

{
    "status": "00000",
    "message": "success",
    "data": "FW43DA3B90" // data is the forbidden word dictionary
}

Forbidden Word Information List

Basic Information

Endpoint: /forbidden_words

Method: GET

API Description: Retrieve information about all forbidden word dictionaries.

Response Parameters

NameTypeDescription
statusstringStatus code
messagestringStatus code description
dataobject[]Data
├─ idstringForbidden word ID
├─ namestringName of the forbidden word dictionary
├─ lang_typestringLanguage code
├─ amountintNumber of forbidden words
├─ update_timestringLast update time

Request Example

curl -X GET '127.0.0.1:7100/forbidden_words'

Response Example

{
    "status": "00000",
    "message": "success",
    "data": [
        {
            "id": "FW43DA3B90",
            "name": "人物",
            "lang_type": "ja-JP",
            "amount": 12,
            "update_time": "2022-01-19 13:14:15"
        }
    ]
}

Delete Forbidden Word Dictionary

Basic Information

Endpoint: /forbidden_words/{forbidden_words_id}

Method: DELETE

API Description: Delete the forbidden word dictionary with the specified ID.

Response Parameters

NameTypeDescription
statusstringStatus code
messagestringStatus code description
dataobjectData

Request Example

curl -X DELETE '127.0.0.1:7100/forbidden_words/FW43DA3B90'

Response Example

{
    "status": "00000",
    "message": "success",
    "data": null
}

Delete Forbidden Word Dictionary

Basic Information

Endpoint: /forbidden_words/{forbidden_words_id}

Method: DELETE

API Description: Delete the forbidden word dictionary with the specified ID.

Response Parameters

NameTypeDescription
statusstringStatus code
messagestringStatus code description
dataobjectData

Request Example

curl -X DELETE '127.0.0.1:7100/forbidden_words/FW43DA3B90'

Response Example

{
    "status": "00000",
    "message": "success",
    "data": null
}

Update Forbidden Word Dictionary

Basic Information

Endpoint: /forbidden_words/{forbidden_words_id}

Method: PUT

Interface Description: Modify the name or the list of forbidden words in the forbidden word dictionary.

Request Parameters

Body (form-data)

NameTypeRequiredDescriptionDefault Value
namestringNoName of the forbidden word dictionaryNone
filefileNoForbidden word list fileNone

Response Parameters

NameTypeDescription
statusstringStatus code
messagestringStatus code description
dataobjectData

Request Example

  1. Modify the Name of the Forbidden Word Dictionary
curl -X PUT '127.0.0.1:7100/forbidden_words/FW43DA3B90' \
-F 'name=NewName'
  1. Update the Forbidden Word List File
curl -X PUT '127.0.0.1:7100/forbidden_words/FW43DA3B90' \
-F 'file=@new.txt'

Response Example

{
    "status": "00000",
    "message": "success",
    "data": "FW43DA3B90"
}

Get Forbidden Word Dictionary Information

Basic Information

Endpoint: /forbidden_words/{forbidden_words_id}

Method: GET

API Description: Retrieve information for the specified forbidden word dictionary ID.

Response Parameters

NameTypeDescription
statusstringStatus code
messagestringStatus code description
dataobjectData
├─ idstringForbidden word dictionary ID
├─ namestringForbidden word dictionary name
├─ lang_typestringLanguage code
├─ filestringBase64 encoded forbidden word file (UTF-8 encoded TXT)
├─ amountintNumber of forbidden words
├─ update_timestringLast update time

Request Example

curl -X GET '127.0.0.1:7100/forbidden_words/FW43DA3B90'

Response Example

{
    "status": "00000",
    "message": "success",
    "data": {
            "id": "FW43DA3B90",
            "name": "newName",
            "lang_type": "ja-JP",
            "file": "<Base64 encoded content>",
            "amount": 12,
            "update_time": "2021-11-29 13:14:15"
        }
}