One-time APPKEY Issuance
We provide an endpoint for issuing a one-time APPKEY. You can issue a one-time APPKEY using the service ID and service password listed on your My Page.
- APPKEY is a service authentication key string for applications to use the AmiVoice API speech recognition service.
- One-time APPKEY is a service authentication key string with similar functionality to the [APPKEY] listed on My Page, but differs in that it has an expiration date and time based on the issue date and validity period.
Endpoint
POST https://acp-api.amivoice.com/issue_service_authorization
Request
Request Parameters
Parameter Name | Required | Description |
---|---|---|
sid | ● | Specify the Service ID displayed in the connection information on My Page |
spw | ● | Specify the Service Password displayed in the connection information on My Page |
epi | Expiration. Specifies the usage period for the one-time APPKEY to be issued. If omitted, 30000 (30 seconds) is set. | |
ipa | Source IP Address. You can restrict the client IP addresses that can use the one-time APPKEY |
The service password is different from the password used to log in to My Page.
Expiration
You can specify one of the following:
- A number. This will be the usage period in milliseconds.
- A string with units of 's' (seconds), 'm' (minutes), 'h' (hours), 'd' (days), 'w' (weeks). For example, you can specify:
5m 5 minutes
2h 2 hours
100d 100 days
- A string representing a time in the format
yyyy(/|-)mm(/|-)dd[( |T)hh:mm:ss[.sss][[ ](Z|(+|-)zz[[:]zz])]]
. For example, you can specify:
2021/06/30 Valid until 24:00:00 on June 30, 2021 (00:00:00 on July 1, 2021)
2021/07/00 Valid until 24:00:00 on June 30, 2021 (00:00:00 on July 1, 2021)
2021/05/15 12:05:30 Valid until 12:05:30 on May 15, 2021
Source IP Address
You can specify one of the following:
- An empty string
- A string representing multiple IPv4 CIDR format IP addresses separated by spaces or commas (,). For example, you can specify:
10.1.2.34
192.168.0.0/16
150.249.206.220 150.249.236.100/31
Response
On Success
Returns the one-time APPKEY string.
On Failure
Returns nothing. Required items may not have been specified, so please check the query parameters.
Even if the Service ID or Service Password is incorrect, a one-time APPKEY will be issued. If you use this invalid one-time APPKEY to connect to the speech recognition service, an authentication error will occur. The error message may vary depending on the interface.
In case of HTTP interface
If either the Service ID or Service Password is incorrect, one of the following errors will be returned depending on the timing:
{
/* ... omitted ... */
"code":"!","message":"failed to connect to recognizer server"
}
{
/* ... omitted ... */
"code":">","message":"failed to send audio data to recognizer server"
}
In case of WebSocket interface
If the Service ID is incorrect, the s
command will fail. In this case, the following error will be returned as the s
command response:
s can't connect to recognizer server
If the Service Password is incorrect for the Service ID, the s
command will succeed. However, when you actually send audio with the p
command, it will return an error as if speech recognition failed.
{
/* ... omitted ... */
"code":"!","message":"failed to connect to recognizer server"
}
Also, the following error will be returned for the p command:
p can't feed audio data to recognizer server