9162826 Introduction to API and RESTful API
9162826 Introduction to API and RESTful API
API
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Agenda
In this session, we will discuss:
● Introduction to API and its Working
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Introduction to API
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Introduction to API
● APIs are tools that facilitate communication between
two software components by providing a predefined set
of definitions and protocols.
● APIs provide a set of rules, protocols, and tools that
developers can use to access the functionality and data
of another software system, service, or platform.
● APIs helps in structuring the requests and responses,
making it possible for developers to integrate various
services and functionalities into their own applications
without having to build everything from scratch.
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Working of API
Rating
and
Feedback
User
Request
Driver
Real-Time
Matching
Tracking
API
Payment
Gateway
API
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Difference between API and Web
Application
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Difference Between API and Web Application
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Difference Between API and Web Application
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Different Types of APIs
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Different Types of API
RESTful APIs
1. Web APIs
SOAP APIs
Operating
System APIs
2. Hardware APIs
Device APIs
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Different Types of API
Python Standard
Library
3. Library APIs
JavaScript
Libraries
SQL APIs
4. Database APIs
No SQL APIs
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Different Types of API
Web Scraping
APIs
5. Data APIs
Data Provider
APIs
Cloud Service
APIs
6. Cloud APIs
Social Media
APIs
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Different Types of API
Device
Management
APIs
7. IoT APIs
Sensor APIs
Payment
Gateway APIs
8. Payment APIs
Banking APIs
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Advantages of APIs
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Advantages of APIs
Modularity and
Interoperability Scalability
Reusability
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Advantages of APIs
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Advantages of APIs
Improved User
Data Integration Testing and Debugging
Experience
APIs make it easier to APIs can be tested and By leveraging APIs for
integrate data from debugged features like maps,
various sources and independently, social media sharing,
services into a single allowing developers and third-party logins,
application. to identify and applications can offer
address issues more a more engaging and
efficiently. feature-rich user
experience.
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Disadvantages of APIs
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Drawbacks of API
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Drawbacks of API
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
RESTful API
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Introduction to RESTful API
● REST is an architectural style and a set of constraints for
designing networked applications.
● In RESTful APIs each request from a client to a server
must contain all the information needed to understand
and process the request.
● In REST, the resources are identified by unique URLs
(Uniform Resource Locators).
● REST uses standard HTTP methods (GET, POST, PUT,
DELETE, etc.) to perform actions on resources.
● RESTful APIs are relatively simple to understand and
use.
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Working of RESTful API
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Working of RESTful API
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
RESTful API Client Request
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
RESTful API Client Request
Cookies
to maintain
session HTTP Method
Accept Header
information GET, POST ,
JSON, XML, or PUT and
HTML DELETE
Authentication
Request Headers
Credentials Authentication
API keys,
tokens,
tokens, or
Content type
username
Client
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
RESTful API Server Response
Error Messages
Response Body
details
explaining the JSON, XML,
issue HTML,
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Advantages of RESTful API
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Advantages of RESTful APIs
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Advantages of RESTful APIs
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Advantages of RESTful APIs
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Disadvantages of RESTful API
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Disadvantages of RESTful APIs
RESTful APIs often While REST is a widely REST does not provide
return fixed data accepted a standardized way of
structures, which can architectural style, handling errors.
lead to overfetching there's no strict
or underfetching. standard for how to
implement it.
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
SOAP API
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Introduction to SOAP API
● SOAP (Simple Object Access Protocol) is a protocol for
exchanging structured information in the
implementation of web services.
● A SOAP API (Application Programming Interface) is an
interface that allows applications to communicate with
each other using the SOAP protocol.
● SOAP is used for sending messages between
applications over various protocols, including HTTP,
SMTP, and more.
● SOAP provides mechanisms for security, including
encryption and authentication, which can be essential
in enterprise-level applications.
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
SOAP API Vs RESTful API
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Difference Between SOAP and REST
Design SOAP API exposes the REST API exposes the data
operation.
Protocol SOAP is independent and REST works only with HTTPS
can work with any transport
protocol.
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Difference Between SOAP and REST
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Summary
Here’s a brief recap:
● APIs are essential tools for enabling seamless communication between software components, offering
streamlining request and response structuring and allowing easy integration of diverse services into
their own applications without starting from scratch.
● SOAP and RESTful are two distinct approaches for designing web APIs, with SOAP being more rigid and
Proprietary content ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.