SlideShare a Scribd company logo
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!
Ad

More Related Content

What's hot (20)

What is an API?
What is an API?What is an API?
What is an API?
Muhammad Zuhdi
 
IRJET- Rest API for E-Commerce Site
IRJET- Rest API for E-Commerce SiteIRJET- Rest API for E-Commerce Site
IRJET- Rest API for E-Commerce Site
IRJET Journal
 
REST - Representational State Transfer
REST - Representational State TransferREST - Representational State Transfer
REST - Representational State Transfer
Peter R. Egli
 
RESTful Web Services
RESTful Web ServicesRESTful Web Services
RESTful Web Services
Imran M Yousuf
 
Rest and the hypermedia constraint
Rest and the hypermedia constraintRest and the hypermedia constraint
Rest and the hypermedia constraint
Inviqa
 
Representational State Transfer (REST)
Representational State Transfer (REST)Representational State Transfer (REST)
Representational State Transfer (REST)
Abhay Ananda Shukla
 
Web Development
Web DevelopmentWeb Development
Web Development
SabahtHussein
 
Restful web services ppt
Restful web services pptRestful web services ppt
Restful web services ppt
OECLIB Odisha Electronics Control Library
 
ReST (Representational State Transfer) Explained
ReST (Representational State Transfer) ExplainedReST (Representational State Transfer) Explained
ReST (Representational State Transfer) Explained
Dhananjay Nene
 
An Introduction To REST API
An Introduction To REST APIAn Introduction To REST API
An Introduction To REST API
Aniruddh Bhilvare
 
Database and Web Integration
Database and Web IntegrationDatabase and Web Integration
Database and Web Integration
SabahtHussein
 
Rest api-basic
Rest api-basicRest api-basic
Rest api-basic
Amila Sampath
 
Rest & RESTful WebServices
Rest & RESTful WebServicesRest & RESTful WebServices
Rest & RESTful WebServices
Prateek Tandon
 
REST API in Salesforce
REST API in SalesforceREST API in Salesforce
REST API in Salesforce
Vivek Deepak
 
Application layer assignments
Application layer assignmentsApplication layer assignments
Application layer assignments
Isaac Akingbala
 
Representational State Transfer (REST)
Representational State Transfer (REST)Representational State Transfer (REST)
Representational State Transfer (REST)
David Krmpotic
 
Building social and RESTful frameworks
Building social and RESTful frameworksBuilding social and RESTful frameworks
Building social and RESTful frameworks
brendonschwartz
 
Representational State Transfer
Representational State TransferRepresentational State Transfer
Representational State Transfer
Alexei Skachykhin
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
Halil Burak Cetinkaya
 
gofortution
gofortutiongofortution
gofortution
gofortution
 
IRJET- Rest API for E-Commerce Site
IRJET- Rest API for E-Commerce SiteIRJET- Rest API for E-Commerce Site
IRJET- Rest API for E-Commerce Site
IRJET Journal
 
REST - Representational State Transfer
REST - Representational State TransferREST - Representational State Transfer
REST - Representational State Transfer
Peter R. Egli
 
Rest and the hypermedia constraint
Rest and the hypermedia constraintRest and the hypermedia constraint
Rest and the hypermedia constraint
Inviqa
 
Representational State Transfer (REST)
Representational State Transfer (REST)Representational State Transfer (REST)
Representational State Transfer (REST)
Abhay Ananda Shukla
 
ReST (Representational State Transfer) Explained
ReST (Representational State Transfer) ExplainedReST (Representational State Transfer) Explained
ReST (Representational State Transfer) Explained
Dhananjay Nene
 
Database and Web Integration
Database and Web IntegrationDatabase and Web Integration
Database and Web Integration
SabahtHussein
 
Rest & RESTful WebServices
Rest & RESTful WebServicesRest & RESTful WebServices
Rest & RESTful WebServices
Prateek Tandon
 
REST API in Salesforce
REST API in SalesforceREST API in Salesforce
REST API in Salesforce
Vivek Deepak
 
Application layer assignments
Application layer assignmentsApplication layer assignments
Application layer assignments
Isaac Akingbala
 
Representational State Transfer (REST)
Representational State Transfer (REST)Representational State Transfer (REST)
Representational State Transfer (REST)
David Krmpotic
 
Building social and RESTful frameworks
Building social and RESTful frameworksBuilding social and RESTful frameworks
Building social and RESTful frameworks
brendonschwartz
 
Representational State Transfer
Representational State TransferRepresentational State Transfer
Representational State Transfer
Alexei Skachykhin
 

Similar to REST API (20)

Phalcon 2 High Performance APIs - DevWeekPOA 2015
Phalcon 2 High Performance APIs - DevWeekPOA 2015Phalcon 2 High Performance APIs - DevWeekPOA 2015
Phalcon 2 High Performance APIs - DevWeekPOA 2015
Jackson F. de A. Mafra
 
Xamarin Workshop Noob to Master – Week 5
Xamarin Workshop Noob to Master – Week 5Xamarin Workshop Noob to Master – Week 5
Xamarin Workshop Noob to Master – Week 5
Charlin Agramonte
 
Salesforce Integration
Salesforce IntegrationSalesforce Integration
Salesforce Integration
Er. Prashant Veer Singh
 
Apitesting.pptx
Apitesting.pptxApitesting.pptx
Apitesting.pptx
NamanVerma88
 
Rest API Automation with REST Assured
Rest API Automation with REST AssuredRest API Automation with REST Assured
Rest API Automation with REST Assured
TO THE NEW Pvt. Ltd.
 
Switch to Backend 2023 | Day 1 Part 1
Switch to Backend 2023 | Day 1 Part 1Switch to Backend 2023 | Day 1 Part 1
Switch to Backend 2023 | Day 1 Part 1
Google Developer Students Club NIT Silchar
 
Switch to Backend 2023
Switch to Backend 2023Switch to Backend 2023
Switch to Backend 2023
Google Developer Students Club NIT Silchar
 
Network Device Database Management with REST using Jersey
Network Device Database Management with REST using JerseyNetwork Device Database Management with REST using Jersey
Network Device Database Management with REST using Jersey
Payal Jain
 
C# REST API
C# REST APIC# REST API
C# REST API
Simplilearn
 
API Testing Basics.pptx
API Testing Basics.pptxAPI Testing Basics.pptx
API Testing Basics.pptx
VikasGupta92111
 
About HTTP and REST
About HTTP and RESTAbout HTTP and REST
About HTTP and REST
Maggie Georgieva
 
Session 8 Android Web Services - Part 1.pdf
Session 8 Android Web Services - Part 1.pdfSession 8 Android Web Services - Part 1.pdf
Session 8 Android Web Services - Part 1.pdf
EngmohammedAlzared
 
Api 101
Api 101Api 101
Api 101
DrSimoneDiCola
 
Salesforce REST API
Salesforce  REST API Salesforce  REST API
Salesforce REST API
Bohdan Dovhań
 
WebApp #3 : API
WebApp #3 : APIWebApp #3 : API
WebApp #3 : API
Jean Michel
 
53 hui homework2
53 hui homework253 hui homework2
53 hui homework2
huis89
 
Creating Web Services with Zend Framework - Matthew Turland
Creating Web Services with Zend Framework - Matthew TurlandCreating Web Services with Zend Framework - Matthew Turland
Creating Web Services with Zend Framework - Matthew Turland
Matthew Turland
 
Best practices and advantages of REST APIs
Best practices and advantages of REST APIsBest practices and advantages of REST APIs
Best practices and advantages of REST APIs
Aparna Sharma
 
Web Service
Web ServiceWeb Service
Web Service
Ashwani kumar
 
A Conversation About REST
A Conversation About RESTA Conversation About REST
A Conversation About REST
Jeremy Brown
 
Phalcon 2 High Performance APIs - DevWeekPOA 2015
Phalcon 2 High Performance APIs - DevWeekPOA 2015Phalcon 2 High Performance APIs - DevWeekPOA 2015
Phalcon 2 High Performance APIs - DevWeekPOA 2015
Jackson F. de A. Mafra
 
Xamarin Workshop Noob to Master – Week 5
Xamarin Workshop Noob to Master – Week 5Xamarin Workshop Noob to Master – Week 5
Xamarin Workshop Noob to Master – Week 5
Charlin Agramonte
 
Rest API Automation with REST Assured
Rest API Automation with REST AssuredRest API Automation with REST Assured
Rest API Automation with REST Assured
TO THE NEW Pvt. Ltd.
 
Network Device Database Management with REST using Jersey
Network Device Database Management with REST using JerseyNetwork Device Database Management with REST using Jersey
Network Device Database Management with REST using Jersey
Payal Jain
 
Session 8 Android Web Services - Part 1.pdf
Session 8 Android Web Services - Part 1.pdfSession 8 Android Web Services - Part 1.pdf
Session 8 Android Web Services - Part 1.pdf
EngmohammedAlzared
 
53 hui homework2
53 hui homework253 hui homework2
53 hui homework2
huis89
 
Creating Web Services with Zend Framework - Matthew Turland
Creating Web Services with Zend Framework - Matthew TurlandCreating Web Services with Zend Framework - Matthew Turland
Creating Web Services with Zend Framework - Matthew Turland
Matthew Turland
 
Best practices and advantages of REST APIs
Best practices and advantages of REST APIsBest practices and advantages of REST APIs
Best practices and advantages of REST APIs
Aparna Sharma
 
A Conversation About REST
A Conversation About RESTA Conversation About REST
A Conversation About REST
Jeremy Brown
 
Ad

More from Kanushka Gayan (6)

Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
Kanushka Gayan
 
Microservices Architecture
Microservices ArchitectureMicroservices Architecture
Microservices Architecture
Kanushka Gayan
 
Git
GitGit
Git
Kanushka Gayan
 
Slim 3 PHP micro framework
Slim 3 PHP micro frameworkSlim 3 PHP micro framework
Slim 3 PHP micro framework
Kanushka Gayan
 
Decorator Design Pattern
Decorator Design PatternDecorator Design Pattern
Decorator Design Pattern
Kanushka Gayan
 
Factory Design Pattern
Factory Design PatternFactory Design Pattern
Factory Design Pattern
Kanushka Gayan
 
Ad

Recently uploaded (20)

How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Celine George
 
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Library Association of Ireland
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
Operations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdfOperations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdf
Arab Academy for Science, Technology and Maritime Transport
 
LDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini UpdatesLDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini Updates
LDM Mia eStudios
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
SPRING FESTIVITIES - UK AND USA -
SPRING FESTIVITIES - UK AND USA            -SPRING FESTIVITIES - UK AND USA            -
SPRING FESTIVITIES - UK AND USA -
Colégio Santa Teresinha
 
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdfExploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Sandeep Swamy
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
Social Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy StudentsSocial Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy Students
DrNidhiAgarwal
 
New Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptxNew Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptx
milanasargsyan5
 
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdfBiophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
PKLI-Institute of Nursing and Allied Health Sciences Lahore , Pakistan.
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
Introduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe EngineeringIntroduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe Engineering
Damian T. Gordon
 
Quality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdfQuality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdf
Dr. Bindiya Chauhan
 
How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Celine George
 
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Library Association of Ireland
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
LDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini UpdatesLDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini Updates
LDM Mia eStudios
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdfExploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Sandeep Swamy
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
Social Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy StudentsSocial Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy Students
DrNidhiAgarwal
 
New Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptxNew Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptx
milanasargsyan5
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
Introduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe EngineeringIntroduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe Engineering
Damian T. Gordon
 
Quality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdfQuality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdf
Dr. Bindiya Chauhan
 

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.