StartTextTranslationJob
Starts an asynchronous batch translation job. Batch translation jobs can be used to translate large volumes of text across multiple documents at once. For more information, see Asynchronous Batch Processing with Amazon Translate.
Batch translation jobs can be described with the DescribeTextTranslationJob operation, listed with the ListTextTranslationJobs operation, and stopped with the StopTextTranslationJob operation.
Amazon Translate does not support batch translation of multiple source languages at once.
Request Syntax
{
"ClientToken": "string
",
"DataAccessRoleArn": "string
",
"InputDataConfig": {
"ContentType": "string
",
"S3Uri": "string
"
},
"JobName": "string
",
"OutputDataConfig": {
"S3Uri": "string
"
},
"ParallelDataNames": [ "string
" ],
"SourceLanguageCode": "string
",
"TargetLanguageCodes": [ "string
" ],
"TerminologyNames": [ "string
" ]
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
The request accepts the following data in JSON format.
- ClientToken
-
A unique identifier for the request. This token is auto-generated when using the Amazon Translate SDK.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 64.
Pattern:
^[a-zA-Z0-9-]+$
Required: Yes
- DataAccessRoleArn
-
The Amazon Resource Name (ARN) of an AWS Identity Access and Management (IAM) role that grants Amazon Translate read access to your input data. For more nformation, see Identity and Access Management for Amazon Translate.
Type: String
Length Constraints: Minimum length of 20. Maximum length of 2048.
Pattern:
arn:aws(-[^:]+)?:iam::[0-9]{12}:role/.+
Required: Yes
- InputDataConfig
-
Specifies the format and S3 location of the input documents for the translation job.
Type: InputDataConfig object
Required: Yes
- JobName
-
The name of the batch translation job to be performed.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 256.
Pattern:
^([\p{L}\p{Z}\p{N}_.:/=+\-%@]*)$
Required: No
- OutputDataConfig
-
Specifies the S3 folder to which your job output will be saved.
Type: OutputDataConfig object
Required: Yes
- ParallelDataNames
-
The names of the parallel data resources to use in the batch translation job. For a list of available parallel data resources, use the ListParallelData operation.
Type: Array of strings
Length Constraints: Minimum length of 1. Maximum length of 256.
Pattern:
^([A-Za-z0-9-]_?)+$
Required: No
- SourceLanguageCode
-
The language code of the input language. For a list of language codes, see Supported Languages and Language Codes.
Amazon Translate does not automatically detect a source language during batch translation jobs.
Type: String
Length Constraints: Minimum length of 2. Maximum length of 5.
Required: Yes
- TargetLanguageCodes
-
The language code of the output language.
Type: Array of strings
Array Members: Fixed number of 1 item.
Length Constraints: Minimum length of 2. Maximum length of 5.
Required: Yes
- TerminologyNames
-
The name of the terminology to use in the batch translation job. For a list of available terminologies, use the ListTerminologies operation.
Type: Array of strings
Length Constraints: Minimum length of 1. Maximum length of 256.
Pattern:
^([A-Za-z0-9-]_?)+$
Required: No
Response Syntax
{
"JobId": "string",
"JobStatus": "string"
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- JobId
-
The identifier generated for the job. To get the status of a job, use this ID with the DescribeTextTranslationJob operation.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 32.
Pattern:
^([\p{L}\p{Z}\p{N}_.:/=+\-%@]*)$
- JobStatus
-
The status of the job. Possible values include:
-
SUBMITTED
- The job has been received and is queued for processing. -
IN_PROGRESS
- Amazon Translate is processing the job. -
COMPLETED
- The job was successfully completed and the output is available. -
COMPLETED_WITH_ERROR
- The job was completed with errors. The errors can be analyzed in the job's output. -
FAILED
- The job did not complete. To get details, use the DescribeTextTranslationJob operation. -
STOP_REQUESTED
- The user who started the job has requested that it be stopped. -
STOPPED
- The job has been stopped.
Type: String
Valid Values:
SUBMITTED | IN_PROGRESS | COMPLETED | COMPLETED_WITH_ERROR | FAILED | STOP_REQUESTED | STOPPED
-
Errors
For information about the errors that are common to all actions, see Common Errors.
- InternalServerException
-
An internal server error occurred. Retry your request.
HTTP Status Code: 500
- InvalidRequestException
-
The request that you made is invalid. Check your request to determine why it's invalid and then retry the request.
HTTP Status Code: 400
- ResourceNotFoundException
-
The resource you are looking for has not been found. Review the resource you're looking for and see if a different resource will accomplish your needs before retrying the revised request.
HTTP Status Code: 400
- TooManyRequestsException
-
You have made too many requests within a short period of time. Wait for a short time and then try your request again.
HTTP Status Code: 400
- UnsupportedLanguagePairException
-
Amazon Translate does not support translation from the language of the source text into the requested target language. For more information, see Exception Handling.
HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: