Why is an API?
Here we explain what an API (Application Programming Internet) is and why it is important.
An API connects two applications using the public or private internet and a standard data interface.
Why is this important?
Suppose Company A is a high-volume customer of Company B. They might want to send sales orders to Company B electronically.
Historically, it was very difficult for Company A to connect to, for example, Company B's order entry system. This was because it was necessary to establish a dedicated network route between the two companies, perhaps using proprietary protocols and a paid network. Plus there was admin overhead, as company B would have had to add company A as a user to Company B's user database, grant them permissions, and perhaps even modify their code or database tables.
An API makes all of this simpler in several ways.
First, it eliminates the need for a private network by using the HTTP protocol and the internet. HTTP is the same protocol that web pages use.
Second, Company B can use the REST web services standard to expose their application. REST is used by almost all companies today.
Company B tells company A what parameters to send to create the sales order. Most likely they would use the JSON (Javascript Object Notation) standard, which is widely used and easy to understand.
Authentication is simple. Company B gives Company A a secret key. And REST eliminates the need to hard-wire the two systems together, as it is an industry standard using regular text (JSON) instead of program objects.
And Company B can work on their code without breaking the interface to Company A.
Further, since REST uses HTTP, and since almost all programming languages support HTTP, Company A could program the interface using a programming language that they already know. So, they are not forced to use a particular language.
Further, REST supports any data type, as graphics, audio, or videos can be base64 encoded (i.e. converted into plain text) for delivery over the internet.