Use DeleteTranscriptionJob with an Amazon SDK or CLI
The following code examples show how to use DeleteTranscriptionJob.
Action examples are code excerpts from larger programs and must be run in context. You can see this action in context in the following code example:
- .NET
-
- Amazon SDK for .NET
-
Note
There's more on GitHub. Find the complete example and learn how to set up and run in the Amazon Code Examples Repository
. /// <summary> /// Delete a transcription job. Also deletes the transcript associated with the job. /// </summary> /// <param name="jobName">Name of the transcription job to delete.</param> /// <returns>True if successful.</returns> public async Task<bool> DeleteTranscriptionJob(string jobName) { var response = await _amazonTranscribeService.DeleteTranscriptionJobAsync( new DeleteTranscriptionJobRequest() { TranscriptionJobName = jobName }); return response.HttpStatusCode == HttpStatusCode.OK; }-
For API details, see DeleteTranscriptionJob in Amazon SDK for .NET API Reference.
-
- CLI
-
- Amazon CLI
-
To delete one of your transcription jobs
The following
delete-transcription-jobexample deletes one of your transcription jobs.aws transcribe delete-transcription-job \ --transcription-job-nameyour-transcription-jobThis command produces no output.
For more information, see DeleteTranscriptionJob
in the Amazon Transcribe Developer Guide. -
For API details, see DeleteTranscriptionJob
in Amazon CLI Command Reference.
-
- JavaScript
-
- SDK for JavaScript (v3)
-
Note
There's more on GitHub. Find the complete example and learn how to set up and run in the Amazon Code Examples Repository
. Delete a transcription job.
// Import the required AWS SDK clients and commands for Node.js import { DeleteTranscriptionJobCommand } from "@aws-sdk/client-transcribe"; import { transcribeClient } from "./libs/transcribeClient.js"; // Set the parameters export const params = { TranscriptionJobName: "JOB_NAME", // Required. For example, 'transciption_demo' }; export const run = async () => { try { const data = await transcribeClient.send( new DeleteTranscriptionJobCommand(params), ); console.log("Success - deleted"); return data; // For unit tests. } catch (err) { console.log("Error", err); } }; run();Create the client.
import { TranscribeClient } from "@aws-sdk/client-transcribe"; // Set the AWS Region. const REGION = "REGION"; //e.g. "us-east-1" // Create an Amazon Transcribe service client object. const transcribeClient = new TranscribeClient({ region: REGION }); export { transcribeClient };-
For more information, see Amazon SDK for JavaScript Developer Guide.
-
For API details, see DeleteTranscriptionJob in Amazon SDK for JavaScript API Reference.
-
- Python
-
- SDK for Python (Boto3)
-
Note
There's more on GitHub. Find the complete example and learn how to set up and run in the Amazon Code Examples Repository
. def delete_job(job_name, transcribe_client): """ Deletes a transcription job. This also deletes the transcript associated with the job. :param job_name: The name of the job to delete. :param transcribe_client: The Boto3 Transcribe client. """ try: transcribe_client.delete_transcription_job(TranscriptionJobName=job_name) logger.info("Deleted job %s.", job_name) except ClientError: logger.exception("Couldn't delete job %s.", job_name) raise-
For API details, see DeleteTranscriptionJob in Amazon SDK for Python (Boto3) API Reference.
-
- SAP ABAP
-
- SDK for SAP ABAP
-
Note
There's more on GitHub. Find the complete example and learn how to set up and run in the Amazon Code Examples Repository
. TRY. lo_tnb->deletetranscriptionjob( iv_job_name ). MESSAGE 'Transcription job deleted.' TYPE 'I'. CATCH /aws1/cx_tnbbadrequestex INTO DATA(lo_bad_request_ex). MESSAGE lo_bad_request_ex TYPE 'I'. RAISE EXCEPTION lo_bad_request_ex. CATCH /aws1/cx_tnblimitexceededex INTO DATA(lo_limit_ex). MESSAGE lo_limit_ex TYPE 'I'. RAISE EXCEPTION lo_limit_ex. CATCH /aws1/cx_tnbinternalfailureex INTO DATA(lo_internal_ex). MESSAGE lo_internal_ex TYPE 'I'. RAISE EXCEPTION lo_internal_ex. ENDTRY.-
For API details, see DeleteTranscriptionJob in Amazon SDK for SAP ABAP API reference.
-
For a complete list of Amazon SDK developer guides and code examples, see Using this service with an Amazon SDK. This topic also includes information about getting started and details about previous SDK versions.