Note: If you have your own app/backend, and you want to integrate the API gateway as a service, we recommend you to read through Integration, to help you reduce user management part and delegate to the API gateway instead
Login
POSThttps://gateway.speechlab.sg/auth/login
This endpoint allows you to login and get an account token
"statusCode": 400,
"message": [
"password must be longer than or equal to 6 characters",
"password should not be empty",
"password must be a string"
],
"error": "Bad Request"
}
After successfully register your account, there will be an email sent to your inbox to verify your email address. You need to click into verification link which is sent along with the email.
Note: If you can provide audioType and audioTrack that best describe your audio file, we'll try to use our best-fit model to give you better result.
After request successfully, in response returned, you'll see a field name _id, this is ID of your speech, we also call it SpeechID. Notice this for further requests.
About webhook: an audio may take long time to decode (depends on its duration, type,...), and the processing time is not exact, not same even if you submit 2 identical jobs. So instead of keep calling us to get the status, You can provide your HTTP endpoint in webhook field and we'll send your audio's status, and when status is done you just need to call our endpoint to download your transcription
About queue: a queue is where your job will be running in, each queue will have some workers to pick up your job and process, by default your job will be submitted to normal queue and this queue is shared among others, because of that sometimes your job will have to be queued until our workers available. If you want to have dedicated queue to not share with others, contact our support to get in detail.
Get job status
GEThttps://gateway.speechlab.sg/speech/:id
This api is to retrieve speech's status. If you mean to call this api many times to get speech's status, consider passing webhook when submitting your job as described in above section
{
"statusCode": 400,
"message": [
"email must be longer than or equal to 6 characters",
"email must be an email"
],
"error": "Bad Request"
}
{
"statusCode": 404,
"message": "Email not found or code is incorrect",
"error": "Not Found"
}
{
"statusCode": 406,
"message": "New passwords are not matched each other",
"error": "Not Acceptable"
}
Send verification email
POSThttps://gateway.speechlab.sg/auth/verify
Verification email is sent right after account registration, and will be valid for 12 hours. This api endpoint is used in case you want to send new verification email
Headers
{
"message": "Please check your inbox for verification email"
}
{
"statusCode": 422,
"message": "Account has been verified before"
}
Create an application
POSThttps://gateway.speechlab.sg/applications
This endpoint is used to create a third-party application that make uses of Gateway APIs.
Note: if success, app secret will only be shown once, be sure to save it somewhere privately
Headers
Request Body
{
"_id": "5f8d581e87bf680b226d3cc1", // App ID
"name": "Test App",
"key": "5f8d581e87bf680b226d3cc0", // Key ID (used to get public key to verify JWT token)
"createdAt": "2020-10-19T09:10:54.482Z",
"secret": "41d29bb4c52389441c1647764de94493c16a8c42e9529bdaa7502cccc7f111e7" // App secret
}
Get JWT Public Key
GEThttps://gateway.speechlab.sg/keys/:keyId
This endpoints return JWT public key, third party will use this key in order to verify JWT token generated from API gateway