REST API
Content
1. What is an API
2. What is a REST API
3. REST Architectural Style
i. Architectures
ii. Overview of HTTP
iii. Message Formats
4. How to use REST APIs
What is an API
API - Application Programming Interface
API is a contract. A promise to perform described services when
asked in specific ways.
App
Its a set of functions, classes or objects that software module
exposes for other programs to use by passing arguments (inputs).
Usually API’s are used
to connect the two
different platforms
What is an API
Without APIs
Web app
Mobile apps
Web Server
Database
User
With APIs
Web app
Mobile app
REST API
Database
User
What is a REST API
REST - Representational State Transfer
REST is simply an architectural style achieved by combining a number of
different well-known architectures.
It be used to modify or view resources on the server without
performing any server-side operations.
Client-Server
Client
Server
Response
Request
Stateless
Client
Start Session
Client
ServerEnd Session
Stateless
The state is
managed by
the clientSession use to keep
track of client data
Cacheable
Server
Response
Request
Labeled
Data
Data Labeled
Data
intermediary servers or components Cache
App
Response
No
Yes
If it
cacheable
data
Uniform Interface
Client 1 Client 2 Client 3
API A
JAVA EE
MySQL
API B
.NET
SQL Server
API C
Node JS
Mongo DB
Abstraction
Layered System
Solution
SharedLayer Layer 2
Layer 3
Layer 1
Layered System
Solution
CommonUtilityLayer Business Logic Layer
Presentation Layer
Data Access Layer
Overview of HTTP
The most popular protocol used for RESTful implementations is HTTP.
REST architecture use HTML Verbs to make requests.
HTML Verbs - uniquely address data using a uniform and minimal set of
commands.
• GET - Read data or resources.
• POST - Create data or resource.
• PUT - Update data or resources.
• DELETE - Delete data or resources.
Message Formats
REST is not tied to a specific
message format.
• XML - Extensible Markup
Language
• JSON - JavaScript Object
Notation
<?xml version="1.0" encoding="UTF-8"?>
<Person>
<Name>Matt</Name>
<Surname>Van Der Westhuizen</Surname>
<Hobbies>
<Hobby>Boardgames</Hobby>
<Hobby>GameDev</Hobby>
<Hobby>Reading</Hobby>
</Hobbies>
<PhoneNumbers>
<PhoneNumber>
<Type>home</Type>
<Number>1234567890</Number>
</PhoneNumber>
<PhoneNumber>
<Type>cell</Type>
<Number>0821234567</Number>
</PhoneNumber>
</PhoneNumbers>
</Person>
{
"name": "Matt",
"surname": "Van Der Westhuizen",
"hobbies": [
"Boardgames",
"GameDev",
"Reading"
],
"phoneNumbers": [
{"type": "home", "number": "1234567890"},
{"type": "cell", "number": "0821234567"}
]
}
How to use REST APIs
Here is some examples in Google Map API
https://maps.googleapis.com/maps/api/geocode/json?&address=pitakotte
Extrogene Software Pvt Ltd. Place ID = ChIJS2KQ2d5b4joR4vOh1RaicjQ
https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJS2
KQ2d5b4joR4vOh1RaicjQ&key=AIzaSyBXMUhoE8lu0wjm7SCO9RacyKE-
ef8J0Gw
Kanushka Gayan
SE intern @ Extrogene Software (Pvt) Ltd
kanushkanet@gmail.com
Thank You!

More Related Content

PPTX
REST API
PPTX
Efficient Spring Data REST Development
PDF
Api design and development
PPT
The Rest Architectural Style
PDF
REST API and CRUD
PDF
ReSTful API Final
PPTX
RESTful Architecture
PPTX
Restful web services
REST API
Efficient Spring Data REST Development
Api design and development
The Rest Architectural Style
REST API and CRUD
ReSTful API Final
RESTful Architecture
Restful web services

What's hot (20)

PPTX
What is an API?
PDF
IRJET- Rest API for E-Commerce Site
PDF
REST - Representational State Transfer
ODP
RESTful Web Services
KEY
Rest and the hypermedia constraint
PDF
Representational State Transfer (REST)
PPTX
Web Development
PPTX
PDF
ReST (Representational State Transfer) Explained
PPTX
An Introduction To REST API
PPTX
Database and Web Integration
PPTX
Rest api-basic
PPTX
Rest & RESTful WebServices
PPTX
REST API in Salesforce
DOCX
Application layer assignments
PDF
Representational State Transfer (REST)
PDF
Building social and RESTful frameworks
PPTX
Representational State Transfer
PPTX
REST & RESTful Web Services
PPT
gofortution
What is an API?
IRJET- Rest API for E-Commerce Site
REST - Representational State Transfer
RESTful Web Services
Rest and the hypermedia constraint
Representational State Transfer (REST)
Web Development
ReST (Representational State Transfer) Explained
An Introduction To REST API
Database and Web Integration
Rest api-basic
Rest & RESTful WebServices
REST API in Salesforce
Application layer assignments
Representational State Transfer (REST)
Building social and RESTful frameworks
Representational State Transfer
REST & RESTful Web Services
gofortution
Ad

Similar to REST API (20)

PPTX
Tutorial_Rest_API_For_Beginners_125.pptx
PPTX
REST and RESTful Services
PPTX
rest-api-basics.pptx
PPTX
Api crash
PPTX
Api crash
PPTX
Api crash
PPTX
Api crash
PPTX
Api crash
PPTX
Api crash
PPTX
Api crash
PDF
RESTful applications: The why and how by Maikel Mardjan
PDF
REST API Recommendations
PPTX
A REST API (also called a RESTful API or RESTful web API) is an application p...
PDF
Rest API Interview Questions PDF By ScholarHat
PDF
REST APIS web development for backend familiarity
PPTX
API Development Essentials: REST, SOAP, GraphQL Explained
PPTX
Apitesting.pptx
PPTX
Rest api with node js and express
PPTX
JAX-RS. Developing RESTful APIs with Java
PDF
Web APIs
Tutorial_Rest_API_For_Beginners_125.pptx
REST and RESTful Services
rest-api-basics.pptx
Api crash
Api crash
Api crash
Api crash
Api crash
Api crash
Api crash
RESTful applications: The why and how by Maikel Mardjan
REST API Recommendations
A REST API (also called a RESTful API or RESTful web API) is an application p...
Rest API Interview Questions PDF By ScholarHat
REST APIS web development for backend familiarity
API Development Essentials: REST, SOAP, GraphQL Explained
Apitesting.pptx
Rest api with node js and express
JAX-RS. Developing RESTful APIs with Java
Web APIs
Ad

More from Kanushka Gayan (6)

PPTX
Progressive Web Apps
PPTX
Microservices Architecture
PPTX
Slim 3 PHP micro framework
PPTX
Decorator Design Pattern
PPTX
Factory Design Pattern
Progressive Web Apps
Microservices Architecture
Slim 3 PHP micro framework
Decorator Design Pattern
Factory Design Pattern

Recently uploaded (20)

PDF
LIFE & LIVING TRILOGY - PART - (2) THE PURPOSE OF LIFE.pdf
PDF
fundamentals-of-heat-and-mass-transfer-6th-edition_incropera.pdf
PDF
African Communication Research: A review
PDF
LIFE & LIVING TRILOGY - PART (3) REALITY & MYSTERY.pdf
PDF
Skin Care and Cosmetic Ingredients Dictionary ( PDFDrive ).pdf
PDF
Journal of Dental Science - UDMY (2021).pdf
PPTX
Macbeth play - analysis .pptx english lit
PDF
1.Salivary gland disease.pdf 3.Bleeding and Clotting Disorders.pdf important
PDF
Farming Based Livelihood Systems English Notes
PDF
Everyday Spelling and Grammar by Kathi Wyldeck
PDF
Civil Department's presentation Your score increases as you pick a category
PDF
Journal of Dental Science - UDMY (2020).pdf
PDF
Nurlina - Urban Planner Portfolio (english ver)
PPT
REGULATION OF RESPIRATION lecture note 200L [Autosaved]-1-1.ppt
PDF
faiz-khans about Radiotherapy Physics-02.pdf
PDF
Disorder of Endocrine system (1).pdfyyhyyyy
PDF
PUBH1000 - Module 6: Global Health Tute Slides
PDF
LIFE & LIVING TRILOGY- PART (1) WHO ARE WE.pdf
PDF
Lecture on Viruses: Structure, Classification, Replication, Effects on Cells,...
PPTX
Reproductive system-Human anatomy and physiology
LIFE & LIVING TRILOGY - PART - (2) THE PURPOSE OF LIFE.pdf
fundamentals-of-heat-and-mass-transfer-6th-edition_incropera.pdf
African Communication Research: A review
LIFE & LIVING TRILOGY - PART (3) REALITY & MYSTERY.pdf
Skin Care and Cosmetic Ingredients Dictionary ( PDFDrive ).pdf
Journal of Dental Science - UDMY (2021).pdf
Macbeth play - analysis .pptx english lit
1.Salivary gland disease.pdf 3.Bleeding and Clotting Disorders.pdf important
Farming Based Livelihood Systems English Notes
Everyday Spelling and Grammar by Kathi Wyldeck
Civil Department's presentation Your score increases as you pick a category
Journal of Dental Science - UDMY (2020).pdf
Nurlina - Urban Planner Portfolio (english ver)
REGULATION OF RESPIRATION lecture note 200L [Autosaved]-1-1.ppt
faiz-khans about Radiotherapy Physics-02.pdf
Disorder of Endocrine system (1).pdfyyhyyyy
PUBH1000 - Module 6: Global Health Tute Slides
LIFE & LIVING TRILOGY- PART (1) WHO ARE WE.pdf
Lecture on Viruses: Structure, Classification, Replication, Effects on Cells,...
Reproductive system-Human anatomy and physiology

REST API

  • 2. Content 1. What is an API 2. What is a REST API 3. REST Architectural Style i. Architectures ii. Overview of HTTP iii. Message Formats 4. How to use REST APIs
  • 3. What is an API API - Application Programming Interface API is a contract. A promise to perform described services when asked in specific ways. App
  • 4. Its a set of functions, classes or objects that software module exposes for other programs to use by passing arguments (inputs). Usually API’s are used to connect the two different platforms What is an API
  • 5. Without APIs Web app Mobile apps Web Server Database User
  • 6. With APIs Web app Mobile app REST API Database User
  • 7. What is a REST API REST - Representational State Transfer REST is simply an architectural style achieved by combining a number of different well-known architectures. It be used to modify or view resources on the server without performing any server-side operations.
  • 9. Stateless Client Start Session Client ServerEnd Session Stateless The state is managed by the clientSession use to keep track of client data
  • 10. Cacheable Server Response Request Labeled Data Data Labeled Data intermediary servers or components Cache App Response No Yes If it cacheable data
  • 11. Uniform Interface Client 1 Client 2 Client 3 API A JAVA EE MySQL API B .NET SQL Server API C Node JS Mongo DB Abstraction
  • 13. Layered System Solution CommonUtilityLayer Business Logic Layer Presentation Layer Data Access Layer
  • 14. Overview of HTTP The most popular protocol used for RESTful implementations is HTTP. REST architecture use HTML Verbs to make requests. HTML Verbs - uniquely address data using a uniform and minimal set of commands. • GET - Read data or resources. • POST - Create data or resource. • PUT - Update data or resources. • DELETE - Delete data or resources.
  • 15. Message Formats REST is not tied to a specific message format. • XML - Extensible Markup Language • JSON - JavaScript Object Notation <?xml version="1.0" encoding="UTF-8"?> <Person> <Name>Matt</Name> <Surname>Van Der Westhuizen</Surname> <Hobbies> <Hobby>Boardgames</Hobby> <Hobby>GameDev</Hobby> <Hobby>Reading</Hobby> </Hobbies> <PhoneNumbers> <PhoneNumber> <Type>home</Type> <Number>1234567890</Number> </PhoneNumber> <PhoneNumber> <Type>cell</Type> <Number>0821234567</Number> </PhoneNumber> </PhoneNumbers> </Person> { "name": "Matt", "surname": "Van Der Westhuizen", "hobbies": [ "Boardgames", "GameDev", "Reading" ], "phoneNumbers": [ {"type": "home", "number": "1234567890"}, {"type": "cell", "number": "0821234567"} ] }
  • 16. How to use REST APIs Here is some examples in Google Map API https://maps.googleapis.com/maps/api/geocode/json?&address=pitakotte Extrogene Software Pvt Ltd. Place ID = ChIJS2KQ2d5b4joR4vOh1RaicjQ https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJS2 KQ2d5b4joR4vOh1RaicjQ&key=AIzaSyBXMUhoE8lu0wjm7SCO9RacyKE- ef8J0Gw
  • 17. Kanushka Gayan SE intern @ Extrogene Software (Pvt) Ltd [email protected] Thank You!

Editor's Notes

  • #9: Client Server: This constraint provides separation of concerns, improves scalability and improves the portability of the interface.
  • #10: Stateless: This constraint requires that each request contains sufficient state for the server to understand what to do... this provides visibility, readability and scalability.
  • #11: Cacheable: This constraint requires that all responses from the service to its clients are explicitly labelled as cacheable or non-cacheable so that intermediary servers or components can cache responses. This improves efficiency, scalability and user-perceived performance.
  • #12: Uniform Interface: This constraint defines a simple standard for working with a REST service. It includes identification of resources by URI, manipulation of resources through representation, self-descriptive message and HATEOAS.
  • #13: Layered System: This constraint requires that a client should not be able to tell if it is connected to the end server or to an intermediary. Layered systems cause a reduction in performance, but this should be counteracted by caching.
  • #14: Layered System: This constraint requires that a client should not be able to tell if it is connected to the end server or to an intermediary. Layered systems cause a reduction in performance, but this should be counteracted by caching.