### VTT Output Format Example Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md Sample structure of the WebVTT file returned by the API. ```text WEBVTT - created by www.amberscript.com 1 00:00:00.449 --> 00:00:03.769 Hi, welcome to Amber script, in this short 2 00:00:03.869 --> 00:00:07.400 video, we would like to show you how you can use Amber script at its full 3 00:00:07.500 --> 00:00:10.189 potential. The first function we would like to show 4 00:00:10.289 --> 00:00:13.639 you is the edit function. This allows you to edit errors ``` -------------------------------- ### Example TEXT Output Format Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md The expected structure of the returned text content. ```text 00:00:00 Speaker 1: Hi, welcome to Amber script, in this short video, we would like to show you how you can use Amber script at its full potential. The first function we would like to show you is the edit function. This allows you to edit errors ``` -------------------------------- ### SRT Response Format Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md Example of the SRT file structure returned by the API. ```text 1 00:00:00,449 --> 00:00:03,769 Hi, welcome to Amber script, in this short 2 00:00:03,869 --> 00:00:07,400 video, we would like to show you how you can use Amber script at its full 3 00:00:07,500 --> 00:00:10,189 potential. The first function we would like to show 4 00:00:10,289 --> 00:00:13,639 you is the edit function. This allows you to edit errors ``` -------------------------------- ### Example JSON response Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md The structure of the response returned after a successful file upload. ```json { "jobStatus": { "jobId": "JOB_ID", "created": 82800000, "language": "en", "notes": null, "status": "OPEN", "nrAudioSeconds": 45, "transcriptionType": "translatedSubtitles", "filename": "file_name.mp3", "jobType": "perfect", "sourceJobId": "SOURCE_JOB_ID", // only present for translated subtitles jobs. "targetLanguage": "nl" // OPTIONAL, translatedSubtitles only } } ``` -------------------------------- ### Sample JSON Response Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md Example structure of the JSON returned by the export endpoint. ```json { "id": "5c9e45057103e464a4c6f477", "recordId": "RECORD_ID", "filename": "FILENAME", "startTimeOffset": 0.0, "speakers": [ { "spkid": "spk1", "name": "Speaker 1" } ], "segments": [ { "speaker": "spk1", "words": [ { "start": 0.45, "end": 1.08, "duration": 0.63000005, "text": "Hi,", "conf": 1.0, "pristine": true }, { "start": 1.11, "end": 1.65, "duration": 0.53999996, "text": "welcome", "conf": 1.0, "pristine": true }, { "start": 1.65, "end": 1.8, "duration": 0.14999998, "text": "to", "conf": 1.0, "pristine": true }, { "start": 1.8, "end": 2.1, "duration": 0.29999995, "text": "Amberscript", "conf": 0.65, "pristine": true } ] } ], "highlights": [] } ``` -------------------------------- ### Request Translated Subtitles Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md Examples for initiating a translated subtitle job using the /jobs/translatedSubtitles endpoint. ```java HttpResponse response=Unirest.post("https://api.amberscript.com/api/jobs/translatedSubtitles?sourceJobId=SOURCE_JOB_ID&targetLanguage=nl&apiKey=YOUR_API_KEY") .asString(); ``` ```javascript async function createTranslatedSubtitles() { const sourceJobId = 'SOURCE_JOB_ID'; const targetLanguage = 'nl'; const apiKey = 'YOUR_API_KEY'; const url = `https://api.amberscript.com/api/jobs/translatedSubtitles?sourceJobId=${sourceJobId}&targetLanguage=${targetLanguage}&apiKey=${apiKey}`; try { const response = await axios.post(url, {}, { headers: { 'content-type': 'application/json' } }); console.log(response.data); } catch (error) { console.error('Error:', error.response.data) } } ``` ```python import requests url = "https://api.amberscript.com/api/jobs/translatedSubtitles" querystring = {"sourceJobId":"SOURCE_JOB_ID","targetLanguage":"nl","apiKey":"YOUR_API_KEY"} payload = "" response = requests.request("POST", url, data=payload, params=querystring) print(response.text) ``` ```shell curl --request POST --url 'https://api.amberscript.com/api/jobs/translatedSubtitles?sourceJobId=SOURCE_JOB_ID&targetLanguage=nl&apiKey=YOUR_API_KEY' ``` -------------------------------- ### Retrieve glossaries via API Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md Examples for fetching a list of glossaries using different programming languages and tools. ```java HttpResponse response=Unirest.get("https://api.amberscript.com/api/glossary?apiKey=YOUR_API_KEY") .asString(); ``` ```javascript import fetch from 'node-fetch'; async function getGlossary() { const url = 'https://api.amberscript.com/api/glossary'; const queryParams = new URLSearchParams({ apiKey: 'YOUR_API_KEY' }); const options = { method: 'GET', headers: {'Content-Type': 'application/json'}, }; try { const response = await fetch(`${url}?${queryParams}`, options); const data = await response.json(); console.log(data); } catch (error) { console.error('Error:', error.response.data); } } ``` ```python import requests url = "https://api.amberscript.com/api/glossary" querystring = {"apiKey":"YOUR_API_KEY"} payload = "" response = requests.request("GET", url, data=payload, params=querystring) print(response.text) ``` ```shell curl --request GET --url 'https://api.amberscript.com/api/glossary?apiKey=YOUR_API_KEY' ``` -------------------------------- ### Upload a file using cURL Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md Command line example for uploading a file using the --form flag. ```shell curl --request POST --url 'https://api.amberscript.com/api/jobs/upload-media?transcriptionType=transcription&jobType=direct&language=nl&apiKey={{YOUR_API_KEY}}' --form file=@./my-file.mp3 ``` -------------------------------- ### Upload Media via URL in Python Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md Uses the requests library to send a POST request. Note that verify=False is used in this example. ```python import requests url = 'https://api.amberscript.com/api/jobs/upload-media-from-url' query_string = {"apiKey": "YOUR_API_KEY"} body = {"sourceUrl": "https://www.learningcontainer.com/wp-content/uploads/2020/05/sample-mp4-file.mp4", "jobType": "direct", "language": "nl", "transcriptionType": "transcription", "numberOfSpeakers": "2"} response = requests.post(url, verify=False, params=query_string, json=body) print(response.status_code) print(response.text) ``` -------------------------------- ### Update a glossary via API Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md Examples for updating a glossary using various programming languages and tools. ```java String body="{\n"+ " \"name\": \"Name of first glossary\",\n"+ " \"names\": [\n"+ " \"Test name one\",\n"+ " \"Test name two\"\n"+ " ],\n"+ " \"items\": [\n"+ " {\n"+ " \"name\": \"Item one name\",\n"+ " \"description\": \"description of item one\"\n"+ " },\n"+ " {\n"+ " \"name\": \"Item two name\",\n"+ " \"description\": \"description of item two\"\n"+ " }\n"+ " ]\n"+ "}"; HttpResponse response=Unirest.put("https://api.amberscript.com/api/glossary/GLOSSARY_ID?apiKey=YOUR_API_KEY") .header("Content-Type","application/json") .body(body) .asString(); ``` ```javascript async function updateGlossary() { const url = 'https://api.amberscript.com/api/glossary/GLOSSARY_ID'; const body = { "name": "Name of first glossary", "names": [ "Test name one", "Test name two" ], "items": [ { "name": "Item one name", "description": "description of item one" }, { "name": "Item two name", "description": "description of item two" } ] }; const queryParams = new URLSearchParams({ apiKey: 'YOUR_API_KEY' }); const options = { method: 'PUT', headers: {'Content-Type': 'application/json'}, body: JSON.stringify(body) }; try { const response = await fetch(`${url}?${queryParams}`, options); const data = await response.json(); console.log(data); } catch (error) { console.error('Error:', error.response.data); } } ``` ```python import requests url = "https://api.amberscript.com/api/glossary/GLOSSARY_ID" querystring = {"apiKey":"YOUR_API_KEY"} payload = "{\n" \ " \"name\": \"Name of first glossary\",\n" \ " \"names\": [\n" \ " \"Test name one\",\n" \ " \"Test name two\"\n" \ " ],\n" \ " \"items\": [\n" \ " {\n" \ " \"name\": \"Item one name\",\n" \ " \"description\": \"description of item one\"\n" \ " },\n" \ " {\n" \ " \"name\": \"Item two name\",\n" \ " \"description\": \"description of item two\"\n" \ " }\n" \ " ]\n" \ "}" headers = { 'Content-Type': 'application/json' } response = requests.request("PUT", url, data=payload, headers=headers, params=querystring) print(response.text) ``` ```shell curl --request PUT --url 'https://api.amberscript.com/api/glossary/GLOSSARY_ID?apiKey=YOUR_API_KEY' --header 'Content-Type: application/json' --data-raw '{ "name":"Name of first glossary", "names": [ "Test name one", "Test name two" ], "items":[ { "name":{{glossaryItem1Name}}, "description":{{glossaryItem1Description}} }, { "name":"{{glossaryItem2Name}}", "description":{{glossaryItem2Description}} } ] }' ``` -------------------------------- ### Glossary response structure Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md Example of the JSON object returned upon successful creation. ```json { "id": "5f686d068c996402a02bbb85", "userName": "YOUR_USERNAME", "name": "Name of first glossary", "names": [ "Test name one", "Test name two" ], "items": [ { "name": "Item one name", "description": "description of item one" }, { "name": "Item two name", "description": "description of item two" } ], "created": 1600679174451 } ``` -------------------------------- ### GET /jobs/export-vtt Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md Exports a finished transcription job to VTT format. ```APIDOC ## GET /jobs/export-vtt ### Description Exports a finished file to VTT format. ### Method GET ### Endpoint https://api.amberscript.com/api/jobs/export-vtt ### Parameters #### Query Parameters - **jobId** (string) - Required - The unique identifier for the job. - **maxCharsPerRow** (integer) - Optional - Integer between 30 and 45 which sets the maximum number of characters per row. Default: 42. - **maxNumberOfRows** (integer) - Optional - Integer between 1 and 2 which sets the maximum number of rows for each subtitle. Default: 2. - **maxScreenTimePerRowSeconds** (float) - Optional - Float which sets the maximum number of seconds given for each row of subtitles. Default: 2. ### Response #### Success Response (200) - **body** (string) - The VTT formatted content. ``` -------------------------------- ### GET /glossary Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md Retrieves a list of glossaries associated with the user account. Supports optional sorting parameters. ```APIDOC ## GET /glossary ### Description Retrieves a list of glossaries. The response includes details such as glossary ID, name, items, and creation timestamp. ### Method GET ### Endpoint https://api.amberscript.com/api/glossary ### Parameters #### Query Parameters - **apiKey** (string) - Required - Your API authentication key. - **sortBy** (string) - Optional - Field by which to sort the resulting list of glossaries (default: "created"). - **sortDirection** (string) - Optional - Sort order, either `DESC` or `ASC` (default: `DESC`). ### Response #### Success Response (200) - **id** (string) - The unique identifier of the glossary. - **userName** (string) - The username associated with the glossary. - **name** (string) - The name of the glossary. - **names** (array) - A list of associated names. - **items** (array) - A list of glossary items containing name and description. - **created** (number) - The timestamp of creation. #### Response Example [ { "id": "5f686d068c996402a02bbb85", "userName": "YOUR_USERNAME", "name": "Name of first glossary", "names": ["Test name one", "Test name two"], "items": [ {"name": "Item one name", "description": "description of item one"} ], "created": 1600679174451 } ] ``` -------------------------------- ### GET /jobs/export-txt Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md Export a finished transcription job to a text file format. ```APIDOC ## GET /jobs/export-txt ### Description Export a finished file to TEXT. ### Method GET ### Endpoint https://api.amberscript.com/api/jobs/export-txt ### Parameters #### Query Parameters - **jobId** (string) - Required - YOUR_JOB_ID - **includeTimestamps** (boolean) - Optional - Default: true - **includeSpeakers** (boolean) - Optional - Default: true - **highlightsOnly** (boolean) - Optional - Default: false - **maxCharsPerRow** (integer) - Optional - Sets the maximum number of characters per row. ### Response #### Success Response (200) - **body** (string) - The transcription content in TXT format. ``` -------------------------------- ### Retrieve Transcription Status Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md Examples for querying job status using different programming languages and tools. ```java HttpResponse response=Unirest.get("https://api.amberscript.com/api/jobs/status?jobId=JOB_ID&apiKey=YOUR_API_KEY") .asString(); ``` ```javascript async function fetchJobStatus() { const jobId = '6638de0ba17717297470040c'; const apiKey = 'YOUR_API_KEY'; const url = `https://api.amberscript.com/api/jobs/status?jobId=${jobId}&apiKey=${apiKey}`; try { const response = await axios.get(url, { headers: { 'Content-Type': 'application/json' } }); console.log(response.data); } catch (error) { console.error('Error:', error.response.data) } } ``` ```python import requests url = "https://api.amberscript.com/api/jobs/status" querystring = {"jobId":"JOB_ID","apiKey":"YOUR_API_KEY"} payload = "" response = requests.request("GET", url, data=payload, params=querystring) print(response.text) ``` ```shell curl --request GET --url 'https://api.amberscript.com/api/jobs/status?jobId=JOB_ID&apiKey=YOUR_API_KEY' ``` -------------------------------- ### GET /jobs/status Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md Retrieve the status of a specific transcription job by providing the jobId. ```APIDOC ## GET /jobs/status ### Description Retrieve the status of a specific job. ### Method GET ### Endpoint https://api.amberscript.com/api/jobs/status ### Parameters #### Query Parameters - **jobId** (string) - Required - The unique identifier of the job. - **apiKey** (string) - Required - Your API authentication key. ### Response #### Success Response (200) - **jobStatus** (object) - The status object containing job details. #### Response Example { "jobStatus": { "jobId": "JOB_ID", "created": 82800000, "language": "en", "status": "OPEN", "jobOptions": { "transcriptionStyle": "verbatim" }, "nrAudioSeconds": 45, "transcriptionType": "transcription", "filename": "file_name.mp3", "jobType": "direct", "sourceJobId": "SOURCE_JOB_ID", "targetLanguage": "nl", "notes": "job_notes" } } ``` -------------------------------- ### GET /jobs/export-stl Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md Exports a finished file to STL format. Note that this endpoint is deprecated. ```APIDOC ## GET /jobs/export-stl ### Description Export a finished file to STL. ### Method GET ### Endpoint /jobs/export-stl ### Parameters #### Query Parameters - **jobId** (string) - Required - YOUR_JOB_ID - **maxNumberOfRows** (integer) - Optional - Integer between 1 and 2 which sets the maximum number of rows for each subtitle. - **maxScreenTimePerRowSeconds** (float) - Optional - Float which sets the maximum number of seconds given for each row of subtitles. ### Response #### Success Response (200) - **downloadUrl** (string) - The URL to download the exported file. #### Response Example { "downloadUrl": "https://PROD-SERVER/ebu-stl/FILENAME?X-Amz-Algorithm=HASH_ALGORITHM&X-Amz-Date=CURRENT_DATE&X-Amz-SignedHeaders=host&X-Amz-Expires=TIME_TO_EXPIRATION&X-Amz-Credential=AMZ_CREDENTIAL&X-Amz-Signature=AMZ_SIGNATURE" } ``` -------------------------------- ### Export Job to JSON via Python Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md Uses the requests library to send a GET request with query parameters. ```python import requests url = "https://api.amberscript.com/api/jobs/export-json" querystring = {"jobId":"JOB_ID" "apiKey":"YOUR_API_KEY"} payload = "" response = requests.request("GET", url, data=payload, params=querystring) print(response.text) ``` -------------------------------- ### Export Job to STL Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md Use these examples to request an STL export for a specific job. Note that this endpoint is deprecated. ```java HttpResponse response=Unirest.get("https://api.amberscript.com/api/jobs/export-stl?jobId=JOB_ID&apiKey=YOUR_API_KEY") .asString(); ``` ```javascript var request = require("request"); var options = { method: 'GET', url: 'https://api.amberscript.com/api/jobs/export-stl', qs: {jobId: 'JOB_ID', apiKey: 'YOUR_API_KEY'} }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); }); ``` ```python import requests url = "https://api.amberscript.com/api/jobs/export-stl" querystring = {"jobId":"JOB_ID" "apiKey":"YOUR_API_KEY"} payload = "" response = requests.request("GET", url, data=payload, params=querystring) print(response.text) ``` ```shell curl --request GET --url 'https://api.amberscript.com/api/jobs/export-stl?jobId=JOB_ID&apiKey=YOUR_API_KEY' ``` -------------------------------- ### Export Job to TEXT via API Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md Examples for requesting a text export of a completed job using various programming languages and tools. ```java HttpResponse response=Unirest.get("https://api.amberscript.com/api/jobs/export-txt?jobId=JOB_ID&apiKey=YOUR_API_KEY") .asString(); ``` ```javascript async function exportTXT() { const jobId = 'JOB_ID'; const apiKey = 'YOUR_API_KEY'; const url = `https://api.amberscript.com/api/jobs/export-txt?jobId=${jobId}&apiKey=${apiKey}`; try { const response = await axios.get(url, { headers: { 'Content-Type': 'application/json' } }); console.log(response.data); } catch (error) { console.error('Error:', error.response.data); } } ``` ```python import requests url = "https://api.amberscript.com/api/jobs/export-txt" querystring = {"jobId":"JOB_ID" "apiKey":"YOUR_API_KEY"} payload = "" response = requests.request("GET", url, data=payload, params=querystring) print(response.text) ``` ```shell curl --request GET --url 'https://api.amberscript.com/api/jobs/export-txt?jobId=JOB_ID&apiKey=YOUR_API_KEY' ``` -------------------------------- ### Delete a glossary Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md Examples for deleting a specific glossary by its ID using different programming languages and tools. ```java HttpResponse response=Unirest.delete("https://api.amberscript.com/api/glossary/GLOSSARY_ID?apiKey=YOUR_API_KEY") .asString(); ``` ```javascript async function deleteGlossary() { const url = 'https://api.amberscript.com/api/glossary/6638e42835d0580edd5e35c2'; const queryParams = new URLSearchParams({ apiKey: 'YOUR_API_KEY' }); const options = { method: 'DELETE', headers: {'Content-Type': 'application/json'}, }; try { const response = await fetch(`${url}?${queryParams}`, options); const data = await response.text(); console.log(data); } catch (error) { console.error('Error:', error.response.data); } } ``` ```python import requests url = "https://api.amberscript.com/api/glossary/GLOSSARY_ID" querystring = {"apiKey":"YOUR_API_KEY"} payload = "" response = requests.request("DELETE", url, data=payload, params=querystring) print(response.text) ``` ```shell curl --request DELETE --url 'https://api.amberscript.com/api/glossary/GLOSSARY_ID?apiKey=YOUR_API_KEY' ``` -------------------------------- ### Get list of jobs Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md Retrieve a list of jobs, optionally filtered by status, type, or pagination parameters. ```java HttpResponse response=Unirest.get("https://api.amberscript.com/api/jobs?apiKey=YOUR_API_KEY") .asString(); ``` ```javascript async function listJobs() { const apiKey = 'YOUR_API_KEY'; const url = `https://api.amberscript.com/api/jobs?apiKey=${apiKey}`; try { const response = await axios.get(url, { headers: { 'Content-Type': 'application/json' } }); console.log(response.data); } catch (error) { console.error('Error:', error.response.data) } } ``` ```python import requests url = "https://api.amberscript.com/api/jobs" querystring = {"apiKey":"YOUR_API_KEY"} payload = "" response = requests.request("GET", url, data=payload, params=querystring) print(response.text) ``` ```shell curl --request GET --url 'https://api.amberscript.com/api/jobs?apiKey=YOUR_API_KEY' ``` -------------------------------- ### Export SRT via AmberScript API Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md Examples for requesting an SRT file export using various programming languages and tools. ```java HttpResponse response=Unirest.get("https://api.amberscript.com/api/jobs/export-srt?jobId=JOB_ID&apiKey=YOUR_API_KEY") .asString(); ``` ```javascript async function exportSRT() { const jobId = 'JOB_ID'; const apiKey = 'YOUR_API_KEY'; const url = `https://api.amberscript.com/api/jobs/export-srt?jobId=${jobId}&apiKey=${apiKey}`; try { const response = await axios.get(url, { headers: { 'Content-Type': 'application/json' } }); console.log(response.data); } catch (error) { console.error('Error:', error.response.data); } } ``` ```python import requests url = "https://api.amberscript.com/api/jobs/export-srt" querystring = {"jobId":"JOB_ID" "apiKey":"YOUR_API_KEY"} payload = "" response = requests.request("GET", url, data=payload, params=querystring) print(response.text) ``` ```shell curl --request GET --url 'https://api.amberscript.com/api/jobs/export-srt?jobId=JOB_ID&apiKey=YOUR_API_KEY' ``` -------------------------------- ### Export Job to JSON via Java Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md Uses the Unirest library to perform a GET request to the export endpoint. ```java HttpResponse response=Unirest.get("https://api.amberscript.com/api/jobs/export-json?jobId=JOB_ID&apiKey=YOUR_API_KEY") .asString(); ``` -------------------------------- ### Export Job to VTT via API Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md Examples for requesting a VTT export for a specific job ID using various programming languages and tools. ```java HttpResponse response=Unirest.get("https://api.amberscript.com/api/jobs/export-vtt?jobId=JOB_ID&apiKey=YOUR_API_KEY") .asString(); ``` ```javascript async function exportVTT() { const jobId = 'JOB_ID'; const apiKey = 'YOUR_API_KEY'; const url = `https://api.amberscript.com/api/jobs/export-vtt?jobId=${jobId}&apiKey=${apiKey}`; try { const response = await axios.get(url, { headers: { 'Content-Type': 'application/json' } }); console.log(response.data); } catch (error) { console.error('Error:', error.response.data); } } ``` ```python import requests url = "https://api.amberscript.com/api/jobs/export-vtt" querystring = {"jobId":"JOB_ID" "apiKey":"YOUR_API_KEY"} payload = "" response = requests.request("GET", url, data=payload, params=querystring) print(response.text) ``` ```shell curl --request GET --url 'https://api.amberscript.com/api/jobs/export-vtt?jobId=JOB_ID&apiKey=YOUR_API_KEY' ``` -------------------------------- ### GET /jobs Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md Retrieves a list of transcription jobs, with optional filtering by job ID, type, status, and pagination. ```APIDOC ## GET /jobs ### Description Get a list of jobs. ### Method GET ### Endpoint /jobs ### Parameters #### Query Parameters - **jobId** (string) - Optional - YOUR_JOB_ID - **jobType** (string) - Optional - Type of the job e.g. perfect. - **status** (string) - Optional - OPEN, ERROR or DONE. - **transcriptionType** (string) - Optional - Type of transcription e.g. transcription. - **page** (integer) - Optional - Page to be retrieved. Default: 0 - **pageSize** (integer) - Optional - Number of records to be retrieved for each page (maximum: 100). Default: 20 ### Response #### Success Response (200) - **jobs** (array) - List of job objects #### Response Example [ { "jobId": "5f686d2d8c996402a02bbb92", "created": 1600679213751, "language": "nl", "status": "DONE", "nrAudioSeconds": 59, "transcriptionType": "transcription", "filename": "test.mp4", "jobType": "perfect", "jobOptions": { "transcriptionStyle": "cleanread" }, "notes": null } ] ``` -------------------------------- ### GET /jobs/export-json Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md Exports a finished transcription job to JSON format. Requires a valid jobId and API key. ```APIDOC ## GET /jobs/export-json ### Description Exports a finished file to JSON format. ### Method GET ### Endpoint https://api.amberscript.com/api/jobs/export-json ### Parameters #### Query Parameters - **jobId** (string) - Required - The unique identifier of the job to export. - **apiKey** (string) - Required - The API key for authentication. ### Response #### Success Response (200) - **id** (string) - The job ID. - **recordId** (string) - The record ID. - **filename** (string) - The name of the file. - **startTimeOffset** (float) - The start time offset. - **speakers** (array) - List of speakers involved in the transcription. - **segments** (array) - List of transcription segments containing words and speaker information. - **highlights** (array) - List of highlights. #### Response Example { "id": "5c9e45057103e464a4c6f477", "recordId": "RECORD_ID", "filename": "FILENAME", "startTimeOffset": 0.0, "speakers": [ { "spkid": "spk1", "name": "Speaker 1" } ], "segments": [ { "speaker": "spk1", "words": [ { "start": 0.45, "end": 1.08, "duration": 0.63000005, "text": "Hi,", "conf": 1.0, "pristine": true } ] } ], "highlights": [] } ``` -------------------------------- ### GET /jobs/export-srt Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md Exports a finished transcription job to SRT format. This endpoint allows for optional configuration of subtitle formatting such as character limits and row constraints. ```APIDOC ## GET /jobs/export-srt ### Description Export a finished file to SRT. ### Method GET ### Endpoint /jobs/export-srt ### Parameters #### Query Parameters - **jobId** (string) - Required - YOUR_JOB_ID - **maxCharsPerRow** (integer) - Optional - Integer between 30 and 45 which sets the maximum number of characters per row. Default: 42 - **maxNumberOfRows** (integer) - Optional - Integer between 1 and 2 which sets the maximum number of rows for each subtitle. Default: 2 - **maxScreenTimePerRowSeconds** (float) - Optional - Float which sets the maximum number of seconds given for each row of subtitles. Default: 2 ### Response #### Success Response (200) - **body** (string) - The SRT formatted subtitle content. ``` -------------------------------- ### Deploy documentation manually Source: https://github.com/amberscript/api-docs/blob/master/README.md Run this script locally to trigger a manual deployment of the documentation site. ```bash $ ./deploy.sh ``` -------------------------------- ### Create a glossary using Java Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md Uses the Unirest library to send a POST request with a JSON body. ```java String body="{\n"+ " \"name\": \"Name of first glossary\",\n"+ " \"names\": [\n"+ " \"Test name one\",\n"+ " \"Test name two\"\n"+ " ],\n"+ " \"items\": [\n"+ " {\n"+ " \"name\": \"Item one name\",\n"+ " \"description\": \"description of item one\"\n"+ " },\n"+ " {\n"+ " \"name\": \"Item two name\",\n"+ " \"description\": \"description of item two\"\n"+ " }\n"+ " ]\n"+ "}"; HttpResponse response=Unirest.post("https://api.amberscript.com/api/glossary?apiKey=YOUR_API_KEY") .header("Content-Type","application/json") .body(body) .asString(); ``` -------------------------------- ### Create a glossary using cURL Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md Sends a POST request via the command line. ```shell curl --request POST --url 'https://api.amberscript.com/api/glossary?apiKey=YOUR_API_KEY' --header 'Content-Type: application/json' --data-raw '{ "name":"Name of first glossary", "names": [ "Test name one", "Test name two" ], "items":[ { "name":{{glossaryItem1Name}}, "description":{{glossaryItem1Description}} }, { "name":"{{glossaryItem2Name}}", "description":{{glossaryItem2Description}} } ] }' ``` -------------------------------- ### Create a glossary using JavaScript Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md Uses the Fetch API to send a POST request with a JSON-stringified body. ```javascript async function createGlossary() { const url = 'https://api.amberscript.com/api/glossary'; const body = { "name": "Name of first glossary", "names": [ "Test name one", "Test name two" ], "items": [ { "name": "Item one name", "description": "description of item one" }, { "name": "Item two name", "description": "description of item two" } ] }; const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify(body) }; const queryParams = new URLSearchParams({ apiKey: 'YOUR_API_KEY' }); try { const response = await fetch(`${url}?${queryParams}`, options); const data = await response.json(); console.log(data); } catch (error) { console.error('Error:', error.response.data); } } ``` -------------------------------- ### Create a glossary using Python Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md Uses the requests library to send a POST request with a JSON payload. ```python import requests url = "https://api.amberscript.com/api/glossary" querystring = {"apiKey":"YOUR_API_KEY"} payload = "{\n" \ " \"name\": \"Name of first glossary\",\n" \ " \"names\": [\n" \ " \"Test name one\",\n" \ " \"Test name two\"\n" \ " ],\n" \ " \"items\": [\n" \ " {\n" \ " \"name\": \"Item one name\",\n" \ " \"description\": \"description of item one\"\n" \ " },\n" \ " {\n" \ " \"name\": \"Item two name\",\n" \ " \"description\": \"description of item two\"\n" \ " }\n" \ " ]\n" \ "}" headers = { 'Content-Type': 'application/json' } response = requests.request("POST", url, data=payload, headers=headers, params=querystring) print(response.text) ``` -------------------------------- ### Upload Media via URL with cURL Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md Executes a POST request using the command line interface. ```shell curl --request POST --url 'https://api.amberscript.com/api/jobs/upload-media-from-url?apiKey={{YOUR_API_KEY}}' \ -H "Content-Type: application/json" \ --data '{"sourceUrl" : "https://www.learningcontainer.com/wp-content/uploads/2020/05/sample-mp4-file.mp4","transcriptionType":"transcription","jobType":"direct","language":"nl"}' \ ``` -------------------------------- ### Upload Media via URL in Java Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md Uses the Unirest library to send a POST request with the media source URL and job configuration. ```java HttpResponse response=Unirest.post("https://api.amberscript.com/api/jobs/upload-media-from-url?apiKey={{YOUR_API_KEY}}") .body("{\"sourceUrl\":\"https://www.learningcontainer.com/wp-content/uploads/2020/05/sample-mp4-file.mp4\", \"language\":\"en\", \"transcriptionType\":\"transcription\"}", \"jobType\":\"direct\", \"numberOfSpeakers \":\"2\") .asJson(); ``` -------------------------------- ### Upload a file using Java Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md Uses the Unirest library to perform a POST request with query parameters. ```java HttpResponse response=Unirest.post("https://api.amberscript.com/api/jobs/upload-media?transcriptionType=transcription&jobType=direct&language=nl&apiKey={{YOUR_API_KEY}}") .asString(); ``` -------------------------------- ### Commit documentation changes Source: https://github.com/amberscript/api-docs/blob/master/README.md Use this command to stage and commit updates to the documentation repository. ```bash $ git commit -m "Update documentation" ``` -------------------------------- ### Upload a file using Python Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md Uses the requests library to send a file via a POST request. ```python import requests url = 'https://api.amberscript.com/api/jobs/upload-media' filepath = '/Users/userA/Downloads/my-file.mp3' querystring = {"jobType":"direct","language":"nl","transcriptionType":"transcription","apiKey":"YOUR_API_KEY"} files = {'file': open(filepath, 'rb')} response = requests.post(url, files=files, verify=False, params=querystring) print(response.status_code) print(response.text) ``` -------------------------------- ### Push changes to GitHub Source: https://github.com/amberscript/api-docs/blob/master/README.md Execute this command to push committed changes to the remote repository. ```bash $ git push ``` -------------------------------- ### POST /api/glossary Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md Creates a new glossary with a specified name, optional list of names, and optional glossary items. ```APIDOC ## POST /api/glossary ### Description Creates a new glossary for use within the AmberScript platform. ### Method POST ### Endpoint https://api.amberscript.com/api/glossary ### Parameters #### Query Parameters - **apiKey** (string) - Required - Your API authentication key. #### Request Body - **name** (string) - Required - Name of the glossary (max length 60). - **names** (array of strings) - Optional - Array of names (max 250 items, max length 20). - **items** (array of objects) - Optional - Array of glossary items (max 750 items). ### Request Example { "name": "Name of first glossary", "names": ["Test name one", "Test name two"], "items": [ {"name": "Item one name", "description": "description of item one"}, {"name": "Item two name", "description": "description of item two"} ] } ### Response #### Success Response (200) - **id** (string) - Unique identifier of the created glossary. - **userName** (string) - The username associated with the account. - **name** (string) - Name of the glossary. - **names** (array) - List of names provided. - **items** (array) - List of items provided. - **created** (number) - Timestamp of creation. #### Response Example { "id": "5f686d068c996402a02bbb85", "userName": "YOUR_USERNAME", "name": "Name of first glossary", "names": ["Test name one", "Test name two"], "items": [ {"name": "Item one name", "description": "description of item one"}, {"name": "Item two name", "description": "description of item two"} ], "created": 1600679174451 } ``` -------------------------------- ### Upload Media via URL in JavaScript Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md Uses the axios library to perform an asynchronous POST request with JSON body parameters. ```javascript import axios from 'axios'; async function uploadMediaFromUrl() { const apiKey = 'YOUR_API_KEY'; const url = 'https://api.amberscript.com/api/jobs/upload-media-from-url'; const queryString = new URLSearchParams({ apiKey }).toString(); const body = { sourceUrl: 'https://www.learningcontainer.com/wp-content/uploads/2020/05/sample-mp4-file.mp4', transcriptionType: 'transcription', jobType: 'direct', language: 'nl', numberOfSpeakers: '2' }; const options = { headers: { 'content-type': 'application/json' } }; try { const response = await axios.post(`${url}?${queryString}`, body, options); console.log(response.data); } catch (error) { console.error('Error:', error.response.data) } } ``` -------------------------------- ### List jobs response format Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md The expected JSON array structure returned when listing jobs. ```json [ { "jobId": "5f686d2d8c996402a02bbb92", "created": 1600679213751, "language": "nl", "status": "DONE", "nrAudioSeconds": 59, "transcriptionType": "transcription", "filename": "test.mp4", "jobType": "perfect", "jobOptions": { "transcriptionStyle": "cleanread" }, "notes": null }, { "jobId": "5f686d068c996402a02bbb85", "created": 1600679174451, "language": "nl", "status": "DONE", "nrAudioSeconds": 191, "transcriptionType": "transcription", "filename": "test.mp4", "jobType": "perfect", "jobOptions": { "transcriptionStyle": "cleanread" }, "notes": null }, { "jobId": "5f686d068c996402a02bbb82", "created": 1600679174415, "language": "nl", "status": "DONE", "nrAudioSeconds": 59, "transcriptionType": "transcription", "filename": "test.mp4", "jobType": "perfect", "jobOptions": { "transcriptionStyle": "cleanread" }, "notes": null } ] ``` -------------------------------- ### Upload a file using JavaScript Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md Uses axios and form-data to upload a file stream with multipart/form-data headers. ```javascript import axios from 'axios'; import FormData from 'form-data'; import fs from 'fs'; async function uploadMedia() { const apiKey = 'YOUR_API_KEY'; const transcriptionType = 'transcription'; const jobType = 'perfect'; const language = 'nl'; const numberOfSpeakers = '2'; const formData = new FormData(); formData.append('file', fs.createReadStream('./path/to/my_file.mp3')); const url = 'https://api.amberscript.com/api/jobs/upload-media'; const queryString = new URLSearchParams({ apiKey, transcriptionType, jobType, language, numberOfSpeakers }).toString(); const options = { headers: { ...formData.getHeaders() } }; try { const response = await axios.post(`${url}?${queryString}`, formData, options); console.log(response.data); } catch (error) { console.error('Error:', error.response.data) } } ``` -------------------------------- ### Export Job to JSON via cURL Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md Direct command line interface for the export endpoint. ```shell curl --request GET --url 'https://api.amberscript.com/api/jobs/export-json?jobId=JOB_ID&apiKey=YOUR_API_KEY' ``` -------------------------------- ### Export Job to JSON via JavaScript Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md Uses the axios library to fetch JSON data asynchronously. ```javascript async function exportJSON() { const jobId = 'JOB_ID'; const apiKey = 'YOUR_API_KEY'; const url = `https://api.amberscript.com/api/jobs/export-json?jobId=${jobId}&apiKey=${apiKey}`; try { const response = await axios.get(url, { headers: { 'Content-Type': 'application/json' } }); console.log(response.data); } catch (error) { console.error('Error:', error.response.data); } } ``` -------------------------------- ### Delete job response format Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md The expected JSON response structure upon successful deletion. ```json { "message": "Job deleted" } ``` -------------------------------- ### Handle Success Callback Status Source: https://github.com/amberscript/api-docs/blob/master/source/index.html.md The JSON structure received when a transcription job is successfully completed. ```json { "jobId": "JOB_ID", "created": 82800000, "language": "nl", "status": "DONE", "nrAudioSeconds": 45, "transcriptionType": "captions", "filename": "file_name.mp3", "jobType": "direct" } ```