Documentation

How to translate EDI files

Article author
Admin
  • Updated

Translate EDI resources with the HTTP POST Method

In order to translate from EDI or translate to EDI use the following resources with the POST method:

  1. Read EDI file into JSON

    You can read EDI files/streams for the following EDI standards. To do so, execute HTTP POST to the relevant resource URL, with the request body being the file to translate included as either binary or form-data content.

      1. URL: https://api.edination.com/v2/x12/read
      2. Header: Ocp-Apim-Subscription-Key: {API key}
      3. Request: X12 file as binary
      4. Response: Array of X12Interchange
      1. URL: https://api.edination.com/v2/edifact/read
      2. Header: Ocp-Apim-Subscription-Key: {API key}
      3. Request: EDIFACT file as binary
      4. Response: Array of EdifactInterchange
      1. URL: https://api.edination.com/v2/hl7/read
      2. Header: Ocp-Apim-Subscription-Key: {API key}
      3. Request: HL7 file as binary
      4. Response: Array of HL7Interchange
      1. URL: https://api.edination.com/v2/vda/read
      2. Header: Ocp-Apim-Subscription-Key: {API key}
      3. Request: VDA file as binary
      4. Response: Array of FlatMessage
      1. URL: https://api.edination.com/v2/ncpdp/read
      2. Header: Ocp-Apim-Subscription-Key: {API key}
      3. Request: NCPDP Telco file as binary
      4. Response: Array of NcpdpTransmission

    The response will contain an array of EDI interchanges, encoded in application/json format.

    Example with Postman:

    translate-x12.png

  2. Write JSON to EDI file

    Again, you can write out two resources, X12 and EDIFACT. Execute HTTP POST to the resource URL, the request body must contain a single EDI interchange, included as application/json content.

      1. URL: https://api.edination.com/v2/x12/write
      2. Header: Ocp-Apim-Subscription-Key: {API key}
      3. Request: X12Interchange
      4. Response: X12 file as application/octet-stream
      1. URL: https://api.edination.com/v2/edifact/write
      2. Header: Ocp-Apim-Subscription-Key: {API key}
      3. Request: EdifactInterchange
      4. Response: EDIFACT file as application/octet-stream
      1. URL: https://api.edination.com/v2/hl7/write
      2. Header: Ocp-Apim-Subscription-Key: {API key}
      3. Request: HL7Interchange
      4. Response: HL7 file as application/octet-stream
      1. URL: https://api.edination.com/v2/vda/write
      2. Header: Ocp-Apim-Subscription-Key: {API key}
      3. Request: FlatMessage
      4. Response: VDA file as application/octet-stream
      1. URL: https://api.edination.com/v2/ncpdp/write
      2. Header: Ocp-Apim-Subscription-Key: {API key}
      3. Request: NcpdpTransmission
      4. Response: NCPDP Telco file as application/octet-stream

    The response will contain an EDI interchange, encoded in application/octet-stream format.

    Example with Postman:

    translate-json-to-x12.png

Share this:

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.