An API (Application Programming Interface) is a set of rules and
protocols that allows different software applications to communicate with each
other. It defines how different software components should interact, making it
easier for developers to integrate and use the functionality of one software
system in another.
Example1: API in Layman words:
Ø Think
of it as a waiter taking your order at a restaurant.
Ø You
(the client) don't need to go to the kitchen and cook the food yourself
(interact directly with the server).
Ø Instead,
you communicate your order to the waiter, who then conveys it to the kitchen
and brings the food back to you.
Ø Similarly,in SAP, different software systems or applications (like a website, mobile app,
or third-party software) may want to access or use data and functions from SAP
systems.
Ø The API acts as the intermediary or waiter, allowing these external systems to make
requests (place orders) for specific data or actions from the SAP system. The
SAP system processes the request and provides the necessary information, just
like the kitchen preparing your food.
Example2:Simple API flow how it works in a Restaurant:
In this way, APIs facilitate smooth communication between different software, enabling them to work together seamlessly, even if they are from different vendors or serve different purposes.
There are
several types of APIs, and they can be categorized based on their purpose and
how they expose functionality. Here are some common types of APIs with
examples:
Open
APIs (Public APIs):
Definition:
Open APIs, also known as public APIs, are accessible to developers and
third-party applications with minimal restrictions. They are designed for
external users and developers and are publicly available.
Example:
Twitter API, Google Maps API, OpenWeatherMap API.
Internal
APIs (Private APIs):
Internal APIs, or private APIs, are used
within organizations and are not exposed to external developers. They are
designed to improve code reusability, maintainability, and collaboration among
internal teams.
Example:
An e-commerce company using internal APIs to connect their inventory management
system with their order processing system.
RESTful
APIs:
REST (Representational
State Transfer) is an architectural style for designing networked applications.
RESTful APIs adhere to the principles of REST and use standard HTTP methods
(GET, POST, PUT, DELETE) for communication.
Example:
GitHub API, Dropbox API, Facebook Graph API.
SOAP
APIs:
SOAP (Simple Object Access
Protocol) is a protocol for exchanging structured information in web services.
SOAP APIs use XML for message formatting and are known for their strict
standards.
Example:
Web services in enterprise systems like SAP, Salesforce, or Microsoft Dynamics.
GraphQL
APIs:
GraphQL is a query language
for APIs that allows clients to request only the data they need. It provides a
more flexible and efficient alternative to traditional REST APIs.
Example:
GitHub GraphQL API, Shopify GraphQL API.
Webhooks:
Webhooks are a way for one
system to provide real-time information to another system by sending HTTP
callbacks or notifications when an event occurs.
Example:
GitHub Webhooks for receiving notifications about repository events, Stripe
Webhooks for payment events.
Library-based
APIs:
Library-based APIs provide a
set of functions and procedures that can be used by applications. They are
often packaged as libraries that developers can include in their code.
Example:
Java Standard API, .NET Framework Class Library.
No comments:
Post a Comment