“How do APIs differ? Different API Types” – Content:
- What is an API?
- Types of APIs
- Function oriented programming interfaces
- File oriented programming interfaces
- Object-Oriented Programming Interfaces
- Protocol Oriented Programming Interfaces
- “API Types” – Summary
What is an API?
API stands for Application Programming Interface and enables interaction between two applications. So, you can use an API for a web-based system, operating system, database system, computer hardware, or software library. In most cases, an API provides interactions between one software and another, but not users.
Types of APIs
There are three types of APIs, public APIs, partner APIs, and private APIs. They differ mainly in terms of security and accessibility.
Public APIs: There are no restrictions on access to the APIs, as they are publicly accessible. Mostly, however, you need an authentication key or token to access them.
Partner APIs: So, you need specific rights or licenses to access this type of API because they are not publicly available.
Private APIs: You can use this type of API only internally. So, you don’t need a token or key to identify yourself, because you are trusted as internal.
Different types of APIs
Function-oriented programming interfaces
In this form of the programming interface, only the function with or without return value is used as a means of communication. So, a unique reference value of a system resource is almost always used. Thus, you call a function and get a unique resource back. This allows you to call additional functions until everything has to be closed again.
File oriented programming interfaces
You can address a file-oriented programming interface via normal calls open, read, write and close. So, when you send data to an object, it is written with write, when it is to be received, it is read, and when it is to be closed, close is used.
Protocol Oriented Programming Interfaces
So, the object-oriented programming interfaces are much more flexible than the other APIs. Therefore, they use interface pointers. It holds an object that implements its interface. As a result, it is more adaptive.
Object-Oriented Programming Interfaces
Protocol oriented programming interfaces are independent of the operating system and hardware. However, you need to keep in mind that you have to implement the protocol every time. So, in order to keep this effort as low as possible, the protocol-oriented interface is encapsulated by a function- or interface oriented interface. You can differ between general protocols such as SOAP and application-specific protocols such as SMTP.
“Different API Types” – Summary:
There are three different types of APIs, the Public API, the Partner API and the Private API. So, all three differ primarily in the way you authorize yourself. In addition, there are four types of APIs: the function-oriented, the data oriented, the object-oriented and the protocol oriented API. These differed primarily in the use of the interface. Basically, it is important to first decide which type and type of API is most appropriate for your business model before making design decisions.