Logo
他のインターフェース

単語登録 API

Create Hotwords Dictionary

Basic Information

Endpoint: /hotwords

Method: POST

API Description: Submit a list of hotwords to create a hotword dictionary. A total of 200 dictionaries can be created. Each hotword must not exceed 10 characters, and a single dictionary must not exceed 10,000 entries.

Request Parameters

Body (json)

NameTypeRequiredDescriptionDefault Value
namestringNoName of the hotword dictionaryNone
lang_typestringYesLanguage codeRequired
sample_rateintYesSampling rate (Hz)Required
wordslist<string>YesList of hotwordsRequired

Response Parameters

NameTypeDescription
statusstringStatus code
messagestringStatus code description
datastringHotword dictionary ID

Request Example

Each element in the list is a hotword entry.

curl -X POST '127.0.0.1:7100/hotwords' \
-H 'Content-Type: application/json' \
-d '{
    "name":"name",
    "lang_type":"ja-JP",
    "sample_rate":16000,
    "words":["桃太朗","ドルフィンボイス"]
}'

Response Example

{
    "status": "00000",
    "message": "success",
    "data": "HW50D67839" // data is the Hotwords ID
}

Delete Hotword Dictionary

Basic Information

Endpoint: /hotwords/{hotwords_id}

Method: DELETE

API Description: To delete the hotword dictionary with the specified ID. Only dictionaries that are not currently being used in Speech-to-Text requests can be deleted.

Request Example

curl -X DELETE '127.0.0.1:7100/hotwords/HW50D67839'

Response Parameters

NameTypeDescription
statusstringStatus code
messagestringStatus code description
dataobjectNone

Response Example

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

Retrieve Hotword Dictionary Information List

Basic Information

Endpoint: /hotwords

Method: GET

API Description: Retrieve information about all hotwords dictionaries.

Response Parameters

NameTypeDescription
statusstringStatus code
messagestringStatus code description
dataobject[]Data
├─ idstringHotword dictionary ID
├─ namestringname of the hotword dictionary
├─ lang_typestringLanguage code
├─ statusintStatus: -1 for training failed, 0 for training in progress, 1 for training completed
├─ sample_rateintSampling rate
├─ update_timestringLast update time

Request Example

curl -X GET '127.0.0.1:7100/hotwords'

Response Example

{
    "status": "00000",
    "message": "success",
    "data": [
        {
            "id": "HW50D67839",
            "name": "name",
            "lang_type": "ja-JP",
            "status": 1,
            "sample_rate": 16000,
            "update_time": "2023-10-09 13:14:15"
        }
    ]
}

Retrieve Hotword Dictionary Information

Basic Information

Endpoint: /hotwords/{hotwords_id}

Method: GET

API Description: Retrieve information about the hotword dictionary with the specified ID.

Response Parameters

NameTypeDescription
statusstringStatus code
messagestringStatus code description
dataobjectData
├─ idstringHotword dictionary ID
├─ namestringname of the hotword dictionary
├─ lang_typestringLanguage code
├─ statusintStatus: -1 for training failed, 0 for training in progress, 1 for training completed
├─ sample_rateintSampling rate
├─ update_timestringLast modification time
├─ wordslist<string>List of hotwords
├─ amountintNumber of words contained

Request Example

curl -X GET '127.0.0.1:7100/hotwords/HW50D67839'

Response Example

{
    "status": "00000",
    "message": "success",
    "data": {
            "id": "HW50D67839",
            "name": "name",
            "lang_type": "ja-JP",
            "status": 1,
            "sample_rate": 16000,
            "update_time": "2021-11-29 13:14:15",
            "words": ["桃太朗","ドルフィンボイス"],
            "amount": 2
        }
}

Update Hotword Dictionary Information

Basic Information

Endpoint: /hotwords/{hotwords_id}

Method: PUT

API Description: Update the name or hotword list of an existing hotword dictionary. Note: When modifying the hotword list, all hotwords in the dictionary will be replaced by the new list. To append hotwords, please use the Add Hotword Entries API.

Request Parameters

Body (json)

NameTypeRequiredDescriptionDefault Value
namestringNoName of the hotword dictionaryNone
wordslist<string>NoList of hotwordsNone

Response Parameters

NameTypeDescription
statusstringStatus code
messagestringStatus code description
datastringHotword dictionary ID

Request Example

curl -X PUT '127.0.0.1:7100/hotwords/HW50D67839' \
-d '{
    "name":"name",
    "words":["桃太郎","ドルフィンボイス","ドルフィンエイアイ"]
}'

In the above example, both the name of the dictionary and the hotword list were updated. If you only need to modify the dictionary name, there is no need to pass the words parameter; likewise, if you only want to update the hotword list, there is no need to pass the name parameter.

Response Example

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

Add Hotword Entries

Basic Information

Ednpoint: /hotwords/{hotwords_id}

Method: POST

API Description: Append hotword entries to an existing hotword dictionary. Each entry must not exceed 10 characters, and a single dictionary must not exceed 10,000 entries.

Request Parameters

Body (json)

NameTypeRequiredDescriptionDefault Value
wordslist<string>YesList of hotwordsRequired

Response Parameters

NameTypeDescription
statusstringStatus code
messagestringStatus code description
dataintNumber of hotwords in the current dictionary

Request Example

curl -X POST '127.0.0.1:7100/hotwords/HW50D67839' \
-H 'Content-Type: application/json' \
-d '{
    "words":["豊臣秀吉","織田信長"]
}'

Response Example

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

Delete Hotword Entries

Basic Information

Endpoint: /hotwords/{hotwords_id}

Method: DELETE

API Description: Delete specified hotword entries from the hotword dictionary with the given ID. Note: When the request does not contain a request body, the entire hotword dictionary will be deleted.

Request Parameters

Body (json)

NameTypeRequiredDescriptionDefault Value
wordslist<string>YesList of hotwords to be deletedRequired

Response Parameters

NameTypeDescription
statusstringStatus code
messagestringStatus code description
dataintNumber of hotwords in the current dictionary

Request Example

curl -X DELETE '127.0.0.1:7100/hotwords/HW50D67839' \
-H 'Content-Type: application/json' \
-d '{
    "words":["豊臣秀吉","織田信長"]
}'

Response Example

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