Jobs

Submit Language Identification Job

Starts an asynchronous job to identify the most probable language in the audio. Audio can be specified in two ways, either by including a public url to the media via the source_config option or by uploading a local file as part of a multipart/form request.

SecurityAccessToken
Request
Request Body schema:

Language Identification Job Options

metadata
string or null (MetadataField) <= 512 characters

Optional metadata that was provided during job submission.

callback_url
string or null (CallbackUrlField) <= 1024 characters
Deprecated

Callback url provided by the user.

object or null

Replacement for callback_url that allows for optional authentication headers

delete_after_seconds
integer or null (DeleteAfterSecondsField) [ 0 .. 2592000 ]

Amount of time after job completion when job is auto-deleted. Present only when preference set in job request.

media_url
required
string (AudioAnalysisMediaUrlField) <= 2048 characters

The user input media url.

Responses
200

Language Identification Job Details

400

Bad Request

401

Request Unauthorized

413

Payload Too Large

post/languageid/v1/jobs
Request samples
{
  • "metadata": "sample user provided metadata",
  • "notification_config": {},
  • "delete_after_seconds": 1000000,
  • "source_config": {}
}
Response samples
application/json
{}

Get List of Language Identification Jobs

Gets a list of language identification jobs submitted within the last 30 days in reverse chronological order up to the provided limit number of jobs per call. Note: Jobs older than 30 days will not be listed. Pagination is supported via passing the last job id from a previous call into starting_after.

SecurityAccessToken
Request
query Parameters
limit
integer or null [ 0 .. 1000 ]
Default: 100

Limits the number of jobs returned, default is 100, max is 1000

starting_after
string or null

If specified, returns jobs submitted before the job with this id, exclusive (job with this id is not included)

Responses
200

List of Rev AI Language Identification Jobs

400

Bad Request

401

Request Unauthorized

get/languageid/v1/jobs
Request samples
/**
 * Requires libcurl
 */

$query = array(
  "limit" => "100",
  "starting_after" => "string"
);

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <YOUR_TOKEN_HERE>"
  ],
  CURLOPT_URL => "https://api.rev.ai/languageid/v1/jobs?" . http_build_query($query),
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "GET",
]);

$response = curl_exec($curl);
$error = curl_error($curl);

curl_close($curl);

if ($error) {
  echo "cURL Error #:" . $error;
} else {
  echo $response;
}
Response samples
application/json
[]

Get Language Identification Job By Id

Returns information about a language identification job.

SecurityAccessToken
Request
path Parameters
id
required
string

Rev AI API Job Id

Responses
200

Language Identification Job Details

401

Request Unauthorized

404

Job Not Found

get/languageid/v1/jobs/{id}
Request samples
/**
 * Requires libcurl
 */

const id = "YOUR_id_PARAMETER";
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <YOUR_TOKEN_HERE>"
  ],
  CURLOPT_URL => "https://api.rev.ai/languageid/v1/jobs/" . id,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "GET",
]);

$response = curl_exec($curl);
$error = curl_error($curl);

curl_close($curl);

if ($error) {
  echo "cURL Error #:" . $error;
} else {
  echo $response;
}
Response samples
application/json
{}

Delete Language Identification Job by Id

Deletes a language identification job. All data related to the job will be permanently deleted. A job can only be deleted once it's completed (either with success or failure).

SecurityAccessToken
Request
path Parameters
id
required
string

Rev AI API Job Id

Responses
204

Job was successfully deleted

401

Request Unauthorized

404

Job Not Found

409

Conflict

delete/languageid/v1/jobs/{id}
Request samples
/**
 * Requires libcurl
 */

const id = "YOUR_id_PARAMETER";
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <YOUR_TOKEN_HERE>"
  ],
  CURLOPT_URL => "https://api.rev.ai/languageid/v1/jobs/" . id,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "DELETE",
]);

$response = curl_exec($curl);
$error = curl_error($curl);

curl_close($curl);

if ($error) {
  echo "cURL Error #:" . $error;
} else {
  echo $response;
}
Response samples
application/problem+json
{
  • "title": "Authorization has been denied for this request",
  • "status": 401
}

Get Language Identification Result By Id

Returns the results for a completed language identification job.

SecurityAccessToken
Request
path Parameters
id
required
string

Rev AI API Job Id

Responses
200

Rev AI API Language Identification Result

401

Request Unauthorized

404

Job Not Found

409

Conflict

get/languageid/v1/jobs/{id}/result
Request samples
/**
 * Requires libcurl
 */

const id = "YOUR_id_PARAMETER";
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <YOUR_TOKEN_HERE>"
  ],
  CURLOPT_URL => "https://api.rev.ai/languageid/v1/jobs/" . id . "/result",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "GET",
]);

$response = curl_exec($curl);
$error = curl_error($curl);

curl_close($curl);

if ($error) {
  echo "cURL Error #:" . $error;
} else {
  echo $response;
}
Response samples
application/json
{
  • "top_language": "en",
  • "language_confidences": [
    ]
}