2. 1.WHAT IS AN API?
API (Application Programming Interface) is a software
intermediary that allows two applications to talk to each other.
There are many types of APIs.
Web APIs: Simple Object Access Protocol (SOAP), Remote
Procedure Call (RPC), Representational StateTransfer (REST).
…
3. 1.WHAT IS AN API?
1.1.Web APIs
Web API (Web Service) provides an interface forWeb applications, or
applications that need to connect to each other via the Internet to
communicate.
Since 2005, the use of web APIs has exploded exponentially, and
multipleWeb formats and standards have been created.
Early on, one of the most popular enterprise formats for APIs was
SOAP.
With the emergence of JavaScript Object Notation (JSON), REST
has grown in popularity and quickly become the de facto standard
for the generalWeb APIs today.
4. 1.1WEB APIS
1.1.1. SOAP
It was designed to offer a new protocol and messaging framework.
It relied on theWeb Service Definition Language (WSDL) & XML to
build and receive the different requests.
1.1.2. XML-RPC (Remote Procedure Calls)
It was the basic for SOAP.
It was much quicker and easier to implement than SOAP.
1.1.3. JSON-RPC
The format was originally designed to take advantage of JavaScript’s
ability to act as a messaging system
JSON was developed to provide a simple, concise format
5. 1.1WEB APIS
1.1.4. REST
Provides an incredible layer of flexibility.
Has ability to handle multiple types of calls, return different data
formats & even change structurally with the correct implementation
of hypermedia.
6. 1.WHAT IS AN API?
1.2. Understanding REST
One of the most commonly missed constraints of REST is the
utilization of hypermedia as the engine of application state, or
HATEOAS
There are six key constraints to REST:
Client-Server
Stateless
Cache
Uniform Interface
Layered System
Code on demand
7. 1.2. UNDERSTANDING REST
1.2.1. Client-server
Operates on the concept that the client and the server should be
separate from each other and allowed to evolve individually.
This creates a separation of concerns, letting each application grow
and scale independently of the other and allowing your organization
to grow quickly and efficiently.
1.2.2. Stateless
The calls can be made independently of one another, and each call
contains all of the data necessary to complete itself successfully.
1.2.3. Cache
When data is cacheable, the response should indicate that the data
can be stored up to a certain time.
8. 1.2. UNDERSTANDING REST
1.2.4. Uniform Interface
The uniform interface lets the client talk to the server in a single
language, independent of the architectural backend of either.This
interface should provide an unchanging, standardized means of
communicating between the client and the server.
1.2.5. Layered System
Is a system comprised of layers, with each layer having a specific
functionality and responsibility.
1.2.6. Code on demand
Allows for code or applets to be transmitted via the API for use
within the application.