SlideShare una empresa de Scribd logo
1 de 23
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.

Más contenido relacionado

La actualidad más candente

Learn REST in 18 Slides
Learn REST in 18 SlidesLearn REST in 18 Slides
Learn REST in 18 SlidesSuraj Gupta
 
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 | EdurekaEdureka!
 
Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web APIBrad Genereaux
 
Introduction to API
Introduction to APIIntroduction to API
Introduction to APIrajnishjha29
 
Spring Boot and REST API
Spring Boot and REST APISpring Boot and REST API
Spring Boot and REST API07.pallav
 
REST API Design & Development
REST API Design & DevelopmentREST API Design & Development
REST API Design & DevelopmentAshok Pundit
 
ASP.NET Web API
ASP.NET Web APIASP.NET Web API
ASP.NET Web APIhabib_786
 
이벤트 기반 분산 시스템을 향한 여정
이벤트 기반 분산 시스템을 향한 여정이벤트 기반 분산 시스템을 향한 여정
이벤트 기반 분산 시스템을 향한 여정Arawn Park
 
Understanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple StepsUnderstanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple StepsTessa Mero
 
Design Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsDesign Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsStormpath
 
Capabilities for Resources and Effects
Capabilities for Resources and EffectsCapabilities for Resources and Effects
Capabilities for Resources and EffectsMartin Odersky
 
4. 대용량 아키텍쳐 설계 패턴
4. 대용량 아키텍쳐 설계 패턴4. 대용량 아키텍쳐 설계 패턴
4. 대용량 아키텍쳐 설계 패턴Terry Cho
 
카카오 광고 플랫폼 MSA 적용 사례 및 API Gateway와 인증 구현에 대한 소개
카카오 광고 플랫폼 MSA 적용 사례 및 API Gateway와 인증 구현에 대한 소개카카오 광고 플랫폼 MSA 적용 사례 및 API Gateway와 인증 구현에 대한 소개
카카오 광고 플랫폼 MSA 적용 사례 및 API Gateway와 인증 구현에 대한 소개if kakao
 
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023Steve Pember
 

La actualidad más candente (20)

Learn REST in 18 Slides
Learn REST in 18 SlidesLearn REST in 18 Slides
Learn REST in 18 Slides
 
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
 
Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web API
 
Introduction to API
Introduction to APIIntroduction to API
Introduction to API
 
Attacking REST API
Attacking REST APIAttacking REST API
Attacking REST API
 
API
APIAPI
API
 
Spring Boot and REST API
Spring Boot and REST APISpring Boot and REST API
Spring Boot and REST API
 
REST API Design & Development
REST API Design & DevelopmentREST API Design & Development
REST API Design & Development
 
ASP.NET Web API
ASP.NET Web APIASP.NET Web API
ASP.NET Web API
 
이벤트 기반 분산 시스템을 향한 여정
이벤트 기반 분산 시스템을 향한 여정이벤트 기반 분산 시스템을 향한 여정
이벤트 기반 분산 시스템을 향한 여정
 
Understanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple StepsUnderstanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple Steps
 
Design Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsDesign Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIs
 
Rest assured
Rest assuredRest assured
Rest assured
 
An Introduction To REST API
An Introduction To REST APIAn Introduction To REST API
An Introduction To REST API
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
 
RESTful Web Services
RESTful Web ServicesRESTful Web Services
RESTful Web Services
 
Capabilities for Resources and Effects
Capabilities for Resources and EffectsCapabilities for Resources and Effects
Capabilities for Resources and Effects
 
4. 대용량 아키텍쳐 설계 패턴
4. 대용량 아키텍쳐 설계 패턴4. 대용량 아키텍쳐 설계 패턴
4. 대용량 아키텍쳐 설계 패턴
 
카카오 광고 플랫폼 MSA 적용 사례 및 API Gateway와 인증 구현에 대한 소개
카카오 광고 플랫폼 MSA 적용 사례 및 API Gateway와 인증 구현에 대한 소개카카오 광고 플랫폼 MSA 적용 사례 및 API Gateway와 인증 구현에 대한 소개
카카오 광고 플랫폼 MSA 적용 사례 및 API Gateway와 인증 구현에 대한 소개
 
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
 

Destacado

Rest api design by george reese
Rest api design by george reeseRest api design by george reese
Rest api design by george reesebuildacloud
 
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.jsYoann Gotthilf
 
Laravel Restful API and AngularJS
Laravel Restful API and AngularJSLaravel Restful API and AngularJS
Laravel Restful API and AngularJSBlake Newman
 
How to connect AngularJS to servers
How to connect AngularJS to serversHow to connect AngularJS to servers
How to connect AngularJS to serversCarlos 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 BackBlobBob 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 - ROPkuasmun_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 DistributorNikki Albright
 
CCA EAP Capabilities
CCA EAP CapabilitiesCCA EAP Capabilities
CCA EAP CapabilitiesCCA Inc
 
Oregon Rural Entrepreneurship Development Initiative REDI
Oregon Rural Entrepreneurship Development Initiative REDIOregon Rural Entrepreneurship Development Initiative REDI
Oregon Rural Entrepreneurship Development Initiative REDIHeather Stafford
 
Khopoli & khalapur project market anaylsis consolidated
Khopoli & khalapur project market anaylsis consolidatedKhopoli & khalapur project market anaylsis consolidated
Khopoli & khalapur project market anaylsis consolidatedsunil 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
 

Destacado (19)

Rest api design by george reese
Rest api design by george reeseRest api design by george reese
Rest api design by george reese
 
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...
 
REST in short
REST in shortREST in short
REST in short
 
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
 
Laravel Restful API and AngularJS
Laravel Restful API and AngularJSLaravel Restful API and AngularJS
Laravel Restful API and AngularJS
 
How to connect AngularJS to servers
How to connect AngularJS to serversHow to connect AngularJS to servers
How to connect AngularJS to servers
 
Angularjs & REST
Angularjs & RESTAngularjs & REST
Angularjs & REST
 
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
 
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...
 
Kuasmun second class - ROP
Kuasmun second class - ROPKuasmun second class - ROP
Kuasmun second class - ROP
 
Dr browns
Dr brownsDr browns
Dr browns
 
CrowdTruth @DIR2015
CrowdTruth @DIR2015CrowdTruth @DIR2015
CrowdTruth @DIR2015
 
Linden lab
Linden labLinden lab
Linden lab
 
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
 
Labor
LaborLabor
Labor
 
CCA EAP Capabilities
CCA EAP CapabilitiesCCA EAP Capabilities
CCA EAP Capabilities
 
Oregon Rural Entrepreneurship Development Initiative REDI
Oregon Rural Entrepreneurship Development Initiative REDIOregon Rural Entrepreneurship Development Initiative REDI
Oregon Rural Entrepreneurship Development Initiative REDI
 
Khopoli & khalapur project market anaylsis consolidated
Khopoli & khalapur project market anaylsis consolidatedKhopoli & khalapur project market anaylsis consolidated
Khopoli & khalapur project market anaylsis consolidated
 
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...
 

Similar a REST API Design

REST API Recommendations
REST API RecommendationsREST API Recommendations
REST API RecommendationsJeelani Shaik
 
Introduction to Restful Web Services
Introduction to Restful Web ServicesIntroduction to Restful Web Services
Introduction to Restful Web Servicesweili_at_slideshare
 
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 SwaggerHong-Jhih Lin
 
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
 
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 HypermediaMichael Koster
 
Rest presentation
Rest  presentationRest  presentation
Rest presentationsrividhyau
 
CakeFest 2013 - A-Z REST APIs
CakeFest 2013 - A-Z REST APIsCakeFest 2013 - A-Z REST APIs
CakeFest 2013 - A-Z REST APIsanthony_putignano
 
CakeFest 2013 - A-Z REST APIs
CakeFest 2013 - A-Z REST APIsCakeFest 2013 - A-Z REST APIs
CakeFest 2013 - A-Z REST APIsanthony_putignano
 
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 TestNGSiddharth Sharma
 
Overview of REST - Raihan Ullah
Overview of REST - Raihan UllahOverview of REST - Raihan Ullah
Overview of REST - Raihan UllahCefalo
 
REST API and CRUD
REST API and CRUDREST API and CRUD
REST API and CRUDPrem Sanil
 
Java Web services
Java Web servicesJava Web services
Java Web servicesSujit Kumar
 
Rest & RESTful WebServices
Rest & RESTful WebServicesRest & RESTful WebServices
Rest & RESTful WebServicesPrateek Tandon
 
Pragmatic REST APIs
Pragmatic REST APIsPragmatic REST APIs
Pragmatic REST APIsamesar0
 

Similar a REST API Design (20)

REST API Recommendations
REST API RecommendationsREST API Recommendations
REST API Recommendations
 
Rest
RestRest
Rest
 
Introduction to Restful Web Services
Introduction to Restful Web ServicesIntroduction to Restful Web Services
Introduction to Restful Web Services
 
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
 
RESTful Web Service using Swagger
RESTful Web Service using SwaggerRESTful Web Service using Swagger
RESTful Web Service using Swagger
 
API Testing. Streamline your testing process.
API Testing. Streamline your testing process.API Testing. Streamline your testing process.
API Testing. Streamline your testing process.
 
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)
 
Research Topics in Machine Hypermedia
Research Topics in Machine HypermediaResearch Topics in Machine Hypermedia
Research Topics in Machine Hypermedia
 
Rest presentation
Rest  presentationRest  presentation
Rest presentation
 
On being RESTful
On being RESTfulOn being RESTful
On being RESTful
 
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...
 
CakeFest 2013 - A-Z REST APIs
CakeFest 2013 - A-Z REST APIsCakeFest 2013 - A-Z REST APIs
CakeFest 2013 - A-Z REST APIs
 
CakeFest 2013 - A-Z REST APIs
CakeFest 2013 - A-Z REST APIsCakeFest 2013 - A-Z REST APIs
CakeFest 2013 - A-Z REST APIs
 
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
 
Overview of REST - Raihan Ullah
Overview of REST - Raihan UllahOverview of REST - Raihan Ullah
Overview of REST - Raihan Ullah
 
REST API and CRUD
REST API and CRUDREST API and CRUD
REST API and CRUD
 
Java Web services
Java Web servicesJava Web services
Java Web services
 
REST APIs
REST APIsREST APIs
REST APIs
 
Rest & RESTful WebServices
Rest & RESTful WebServicesRest & RESTful WebServices
Rest & RESTful WebServices
 
Pragmatic REST APIs
Pragmatic REST APIsPragmatic REST APIs
Pragmatic REST APIs
 

Último

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 

Último (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 

REST API Design

  • 1. REST API By Devi Kiran KickStartPros.com contact@kickstartpros.com
  • 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 • contact@kickstartpros.com – Join our trainings. – Kick Start your project with us.