A while back, I wrote a post about creating a Rails API. But what IS an API?
What does API mean?
API stands for "Application Programming Interface". "API" is often used and heard by many users interacting with computers (even far from programming). API is essentially a tool that allows programs to communicate with each other.
Programming interface includes functions, classes, methods, and structures that help one application interact with another. The API contains some "bridges" that allow program A to access data from program B or to some of its capabilities. Thus, programmers can expand the functionality of their product and associate it with other developments.
The API can only work with a permission of the creators of program A and with the observance of all security measures so that developers wishing to use the API could not get access to confidential information.
The main principle of the API and why is it called an interface:
In simple terms, an interface is a "layer" between application A and application B. It contains processes that allow two programs to exchange information and perform functions related to both sides, hiding the "internal structure" of programs.
This approach allows one to establish interaction between several utilities without thinking about how they work, what program logic drives them and how the transmitted data is processed. Interfaces simplify work for both common users and programmers. The former do not have to think about what it is behind the familiar functions in their gadgets, and developers do not need to study the code of other programmers in order to connect someone else's product to their own.
This is called encapsulation. By hiding part of the functions for the sake of simplifying the work in general and minimizing areas of the software where one of the developers could make a mistake.