Application Integration
This presentation will cover the fundamentals of Application
Programming Interfaces (APIs), including REST API design
principles and practices.
What is an API?
Definition Example
An API is a software intermediary that allows two When you use a weather app on your phone, it sends
applications to communicate with each other. data to a server via an API, which retrieves and
interprets the data, then sends it back to your phone.
REST API Design Principles
1 Client-Server 2 Statelessness
Architecture
Each API request from the
The client and server are client must contain all the
separate entities that information the server
communicate over a needs to process it
network.
3 Uniform Interface 4 Resource-Based
The API must follow Everything in a REST API is
consistent conventions for considered a resource (e.g.,
ease of use and users, products, orders).
understanding. The
interface should be uniform
across endpoints
REST API Design Principles
5 Layered 6 Cacheability
System Each API request from the
The API should be designed client must contain all the
so that the client cannot tell information the server
if it is directly connected to needs to process it
the server or an
intermediary (e.g., load
balancer, cache).
7 Code on Demand (Optional)
In some cases, the server
can return executable code
(e.g., JavaScript) to the
client for execution.
REST API Design Practices
Versioning Error Handling
Use versioning to manage Provide clear and
changes and avoid breaking informative error messages
existing clients. to help developers
troubleshoot issues.
Security Documentation
Implement authentication Provide comprehensive
and authorization documentation that explains
mechanisms to protect how to use the API.
sensitive data.
Architectural Concepts
User Agent Origin Server
The client application that The server that hosts the API
interacts with the API. resources.
Resources Representations
Data or functionality exposed Data formats used to represent
by the API. resources, such as JSON or XML.
Architectural Properties
Performance 1
Efficient communication between clients and servers.
2 Scalability
Ability to handle a large number of clients and requests.
Simplicity 3
A uniform interface that is easy to understand and use.
4 Modifiability
Ability to update and evolve the API without breaking existing
clients.
Visibility 5
Transparent communication between clients and servers.
6 Portability
Ability to run the API on different platforms.
Reliability 7
Robustness and resilience to failures.
Sample Output