SlideShare a Scribd company logo
REST API
By Devi Kiran
KickStartPros.com
contact@kickstartpros.com
• JSON1
• REST API2
• JS libs and Play3
Agenda
JSON
• JSON = JavaScript Object Notation
• Lightweight data interchange format
• Organization with Employees
REST API & DESIGN
What is REST?
• REST = REpresentational State Transfer
• Architectural Constraints
– Client-Server
– Uniform Interface
– Stateless
– Cacheable
– Layered System
– Code on demand
REST - Resource Based
REST
• Nouns, Not Verbs
• Things are identified by
URIs
• Person, User, Address
resource
• HTTP Verb to dictate the
operation on that resource.
• Multiple URIs pointing to
same resource.
SOAP - RPC
• Verbs or Actions.
• RPC calls (Don’t do this in
REST)
– getUserData
– getAllUsers
– searchUsers
– getUserAddress
– updateUserAddress
– deleteUser
Representations
• Represent part of the
resource state.
• JSON or XML
• Example: Buy a car
– Resource: Car (Audi A1)
– Service: Buy (POST)
– Representation:
• Name, Model, Price
• JSON or XML format.
REST API Design
Different REST Clients
iPhone App
Browser/
Web
Android App DELETE
PUT
GET
POST
CUSTOM
Params
Http
Methods
Your App Server
Load balanced
App
Server 1
App
Server
App
Server
App
Server
1…n
KickStartPros.com
Http/s
JSON/XML
JSON/XML
JSON/XML
HTTP Methods & Status Codes
• GET
• HEAD
• POST
• PUT
• DELETE
• TRACE
• OPTIONS
• 2xx Success
– 200 Ok
– 204 No Content
• 3xx Redirect
– 304 Not Modified
• 4xx Client Error
– 400 Bad Request
– 401 Unauthorized
– 403 Forbidden
– 404 Not Found
• 5xx Server Error
– 500 Internal Server Error
Keep Http/s Simple
• Resources – URI format
– Collection Resources (/users)
– Instance Resources (/users/ayl23d)
• Behavior
– Use Http Methods => CURD Database/Server Actions
– POST => Create
– GET => Read
– PUT => Update
– DELETE => Delete
– HEAD => Headers, no body
• Media types
– application/json
– application/xml
Post for Create
POST /users
{
“name” : “Kiran”
}
Response:
201 Created
Location:
http://www.kickstartpros.com/users/gdk23
Put for Update
PUT /users/<userId>
PUT /users/gdk23
{
“name” : “Devi Kiran”
“description”: “Trainer”
}
Post for Update
POST /users/<userId>
POST /users/gdk23
{
“name”: “Devi Kiran”
}
(Partial update or Full update)
Response:
200 OK
ARCHITECTURAL
CONSTRAINTS
Client and Server
• Uniform Interface Decouples Client and
Server
• Design – http and URIs
– HTTP verbs (GET, PUT, POST, DELETE)
– URIs
– HTTP response
• Status
• Body
Uniform interface
• The uniform interface decouples client and
Server
– Identification of resources
– Manipulation of resources through these
representations
– Self-descriptive messages
HATEOAS
• Hypermedia as the engine of application state
• Client to Server
– Body Content
– URI and Query String parameters
– Request Headers
• Server
– Body Content
– Response Codes
– Response Headers
Stateless
• No client state at server.
• Any State is maintained
at Client side.
• Each request has all the
information to process
the request.
Client
1
Client
2
Client
3
Servers
More …
• Layered System
– A client cannot tell
whether it is connected
directly to the server.
– Load balanced Servers
– More Performance
• Cacheable
– Implicit
– Explicit
REST APIS & PLAY
Example URIs
• GMail Rest API (v1 Reference by resource
type)
• Custom REST API from Yahoo
– https://developer.yahoo.com/yql/console/
– Example: get san francisco geo data:
select * from geo.places where text=“san francisco,
ca”
UI Data binding of REST API
• JQuery – Ajax calls
• Data Binding JS libs that help to bind with REST
response
– JQuery UI – Widgets
– Knockout – Model-View-ViewModel (MVVM)
– Angular JS – MVVM & MVC
– Backbone.js – RESTful JSON interface
– Ember.js – Template language, MVC and a router
– Kendo UI – MVVM
– Extjs – MVC (Model View Controller) & widgets
Summary & Reference
• JSON & REST Architecture
• Resource based REST API = Micro Services (SOA)
• REST API & Examples with JS libs
• Reference – Wiki
• contact@kickstartpros.com
– Join our trainings.
– Kick Start your project with us.
Ad

More Related Content

What's hot (20)

Getting Started with API Standardization in SwaggerHub
Getting Started with API Standardization in SwaggerHubGetting Started with API Standardization in SwaggerHub
Getting Started with API Standardization in SwaggerHub
SmartBear
 
What is Continuous Integration? | Continuous Integration with Jenkins | DevOp...
What is Continuous Integration? | Continuous Integration with Jenkins | DevOp...What is Continuous Integration? | Continuous Integration with Jenkins | DevOp...
What is Continuous Integration? | Continuous Integration with Jenkins | DevOp...
Edureka!
 
Deep-Dive: Secure API Management
Deep-Dive: Secure API ManagementDeep-Dive: Secure API Management
Deep-Dive: Secure API Management
Apigee | Google Cloud
 
API Testing. Streamline your testing process.
API Testing. Streamline your testing process.API Testing. Streamline your testing process.
API Testing. Streamline your testing process.
Andrey Oleynik
 
Jfrog artifactory as private docker registry
Jfrog artifactory as private docker registryJfrog artifactory as private docker registry
Jfrog artifactory as private docker registry
Vipin Mandale
 
API Test Automation
API Test Automation API Test Automation
API Test Automation
SQALab
 
What is an API Gateway?
What is an API Gateway?What is an API Gateway?
What is an API Gateway?
LunchBadger
 
Kinh nghiệm triển khai CI/CD tại cong ty SaaS phục vụ 70M người dùng
Kinh nghiệm triển khai CI/CD tại cong ty SaaS phục vụ 70M người dùngKinh nghiệm triển khai CI/CD tại cong ty SaaS phục vụ 70M người dùng
Kinh nghiệm triển khai CI/CD tại cong ty SaaS phục vụ 70M người dùng
Stringee JSC
 
Introduction to Kong API Gateway
Introduction to Kong API GatewayIntroduction to Kong API Gateway
Introduction to Kong API Gateway
Yohann Ciurlik
 
DevOps vs Agile | DevOps Tutorial For Beginners | DevOps Training | Edureka
DevOps vs Agile | DevOps Tutorial For Beginners | DevOps Training | EdurekaDevOps vs Agile | DevOps Tutorial For Beginners | DevOps Training | Edureka
DevOps vs Agile | DevOps Tutorial For Beginners | DevOps Training | Edureka
Edureka!
 
API Maturity Model (Webcast with Accenture)
API Maturity Model (Webcast with Accenture)API Maturity Model (Webcast with Accenture)
API Maturity Model (Webcast with Accenture)
Apigee | Google Cloud
 
API Strategy Introduction
API Strategy IntroductionAPI Strategy Introduction
API Strategy Introduction
Doug Gregory
 
Architecture for the API-enterprise
Architecture for the API-enterpriseArchitecture for the API-enterprise
Architecture for the API-enterprise
Apigee | Google Cloud
 
Introduction to E2E in Cypress
Introduction to E2E in CypressIntroduction to E2E in Cypress
Introduction to E2E in Cypress
Fabio Biondi
 
REST API testing with SpecFlow
REST API testing with SpecFlowREST API testing with SpecFlow
REST API testing with SpecFlow
Aiste Stikliute
 
DevOps, por onde começar
DevOps, por onde começarDevOps, por onde começar
DevOps, por onde começar
Adriano Tavares
 
DevOps
DevOpsDevOps
DevOps
Gehad Elsayed
 
What is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | EdurekaWhat is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | Edureka
Edureka!
 
Devops Strategy Roadmap Lifecycle Ppt Powerpoint Presentation Slides Complete...
Devops Strategy Roadmap Lifecycle Ppt Powerpoint Presentation Slides Complete...Devops Strategy Roadmap Lifecycle Ppt Powerpoint Presentation Slides Complete...
Devops Strategy Roadmap Lifecycle Ppt Powerpoint Presentation Slides Complete...
SlideTeam
 
Testing microservices with rest assured
Testing microservices with rest assuredTesting microservices with rest assured
Testing microservices with rest assured
Kushan Shalindra Amarasiri - Technical QE Specialist
 
Getting Started with API Standardization in SwaggerHub
Getting Started with API Standardization in SwaggerHubGetting Started with API Standardization in SwaggerHub
Getting Started with API Standardization in SwaggerHub
SmartBear
 
What is Continuous Integration? | Continuous Integration with Jenkins | DevOp...
What is Continuous Integration? | Continuous Integration with Jenkins | DevOp...What is Continuous Integration? | Continuous Integration with Jenkins | DevOp...
What is Continuous Integration? | Continuous Integration with Jenkins | DevOp...
Edureka!
 
API Testing. Streamline your testing process.
API Testing. Streamline your testing process.API Testing. Streamline your testing process.
API Testing. Streamline your testing process.
Andrey Oleynik
 
Jfrog artifactory as private docker registry
Jfrog artifactory as private docker registryJfrog artifactory as private docker registry
Jfrog artifactory as private docker registry
Vipin Mandale
 
API Test Automation
API Test Automation API Test Automation
API Test Automation
SQALab
 
What is an API Gateway?
What is an API Gateway?What is an API Gateway?
What is an API Gateway?
LunchBadger
 
Kinh nghiệm triển khai CI/CD tại cong ty SaaS phục vụ 70M người dùng
Kinh nghiệm triển khai CI/CD tại cong ty SaaS phục vụ 70M người dùngKinh nghiệm triển khai CI/CD tại cong ty SaaS phục vụ 70M người dùng
Kinh nghiệm triển khai CI/CD tại cong ty SaaS phục vụ 70M người dùng
Stringee JSC
 
Introduction to Kong API Gateway
Introduction to Kong API GatewayIntroduction to Kong API Gateway
Introduction to Kong API Gateway
Yohann Ciurlik
 
DevOps vs Agile | DevOps Tutorial For Beginners | DevOps Training | Edureka
DevOps vs Agile | DevOps Tutorial For Beginners | DevOps Training | EdurekaDevOps vs Agile | DevOps Tutorial For Beginners | DevOps Training | Edureka
DevOps vs Agile | DevOps Tutorial For Beginners | DevOps Training | Edureka
Edureka!
 
API Maturity Model (Webcast with Accenture)
API Maturity Model (Webcast with Accenture)API Maturity Model (Webcast with Accenture)
API Maturity Model (Webcast with Accenture)
Apigee | Google Cloud
 
API Strategy Introduction
API Strategy IntroductionAPI Strategy Introduction
API Strategy Introduction
Doug Gregory
 
Introduction to E2E in Cypress
Introduction to E2E in CypressIntroduction to E2E in Cypress
Introduction to E2E in Cypress
Fabio Biondi
 
REST API testing with SpecFlow
REST API testing with SpecFlowREST API testing with SpecFlow
REST API testing with SpecFlow
Aiste Stikliute
 
DevOps, por onde começar
DevOps, por onde começarDevOps, por onde começar
DevOps, por onde começar
Adriano Tavares
 
What is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | EdurekaWhat is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | Edureka
Edureka!
 
Devops Strategy Roadmap Lifecycle Ppt Powerpoint Presentation Slides Complete...
Devops Strategy Roadmap Lifecycle Ppt Powerpoint Presentation Slides Complete...Devops Strategy Roadmap Lifecycle Ppt Powerpoint Presentation Slides Complete...
Devops Strategy Roadmap Lifecycle Ppt Powerpoint Presentation Slides Complete...
SlideTeam
 

Viewers also liked (19)

Rest api design by george reese
Rest api design by george reeseRest api design by george reese
Rest api design by george reese
buildacloud
 
Final Master's Defense Presentation : Policy-driven Security Management in Ga...
Final Master's Defense Presentation : Policy-driven Security Management in Ga...Final Master's Defense Presentation : Policy-driven Security Management in Ga...
Final Master's Defense Presentation : Policy-driven Security Management in Ga...
Clinton DSouza
 
REST in short
REST in shortREST in short
REST in short
Akshay Ballarpure
 
Introduction to REST API with Node.js
Introduction to REST API with Node.jsIntroduction to REST API with Node.js
Introduction to REST API with Node.js
Yoann Gotthilf
 
Laravel Restful API and AngularJS
Laravel Restful API and AngularJSLaravel Restful API and AngularJS
Laravel Restful API and AngularJS
Blake Newman
 
How to connect AngularJS to servers
How to connect AngularJS to serversHow to connect AngularJS to servers
How to connect AngularJS to servers
Carlos Morales
 
Angularjs & REST
Angularjs & RESTAngularjs & REST
Angularjs & REST
Corley S.r.l.
 
How to Release Rock-solid RESTful APIs and Ice the Testing BackBlob
How to Release Rock-solid RESTful APIs and Ice the Testing BackBlobHow to Release Rock-solid RESTful APIs and Ice the Testing BackBlob
How to Release Rock-solid RESTful APIs and Ice the Testing BackBlob
Bob Binder
 
Datasnap avançado - Respostas para um sistema robusto - Embarcadero Conferenc...
Datasnap avançado - Respostas para um sistema robusto - Embarcadero Conferenc...Datasnap avançado - Respostas para um sistema robusto - Embarcadero Conferenc...
Datasnap avançado - Respostas para um sistema robusto - Embarcadero Conferenc...
Kelver Merlotti
 
Kuasmun second class - ROP
Kuasmun second class - ROPKuasmun second class - ROP
Kuasmun second class - ROP
kuasmun_2014
 
Dr browns
Dr brownsDr browns
Dr browns
pospelov72
 
CrowdTruth @DIR2015
CrowdTruth @DIR2015CrowdTruth @DIR2015
CrowdTruth @DIR2015
Anca Dumitrache
 
Linden lab
Linden labLinden lab
Linden lab
Ankur Mukherjee
 
Royale Business Presentation 2014 - U.S.A Distributor
Royale Business Presentation 2014 - U.S.A DistributorRoyale Business Presentation 2014 - U.S.A Distributor
Royale Business Presentation 2014 - U.S.A Distributor
Nikki Albright
 
CCA EAP Capabilities
CCA EAP CapabilitiesCCA EAP Capabilities
CCA EAP Capabilities
CCA Inc
 
Oregon Rural Entrepreneurship Development Initiative REDI
Oregon Rural Entrepreneurship Development Initiative REDIOregon Rural Entrepreneurship Development Initiative REDI
Oregon Rural Entrepreneurship Development Initiative REDI
Heather Stafford
 
Khopoli & khalapur project market anaylsis consolidated
Khopoli & khalapur project market anaylsis consolidatedKhopoli & khalapur project market anaylsis consolidated
Khopoli & khalapur project market anaylsis consolidated
sunil seth kakkad
 
INDUSTRIAL DEVELOPMENT SIZING & PRICING IN INDIA FOR INDUSTRIAL TOWNSHIP IN...
INDUSTRIAL DEVELOPMENT  SIZING & PRICING IN INDIA FOR  INDUSTRIAL TOWNSHIP IN...INDUSTRIAL DEVELOPMENT  SIZING & PRICING IN INDIA FOR  INDUSTRIAL TOWNSHIP IN...
INDUSTRIAL DEVELOPMENT SIZING & PRICING IN INDIA FOR INDUSTRIAL TOWNSHIP IN...
sunil seth kakkad
 
Rest api design by george reese
Rest api design by george reeseRest api design by george reese
Rest api design by george reese
buildacloud
 
Final Master's Defense Presentation : Policy-driven Security Management in Ga...
Final Master's Defense Presentation : Policy-driven Security Management in Ga...Final Master's Defense Presentation : Policy-driven Security Management in Ga...
Final Master's Defense Presentation : Policy-driven Security Management in Ga...
Clinton DSouza
 
Introduction to REST API with Node.js
Introduction to REST API with Node.jsIntroduction to REST API with Node.js
Introduction to REST API with Node.js
Yoann Gotthilf
 
Laravel Restful API and AngularJS
Laravel Restful API and AngularJSLaravel Restful API and AngularJS
Laravel Restful API and AngularJS
Blake Newman
 
How to connect AngularJS to servers
How to connect AngularJS to serversHow to connect AngularJS to servers
How to connect AngularJS to servers
Carlos Morales
 
How to Release Rock-solid RESTful APIs and Ice the Testing BackBlob
How to Release Rock-solid RESTful APIs and Ice the Testing BackBlobHow to Release Rock-solid RESTful APIs and Ice the Testing BackBlob
How to Release Rock-solid RESTful APIs and Ice the Testing BackBlob
Bob Binder
 
Datasnap avançado - Respostas para um sistema robusto - Embarcadero Conferenc...
Datasnap avançado - Respostas para um sistema robusto - Embarcadero Conferenc...Datasnap avançado - Respostas para um sistema robusto - Embarcadero Conferenc...
Datasnap avançado - Respostas para um sistema robusto - Embarcadero Conferenc...
Kelver Merlotti
 
Kuasmun second class - ROP
Kuasmun second class - ROPKuasmun second class - ROP
Kuasmun second class - ROP
kuasmun_2014
 
Royale Business Presentation 2014 - U.S.A Distributor
Royale Business Presentation 2014 - U.S.A DistributorRoyale Business Presentation 2014 - U.S.A Distributor
Royale Business Presentation 2014 - U.S.A Distributor
Nikki Albright
 
CCA EAP Capabilities
CCA EAP CapabilitiesCCA EAP Capabilities
CCA EAP Capabilities
CCA Inc
 
Oregon Rural Entrepreneurship Development Initiative REDI
Oregon Rural Entrepreneurship Development Initiative REDIOregon Rural Entrepreneurship Development Initiative REDI
Oregon Rural Entrepreneurship Development Initiative REDI
Heather Stafford
 
Khopoli & khalapur project market anaylsis consolidated
Khopoli & khalapur project market anaylsis consolidatedKhopoli & khalapur project market anaylsis consolidated
Khopoli & khalapur project market anaylsis consolidated
sunil seth kakkad
 
INDUSTRIAL DEVELOPMENT SIZING & PRICING IN INDIA FOR INDUSTRIAL TOWNSHIP IN...
INDUSTRIAL DEVELOPMENT  SIZING & PRICING IN INDIA FOR  INDUSTRIAL TOWNSHIP IN...INDUSTRIAL DEVELOPMENT  SIZING & PRICING IN INDIA FOR  INDUSTRIAL TOWNSHIP IN...
INDUSTRIAL DEVELOPMENT SIZING & PRICING IN INDIA FOR INDUSTRIAL TOWNSHIP IN...
sunil seth kakkad
 
Ad

Similar to REST API Design (20)

REST API Recommendations
REST API RecommendationsREST API Recommendations
REST API Recommendations
Jeelani Shaik
 
Rest
RestRest
Rest
NagaNikhil Sambu
 
Introduction to Restful Web Services
Introduction to Restful Web ServicesIntroduction to Restful Web Services
Introduction to Restful Web Services
weili_at_slideshare
 
Introduction to REST - REST Basics - JSON
Introduction to REST - REST Basics - JSONIntroduction to REST - REST Basics - JSON
Introduction to REST - REST Basics - JSON
Matrix823409
 
07-IM-REST-json.pdf slide for restapi explaination
07-IM-REST-json.pdf slide for restapi explaination07-IM-REST-json.pdf slide for restapi explaination
07-IM-REST-json.pdf slide for restapi explaination
EngjellRrapaj
 
An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST
Ram Awadh Prasad, PMP
 
RESTful Web Service using Swagger
RESTful Web Service using SwaggerRESTful Web Service using Swagger
RESTful Web Service using Swagger
Hong-Jhih Lin
 
REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)
Jef Claes
 
Research Topics in Machine Hypermedia
Research Topics in Machine HypermediaResearch Topics in Machine Hypermedia
Research Topics in Machine Hypermedia
Michael Koster
 
Rest presentation
Rest  presentationRest  presentation
Rest presentation
srividhyau
 
On being RESTful
On being RESTfulOn being RESTful
On being RESTful
Fabio Mancinelli
 
A REST API (also called a RESTful API or RESTful web API) is an application p...
A REST API (also called a RESTful API or RESTful web API) is an application p...A REST API (also called a RESTful API or RESTful web API) is an application p...
A REST API (also called a RESTful API or RESTful web API) is an application p...
Kongu Engineering College, Perundurai, Erode
 
CakeFest 2013 - A-Z REST APIs
CakeFest 2013 - A-Z REST APIsCakeFest 2013 - A-Z REST APIs
CakeFest 2013 - A-Z REST APIs
anthony_putignano
 
CakeFest 2013 - A-Z REST APIs
CakeFest 2013 - A-Z REST APIsCakeFest 2013 - A-Z REST APIs
CakeFest 2013 - A-Z REST APIs
anthony_putignano
 
Service-oriented software engineering & APIs
Service-oriented software engineering & APIsService-oriented software engineering & APIs
Service-oriented software engineering & APIs
Matrix823409
 
API Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNGAPI Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNG
Siddharth Sharma
 
Overview of REST - Raihan Ullah
Overview of REST - Raihan UllahOverview of REST - Raihan Ullah
Overview of REST - Raihan Ullah
Cefalo
 
REST API and CRUD
REST API and CRUDREST API and CRUD
REST API and CRUD
Prem Sanil
 
Java Web services
Java Web servicesJava Web services
Java Web services
Sujit Kumar
 
REST APIs
REST APIsREST APIs
REST APIs
Arthur De Magalhaes
 
REST API Recommendations
REST API RecommendationsREST API Recommendations
REST API Recommendations
Jeelani Shaik
 
Introduction to Restful Web Services
Introduction to Restful Web ServicesIntroduction to Restful Web Services
Introduction to Restful Web Services
weili_at_slideshare
 
Introduction to REST - REST Basics - JSON
Introduction to REST - REST Basics - JSONIntroduction to REST - REST Basics - JSON
Introduction to REST - REST Basics - JSON
Matrix823409
 
07-IM-REST-json.pdf slide for restapi explaination
07-IM-REST-json.pdf slide for restapi explaination07-IM-REST-json.pdf slide for restapi explaination
07-IM-REST-json.pdf slide for restapi explaination
EngjellRrapaj
 
An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST
Ram Awadh Prasad, PMP
 
RESTful Web Service using Swagger
RESTful Web Service using SwaggerRESTful Web Service using Swagger
RESTful Web Service using Swagger
Hong-Jhih Lin
 
REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)
Jef Claes
 
Research Topics in Machine Hypermedia
Research Topics in Machine HypermediaResearch Topics in Machine Hypermedia
Research Topics in Machine Hypermedia
Michael Koster
 
Rest presentation
Rest  presentationRest  presentation
Rest presentation
srividhyau
 
CakeFest 2013 - A-Z REST APIs
CakeFest 2013 - A-Z REST APIsCakeFest 2013 - A-Z REST APIs
CakeFest 2013 - A-Z REST APIs
anthony_putignano
 
CakeFest 2013 - A-Z REST APIs
CakeFest 2013 - A-Z REST APIsCakeFest 2013 - A-Z REST APIs
CakeFest 2013 - A-Z REST APIs
anthony_putignano
 
Service-oriented software engineering & APIs
Service-oriented software engineering & APIsService-oriented software engineering & APIs
Service-oriented software engineering & APIs
Matrix823409
 
API Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNGAPI Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNG
Siddharth Sharma
 
Overview of REST - Raihan Ullah
Overview of REST - Raihan UllahOverview of REST - Raihan Ullah
Overview of REST - Raihan Ullah
Cefalo
 
REST API and CRUD
REST API and CRUDREST API and CRUD
REST API and CRUD
Prem Sanil
 
Java Web services
Java Web servicesJava Web services
Java Web services
Sujit Kumar
 
Ad

Recently uploaded (20)

The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 

REST API Design

  • 1. REST API By Devi Kiran KickStartPros.com [email protected]
  • 2. • JSON1 • REST API2 • JS libs and Play3 Agenda
  • 3. JSON • JSON = JavaScript Object Notation • Lightweight data interchange format • Organization with Employees
  • 4. REST API & DESIGN
  • 5. What is REST? • REST = REpresentational State Transfer • Architectural Constraints – Client-Server – Uniform Interface – Stateless – Cacheable – Layered System – Code on demand
  • 6. REST - Resource Based REST • Nouns, Not Verbs • Things are identified by URIs • Person, User, Address resource • HTTP Verb to dictate the operation on that resource. • Multiple URIs pointing to same resource. SOAP - RPC • Verbs or Actions. • RPC calls (Don’t do this in REST) – getUserData – getAllUsers – searchUsers – getUserAddress – updateUserAddress – deleteUser
  • 7. Representations • Represent part of the resource state. • JSON or XML • Example: Buy a car – Resource: Car (Audi A1) – Service: Buy (POST) – Representation: • Name, Model, Price • JSON or XML format.
  • 8. REST API Design Different REST Clients iPhone App Browser/ Web Android App DELETE PUT GET POST CUSTOM Params Http Methods Your App Server Load balanced App Server 1 App Server App Server App Server 1…n KickStartPros.com Http/s JSON/XML JSON/XML JSON/XML
  • 9. HTTP Methods & Status Codes • GET • HEAD • POST • PUT • DELETE • TRACE • OPTIONS • 2xx Success – 200 Ok – 204 No Content • 3xx Redirect – 304 Not Modified • 4xx Client Error – 400 Bad Request – 401 Unauthorized – 403 Forbidden – 404 Not Found • 5xx Server Error – 500 Internal Server Error
  • 10. Keep Http/s Simple • Resources – URI format – Collection Resources (/users) – Instance Resources (/users/ayl23d) • Behavior – Use Http Methods => CURD Database/Server Actions – POST => Create – GET => Read – PUT => Update – DELETE => Delete – HEAD => Headers, no body • Media types – application/json – application/xml
  • 11. Post for Create POST /users { “name” : “Kiran” } Response: 201 Created Location: http://www.kickstartpros.com/users/gdk23
  • 12. Put for Update PUT /users/<userId> PUT /users/gdk23 { “name” : “Devi Kiran” “description”: “Trainer” }
  • 13. Post for Update POST /users/<userId> POST /users/gdk23 { “name”: “Devi Kiran” } (Partial update or Full update) Response: 200 OK
  • 15. Client and Server • Uniform Interface Decouples Client and Server • Design – http and URIs – HTTP verbs (GET, PUT, POST, DELETE) – URIs – HTTP response • Status • Body
  • 16. Uniform interface • The uniform interface decouples client and Server – Identification of resources – Manipulation of resources through these representations – Self-descriptive messages
  • 17. HATEOAS • Hypermedia as the engine of application state • Client to Server – Body Content – URI and Query String parameters – Request Headers • Server – Body Content – Response Codes – Response Headers
  • 18. Stateless • No client state at server. • Any State is maintained at Client side. • Each request has all the information to process the request. Client 1 Client 2 Client 3 Servers
  • 19. More … • Layered System – A client cannot tell whether it is connected directly to the server. – Load balanced Servers – More Performance • Cacheable – Implicit – Explicit
  • 20. REST APIS & PLAY
  • 21. Example URIs • GMail Rest API (v1 Reference by resource type) • Custom REST API from Yahoo – https://developer.yahoo.com/yql/console/ – Example: get san francisco geo data: select * from geo.places where text=“san francisco, ca”
  • 22. UI Data binding of REST API • JQuery – Ajax calls • Data Binding JS libs that help to bind with REST response – JQuery UI – Widgets – Knockout – Model-View-ViewModel (MVVM) – Angular JS – MVVM & MVC – Backbone.js – RESTful JSON interface – Ember.js – Template language, MVC and a router – Kendo UI – MVVM – Extjs – MVC (Model View Controller) & widgets
  • 23. Summary & Reference • JSON & REST Architecture • Resource based REST API = Micro Services (SOA) • REST API & Examples with JS libs • Reference – Wiki • [email protected] – Join our trainings. – Kick Start your project with us.