Gowajee API
  • Introduction
  • Getting Started
  • Speech to text
    • Models
    • Limitations
      • Rate Limit
      • Astro Model Limitation
      • Word Timestamp
      • Words Boosting
      • Audio Duration Limit
      • Handling Large Files
      • HTTP Multipart/Form-Data
      • Supported File Formats
    • Transcription
      • Synchronous API (Request-Response)
      • Asynchronous API (Webhook Notification)
        • Checking Job Status
    • Real-time Transcription
    • Speaker Separation
      • Multichannel
      • Diarization
    • Words Boosting
    • Raw Audio Format
  • Pricing
Powered by GitBook
On this page
  • Register Webhook Endpoint
  • Workflow
  • Request
  • Supported Models
  • Headers
  • Query String
  • Body Parameters
  • Immediate Response
  • Webhook Result
  • Success Response:
  • Failure Response:
  • Notes
  • Webhook Security
  • Receiving Transcription Results
  1. Speech to text
  2. Transcription

Asynchronous API (Webhook Notification)

PreviousSynchronous API (Request-Response)NextChecking Job Status

Last updated 8 months ago

This section describes the Asynchronous HTTP API for Gowajee's speech-to-text (STT) service using webhook notifications. With this API, clients send a request with a webhookId to the server and receive an immediate response indicating the job status. Once the STT processing is complete, the server sends the result to the specified webhook endpoint via an HTTP POST request.

Register Webhook Endpoint

Before using Asynchronous API you need to register the webhook endpoint on

This ensures that Gowajee can send the transcription results to the endpoint you provide via the HTTP POST method.

Workflow

  1. Send Request: The client sends an HTTP request to the Gowajee API endpoint with the webhookId and audioData.

  2. Immediate Response: The server responds immediately with the job status and IDs.

  3. Processing: The server processes the audio data using the specified STT model.

  4. Webhook Notification: Upon completion, the server sends the result to the webhook endpoint that has been sent as a webhookId in the request.


Request

  • Method: POST

  • Endpoint: https://api.gowajee.ai/v1/speech-to-text/${MODEL}/transcribe/async?webhookId=${YOUR_WEBHOOK_ID}

Supported Models

Model
Value

Pulse

pulse

Cosmos

cosmos

Astro

astro

Headers

Name
Type
Required
Description

x-api-key

string

Yes

An API key to access the service

Query String

Name
Type
Required
Description

webhookId

string

Yes

Body Parameters

Name
Type
Required
Description

audioData

string

Yes

Content of Audio data in base64 encoded string format or multipart/form-data

getSpeakingRate

boolean

No

Get speaking rate (syllables per second)

getWordTimestamps

boolean

No

boostWordList

string[]

No

boostScore

integer

No

multichannels

boolean

No

diarization

boolean

No

numSpeakers

integer

No

minSpeakers

integer

No

Minimum number of speakers in your audioData

maxSpeakers

integer

No

refSpeakers

RefSpeaker[]

No

The 4-5 seconds of speaker voice for diarization.

sampleRate

integer

sampleWidth

integer

channels

integer

Immediate Response

{
  "status": "IN_QUEUE",
  "jobId": "baf1c6a1-a8ad-4123-91ef-2379443f42d2",
  "webhookId": "9ed5f94e-7e30-447e-bb84-5ef194222396"
}

Webhook Result

Once the STT processing is complete, the server sends the result to the webhook endpoint via an HTTP POST request.

Success Response:

{
  "type": "ASR_PULSE",
  "amount": 4.517,
  "output": {
    "results": [
      {
        "transcript": "มีคำถามเพิ่มเติมเกี่ยวกับความเสี่ยงในการลงทุนในกองทุนรวมนี้หรือไม่คะ",
        "startTime": 0,
        "endTime": 4.517
      }
    ],
    "duration": 4.517,
    "version": "2.2.0"
  },
  "webhookId": "9ed5f94e-7e30-447e-bb84-5ef194222396",
  "jobId": "baf1c6a1-a8ad-4123-91ef-2379443f42d2"
}

Failure Response:

{
  "status": "FAILED",
  "jobId": "baf1c6a1-a8ad-4123-91ef-2379443f42d2",
  "webhookId": "9ed5f94e-7e30-447e-bb84-5ef194222396",
  "message": "error message"
}

Notes

  • Immediate Response: The immediate response indicates that the job is queued for processing.

  • Webhook Notification: The webhook endpoint will receive either a successful response with the transcription results or a failure response if the STT processing fails.

By using the asynchronous API, you can handle longer audio files or higher volumes of transcription requests without having to wait for immediate processing.


Webhook Security

To ensure that your webhook endpoint is being called by Gowajee, you can implement additional security measures. The simple method is to add a query parameter, such as a token, to your webhook URL and verify it on your server.


Receiving Transcription Results

Once your job has been completed, Gowajee will send the transcription results to the webhook endpoint via an HTTP POST request.

Ensure your server is set up to handle these requests and process the incoming data accordingly.

Example:

const express = require('express');
const app = express();
const port = 3000;

app.use(express.json());

// Create a new item
app.post('/webhook/gowajee', (req, res) => {
  const query = req.query;
  const token = query.token;
  // TODO: Verify token
  const result = req.body;
  // TODO: Manage result
  res.status(200).send(true);
});

app.listen(port, () => {
  console.log(`Server is running on http://localhost:${port}`);
});

The ID of the webhook registered on the

Get timestamps for all the words in the transcription. Available only for the model.

Add specific words to increase the chance of these words appearing in results. Available only for the and models. Read more .

The number between 1 to 20 to increase the chance of boostWordList appearing in results. Available only for the and models. Read more .

Set multichannels=true if your audioData is multichannel audio. This is useful for audio with multiple speakers with multiple channels. Read more .

Set diarization=true if you want to perform speaker separation with diarization feature. Read more .

Number of speakers in your audioData Read more .

Read more .

Maximum number of speakers in your audioData Read more .

Users can upload multiple audio files, and the service will assume each file corresponds to a different speaker. If the service cannot determine which speaker corresponds to a particular transcription, it will label the speaker as 'unknown’. Read more .

No (Required for )

The sample rate represents the number of samples of audio carried per second, measured in Hertz (Hz). It defines how many data points of audio are sampled in one second. Read more about .

No (Required for )

The sample width, also known as bit depth, determines the number of bits used to represent each audio sample. It directly affects the dynamic range of the audio signal (1 means 8-bit, 2 means 16-bit, etc). Read more about .

No (Required for )

Channels refer to the number of independent audio signals or paths in an audio file. Common values are mono (1 channel) and stereo (2 channels). Read more about .

webhookId: The webhookId is the identifier of the webhook endpoint that the user needs to register on .

Gowajee Console.
Gowajee Console
Gowajee Console
Pulse
Pulse
Cosmos
details
Pulse
Cosmos
details
details
details
details
details
details
details
Raw Audio Format
Raw Audio Format
Raw Audio Format
Raw Audio Format
Raw Audio Format
Raw Audio Format