Skip to main content

API Key Issuance

We provide an endpoint for issuing API Keys. You can issue an API Key using the service ID and service password listed on MyPage. Additionally, you can issue another API Key using an API Key that was generated with the "Issuable" setting on MyPage.

  • An API key is a service authentication key string for applications to use the AmiVoice API speech recognition service.
  • You can set an expiration date and time based on the issue date and validity period, and allowed IP addresses as needed.

Endpoint

POST https://acp-api.amivoice.com/issue_service_authorization

Request

Request Parameters

Parameter Name
Required
Description
sid*1Specify the Service ID displayed in the connection information on MyPage.
Do not specify sid if you are specifying an API key in the authorization.
spw*1Specify the Service Password displayed in the connection information on MyPage.
Do not specify spw if you are specifying an API key in the authorization.
authorization*2Specify the API key issued with the "Issuable" setting on MyPage. Please specify this in the Authorization header.
If using authorization, do not specify sid and spw.
epiExpiration time. Specifies the validity period of the issued API key. If omitted, the default value of 30000 (30 seconds) will be applied.
ipaSource IP Address. You can restrict the client IP addresses that can use the API key
  • (*1) Required if authorization is not specified.
  • (*2) Required if sid and spw are not specified.
note

The service password is different from the password used to log in to MyPage.

Expiration time

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 API key string.

On Failure

  • If the Authorization header does not start with Bearer

Returns status code 400 with the following error message:

Invalid Authorization Header
  • If the API key specified in authorization is incorrect

Authentication of the API key fails, and returns status code 400 with the following error message:

Invalid appkey
  • If the API Key specified in authorization is not set to "Issuable" or is disabled

Unable to retrieve the service password using the API Key, and returns status code 400 with the following error message:

Dont issue appkey
  • If there is no response

Required items may not have been specified, so please check the parameters.

caution

Even if the Service ID or Service Password is incorrect, an API key will be issued. If you use this invalid API key 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, it will return the following error:

{
"code":"-",
"message":"received illegal service authorization"
}

In case of WebSocket interface

If either the Service ID or Service Password is incorrect, it will return the following error:

s can't validate service authorization