Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
7 views

Session 1 - REST API Design, Development & Management _ Introduction to API

Uploaded by

72 Yash Shinde
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Session 1 - REST API Design, Development & Management _ Introduction to API

Uploaded by

72 Yash Shinde
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 57

REST API Design, Development &

Management

8 Sessions
Of total 24hrs
Starting on 9th Aug 2021
Session 1: Introduction to API

Fundamentals of API

Introduction to REST

REST API Architecture

Open API

REST API Design, Development & Management


What is API? - In simple terms

It’s about connecting dots...


Devices
Applications

There

Here
REST API Design, Development & Management
What is API? - In simple terms

Allows us to..

Order our favourite food

Make reservations

Book a flight

REST API Design, Development & Management


What is API? - Full form

Application Programming Interface

API

REST API Design, Development & Management


What is API? - The textbook definition

As per Wikipedia

An application programming interface (API) is a connection between


computers or between computer programs. It is a type of software
interface, offering a service to other pieces of software.[1] A document or
standard that describes how to build such a connection or interface is
called an API specification. A computer system that meets this standard
is said to implement or expose an API. The term API may refer either to
the specification or to the implementation.

REST API Design, Development & Management


What is API? - Let’s understand

Requests

Response

REST API Design, Development & Management


What is API? - A more familiar example

REST API Design, Development & Management


What is API? - A Real world application

Let’s book a flight

REST API Design, Development & Management


What is API?

ⓘ Start presenting to display the poll results on this slide.

REST API Masterclass


Course Outline

Fundamentals of API REST API Design Principles

REST API Implementation Patterns API Security

OpenAPI Specifications API Management

Deployment Microservices

REST API Design, Development & Management


CoWIN Case Study - The problem

Hospitals or Health Stand in queue


centers

Vaccine 1.3 B

REST API Design, Development & Management


CoWIN Case Study - The solution

Register for vaccine


Check for availability
Get a slot
Download Certificate
Do it for other family members

REST API Design, Development & Management


CoWIN Case Study - APIs
Public APIs
Vaccine availability
Give you alerts from 3rd party apps when
new slots are available
Download certificate

Protected APIs
Book your slot

Reschedule appointment

Vaccination record
REST API Design, Development & Management
CoWIN Case Study - The role of API

https://
cowin.gov.in

api.cowin.gov.i
n

https://api.

3rd Party apps and


websites
JSON

REST API Design, Development & Management


JSON

JavaScript Object Notation

Developed in 2000

Standardized in 2013

REST API Design, Development & Management


Evolution of REST

REST API Design, Development & Management


Local Procedure Calls

REST API Design, Development & Management


Remote Procedure Calls (RPC)

REST API Design, Development & Management


What is REST API?

API: An RPC Mechanism


REST: REpresentational State Transfer

REST API Design, Development & Management


History and evolution of REST
1991 CORBA: Common Object Request Broker Architecture

1998 SOAP: Simple Object Access Protocol

2000 HTTP: XML

HTTP: SOAP / XML

HTTP: JSON

HTTP: REST
REST API Design, Development & Management
Why REST?
Common set of design principles
Best practices for building and managing REST API

Compatible with any data format, ex. XML, JSON etc.

Simplicity & Flexibility

JSON is simple; means for human consumption

REST API Design, Development & Management


What is RPC?

ⓘ Start presenting to display the poll results on this slide.


What is REST?

ⓘ Start presenting to display the poll results on this slide.


What is JSON?

ⓘ Start presenting to display the poll results on this slide.


What makes a API RESTful?
VIN = 123
VIN = 123 Make = Ford
Make = Ford Model = Aspire
Model = Aspire Year = 2020
Year = 2020 Owner = ****

Owner = **** Representational State

VIN = 456
Make = Tata
Model =
Tiago
Year = 2020

Owner = ****

VIN = 789
Make = Tata Representational State
Model = Altroz
Year = 2020

Owner = ****

Representational State
REST API Design, Development & Management
REST Data Formats

HTML Web Browsers

Representational State

JSON
XML Mobile, Web, apps
CSV

REST API Design, Development & Management


Communication Protocol

https://

REST API Design, Development & Management


API is like a _______ that is
used by ________ instead of
_________

ⓘ Start presenting to display the poll results on this slide.


REST MUST use HTTP

ⓘ Start presenting to display the poll results on this slide.


SOAP is a ______ based
protocol

ⓘ Start presenting to display the poll results on this slide.


A Resource in the context of
REST is (or may be)
________

ⓘ Start presenting to display the poll results on this slide.


In order to invoke an API on developer
console most API provider requires the
developer to get __________

ⓘ Start presenting to display the poll results on this slide.


Money withdrawn from an
account is an example of
________

ⓘ Start presenting to display the poll results on this slide.


RESTful API make use of
the HTTP ______

ⓘ Start presenting to display the poll results on this slide.

geogo.in
REST Architecture

REST API Design, Development & Management


REST Architecture Constraints

Is your Architecture RESTful?

RESTFul
HTTP JSON
Architecture

REST API Design, Development & Management


REST Architecture Constraints
What makes Architecture
RESTful?
Client Server
Uniform Interface
6 Design Rules Statelessness
Caching
Layering
Code On Demand
REST API Design, Development & Management
REST Arch. Constraint - Client-Server

“REST application should have client-server


architecture”
“client-server should not run in same
process”

REST API Design, Development & Management


Client-Server - Separation of concerns

Authentication

Uniform Interface
Security

Authorization Performance

Scaling
Multi-form factor

REST API Design, Development & Management


REST Arch. Constraint - Uniform Interface
“Client & server share a common Technical
interface”
1. Individual requests are identified in the Request
(URI/URL)
2. Representation of the Resources
3. Self-descriptive messages - metadata
4. Hypermedia

REST API Design, Development & Management


REST Arch. Constraint - Statelessness
“Client must manage it’s own state thus
making the server stateless”

REST API Design, Development & Management


REST Arch. Constraint - Caching

Increased calls

Request data size

Performance

REST API Design, Development & Management


REST Arch. Constraint - Caching
“Use Caching to achieve higher Scalability &
Performance”

gateway/proxy

DB Caching
Application
Caching Server
Caching

REST API Design, Development & Management


REST Arch. Constraint - Layered Arch.

Web Tier

App Tier Database Tier

REST API Design, Development & Management


Layered Arch. Benefits

1. Layering simplifies the architecture - reduced


dependencies.

2. The architecture may evolve with changing


needs

3. Layer changes at most impacts ONLY one


other layer

REST API Design, Development & Management


REST Arch. Constraint - Code on Demand
“Server can extend the functionality of client
by sending Code”

“Hypertext As The Engine Of Application State.”

REST API Design, Development & Management


Which of the following constraint
suggest that mid tier must manage the
state of the REST API?

ⓘ Start presenting to display the poll results on this slide.


Client Server Architectural
Constraint leads to

ⓘ Start presenting to display the poll results on this slide.


All REST API resources are
identified by a __________

ⓘ Start presenting to display the poll results on this slide.


Which would be the preferred way to
design the endpoint for retrieving a
specific car by VIN (vehicle Identification
number that is unique for every car)

ⓘ Start presenting to display the poll results on this slide.


Which of the following
architectural constraint is
optional?

ⓘ Start presenting to display the poll results on this slide.


Caching should be implemented by
server in the mid tier to manage the
state of the client

ⓘ Start presenting to display the poll results on this slide.


Which if the following constraints
counterbalance the negative impact of the
statelessness constraint?`

ⓘ Start presenting to display the poll results on this slide.


Which one the following is
not a benefit of Layered
architecture?

ⓘ Start presenting to display the poll results on this slide.


The Client Server constraint refers to a
style in which the common concerns of
the server and client are identified and
managed by the developer

ⓘ Start presenting to display the poll results on this slide.


Thank you!

REST API Design, Development & Management

You might also like