I've heard EDI used both ways: referring to the very general concept of two systems exchanging data in which case an API is a way to implement EDI, and as a file format analogous to json often using ascii control characters (file separator, group separator, record separator, etc)