TestParsing
Parses the input EDI (electronic data interchange) file. The input file has a file size limit of 250 KB.
Request Syntax
{
"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.
- 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"
}
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
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": "test-bucket",
"key": "sampleFile.txt"
}
}
Sample Response
{
"parsedFileContent": "<Sample parsed file content>"
}
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: