User Word Registration
This API is for importing and exporting user-registered words.
Retrieving User-Registered Words
You can retrieve a list of registered words in JSON format.
Endpoint
GET https://acp-api.amivoice.com/profilewords/<dgn>/<pid>
Authentication
Please specify the APPKEY in the Authorization header.
Authorization: Bearer {APPKEY}
Request Parameters
Parameter Name | Parameter Name | Notes |
|---|---|---|
| dgn | Connection Engine Name | Specify a connection engine name such as -a-general. For available values, please see List of Speech Recognition Engines. Set as a path parameter. |
| pid | Profile ID | Any string. Set as a path parameter. |
| adf | Audio Data Format | Specify either 16k or 8k. If not specified, it defaults to 16k. Although some speech recognition engines support multiple sampling rates, word registration treats 8k and 16k as different engines, so you need to specify one. Set as a query parameter. |
The adf parameter is currently not supported. It will be supported soon. Please note that word registration for 8k engines is not available.
Retrieving Profile List
You can retrieve a list of profiles in JSON format.
Endpoint
GET https://acp-api.amivoice.com/profilewords/<dgn>/
Authentication
Please specify the APPKEY in the Authorization header.
Authorization: Bearer {APPKEY}
Request Parameters
Parameter Name | Parameter Name | Note |
|---|---|---|
| dgn | Connection engine name | Specify the connection engine name such as -a-general. For available values, please see List of Speech Recognition Engines. Set as a path parameter. |
| adf | Audio data format | Specify either 16k or 8k. If not specified, it defaults to 16k. Although some speech recognition engines support multiple sampling rates, word registration is treated as different engines for 8k and 16k, so you need to specify one or the other. Set as a query parameter. |
"Retrieving Profile List" is currently not supported. It will be supported soon.
Registering User Words
You can replace user-registered words for the specified speech recognition engine and profile ID.
Endpoint
POST https://acp-api.amivoice.com/profilewords/<dgn>/<pid>
Authentication
Please specify the APPKEY in the Authorization header.
Authorization: Bearer {APPKEY}
Request Parameters
Parameter Name | Parameter Name | Notes |
|---|---|---|
| dgn | Connection Engine Name | Specify a connection engine name such as -a-general. For available values, please see [List of Speech Recognition Engines] (/amivoice-api/manual/engines#list). Set as a path parameter. |
| pid | Profile ID | Any string. Set as a path parameter. |
| adf | Audio Data Format | Specify either 16k or 8k. If not specified, it defaults to 16k. Although some [speech recognition engines] (/amivoice-api/manual/engines#list) support multiple sampling rates, word registration treats 8k and 16k as different engines, so you need to specify one. Set as a query parameter. |
Content Type
Content-Type: application/json
Request Body
Field Name | Description | Notes |
|---|---|---|
profilewords | Word Registration Information | Specify the words you want to register in array format |
profilewords[].written | Notation | Specify the notation of the word |
profilewords[].spoken | Pronunciation | Specify the pronunciation of the word |
profilewords[].classname | Class Name | Specify the class name. This can be omitted if not set. |
Example
{
"profilewords": [
{
"written": "AMI",
"spoken": "あみ",
},
{
"written": "AOI",
"spoken": "あおい",
},
{
"written": "躑躅森",
"spoken": "つつじもり",
"classname": "名前"
}
]
}
Response
On Success
HTTP Status Code: 200 OK
Response Body
Field Name | Description | Notes |
|---|---|---|
profilewords | Word Registration Information | Registered words are obtained in array format |
profilewords[].written | Notation | The notation of the word is obtained |
profilewords[].spoken | Pronunciation | The pronunciation of the word is obtained |
profilewords[].classname | Class Name | The class name is returned. It is omitted if not set |
Example
{
"profilewords": [
{
"written": "AMI",
"spoken": "あみ",
},
{
"written": "AOI",
"spoken": "あおい",
},
{
"written": "躑躅森",
"spoken": "つつじもり",
"classname": "名前"
}
]
}
On Failure
HTTP Status Code: Other than 200
Response Body
Field Name | Description | Notes |
|---|---|---|
| code | Error Code | Code indicating the type of error |
| message | Error Message | Text explaining the details of the error content |
Error Codes and Error Messages
HTTP Status Code | Response Body | Error Situation |
|---|---|---|
| 404 Not Found | {"code":"?","message":"missing dictation grammar file name"} | When the dictation grammar file name <dgn> is not specified |
| 404 Not Found | {"code":"?","message":"missing profile id"} | When the profile ID <pid> is not specified |
| 405 Method Not Allowed | {"code":"?","message":"POST method is not allowed"} | When POST is specified |
| 400 Bad Request | {"code":"-","message":"missing request body"} | When a POST method is requested but no request body is specified |
| 400 Bad Request | {"code":"-","message":"invalid request body (<optionalMessage>)"} | When the request body is not valid JSON |
| 422 Unprocessable Entity | {"code":"-","message":"missing profile words"} | When the JSON specified in the request body is not in the expected format |
| 422 Unprocessable Entity | {"code":"-","message":"invalid written: <written>"} | When the notation/pronunciation/word class in the JSON specified in the request body is incorrect |
| 422 Unprocessable Entity | {"code":"-","message":"invalid written: <spoken>"} | When the notation/pronunciation/word class in the JSON specified in the request body is incorrect |
| 422 Unprocessable Entity | {"code":"-","message":"invalid written: <className>"} | When the notation/pronunciation/word class in the JSON specified in the request body is incorrect |
| 401 Unauthorized | {"code":"-","message":"can't verify service authorization"} | When authentication of the APPKEY (service authentication key string) fails |
| 401 Unauthorized | {"code":"-","message":"service authorization has expired: <expirationTime> (<expiresIn>)"} | When authentication of the APPKEY (service authentication key string) fails |
| 500 Internal Server Error | {"code":"?","message":"unexpected exception occurred (<optionalMessage>)"} | When an unexpected exception occurs |
Example
{
"code":"?",
"message":"missing dictation grammar file name"
}