TestParsing
Parses the input EDI (electronic data interchange) file. The input file has a file size limit of 250 KB.
Request Syntax
{
"advancedOptions": {
"x12": {
"splitOptions": {
"splitBy": "string
"
}
}
},
"ediType": { ... },
"fileFormat": "string
",
"inputFile": {
"bucketName": "string
",
"key": "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.
- advancedOptions
-
Specifies advanced options for parsing the input EDI file. These options allow for more granular control over the parsing process, including split options for X12 files.
Type: AdvancedOptions object
Required: No
- ediType
-
Specifies the details for the EDI standard that is being used for the transformer. Currently, only X12 is supported. X12 is a set of standards and corresponding messages that define specific business documents.
Type: EdiType object
Note: This object is a Union. Only one member of this object can be specified or returned.
Required: Yes
- fileFormat
-
Specifies that the currently supported file formats for EDI transformations are
JSON
andXML
.Type: String
Valid Values:
XML | JSON | NOT_USED
Required: Yes
- inputFile
-
Specifies an
S3Location
object, which contains the Amazon S3 bucket and prefix for the location of the input file.Type: S3Location object
Required: Yes
Response Syntax
{
"parsedFileContent": "string",
"parsedSplitFileContents": [ "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.
- parsedFileContent
-
Returns the contents of the input file being tested, parsed according to the specified EDI (electronic data interchange) type.
Type: String
- parsedSplitFileContents
-
Returns an array of parsed file contents when the input file is split according to the specified split options. Each element in the array represents a separate split file's parsed content.
Type: Array of strings
Errors
For information about the errors that are common to all actions, see Common Errors.
- AccessDeniedException
-
You do not have sufficient access to perform this action.
HTTP Status Code: 400
- InternalServerException
-
This exception is thrown when an error occurs in the AWS B2B Data Interchange service.
HTTP Status Code: 500
- ResourceNotFoundException
-
Occurs when the requested resource does not exist, or cannot be found. In some cases, the resource exists in a region other than the region specified in the API call.
HTTP Status Code: 400
- ThrottlingException
-
The request was denied due to throttling: the data speed and rendering may be limited depending on various parameters and conditions.
HTTP Status Code: 400
- ValidationException
-
Occurs when a B2BI object cannot be validated against a request from another object.
HTTP Status Code: 400
Examples
Example
The following example parses the sample input file.
Sample Request
{
"ediType": {
"x12Details": {
"transactionSet": "X12_110",
"version": "VERSION_4010"
}
},
"fileFormat": "JSON",
"inputFile": {
"bucketName": "amzn-s3-demo-bucket",
"key": "sampleFile.txt"
}
}
Sample Response
{
"parsedFileContent": "<Sample parsed file content>"
}
Example
The following example parses the sample input file with EDI splitting enabled.
Sample Request
{
"ediType": {
"x12Details": {
"transactionSet": "X12_110",
"version": "VERSION_4010"
}
},
"fileFormat": "JSON",
"inputFile": {
"bucketName": "amzn-s3-demo-bucket",
"key": "input/batch-file.edi"
},
"advancedOptions": {
"x12": {
"splitOptions": {
"splitBy": "TRANSACTION"
}
}
}
}
Sample Response
{
"parsedFileContent": ""
}
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: