SlideShare a Scribd company logo
1 of 26
Demystifying API
Ashok Gautam
Agenda
API Introduction
RESTFul paradigm
Design, Development & Challenges
Best practices
Tools
Resources
Q&A
API:
Introduction
What is API
Evolution
Benefits
Introduction
API stands for Application Programming Interface. API
is a set of functions and procedures allowing the
creation of applications that access the features or data
of an operating system, application, or other service.
API is a software intermediary that allows two
applications to talk to each other.
APIs have existed for a long
time. Since the first
computer programs were
written, APIs have been
providing “contracts” for
information exchange
between programs.
XML-RPC
SOAP
RESTful
GraphQL
OS APIs
Platform APIs
Application APIs
Web APIs
Evolution
Why should you have API
Efficiency
Flexibility
Integrations
Security
Metered Usages
RESTful
A RESTful API is an application
program interface (API) that
uses HTTP requests to GET,
PUT, POST and DELETE data.
RESTful
Uniform interface
Client–server
Stateless
Cacheable
Layered system
https://www.bitnative.com/2012/08/26/how-restful-is-your-api/
Design, Development & Challenges
Design
Use nouns and NOT the verbs
Use of right HTTP methods
Use Plurals
Use parameters
Use proper HTTP codes
Versioning
Use Pagination
Supported Formats
Use Proper Error Messages
https://hackernoon.com/restful-api-design-step-by-step-guide-2f2c9f9fcdbf
OAS https://swagger.io/resources/open-api/
Development
Express.js
HAPI.JS
LoopBack
Swagger
Flask
Spring Boot
Postman
JMeter
Katalon
Kong
APIGEE
Swagger
Mulesoft
FireBase
Hello World
https://medium.com/@purposenigeria/build-a-restful-api-with-node-js-and-express-js-d7e59c7a3dfb
import express from 'express';import db from './db/db';
// Set up the express app
const app = express();
// get all todos
app.get('/api/v1/hello', (req, res) => {
res.status(200).send({
success: 'true',
message: 'Hello World',
todos: db
})});
const PORT = 5000;
app.listen(PORT, () => {
console.log(`server running on port ${PORT}`)
});
'use strict';
const Hapi=require('hapi');
// Create a server with a host
and port
const server=Hapi.server({
host:'localhost',
port:8000
});
// Add the route
server.route({
method:'GET',
path:'/hello',
handler:function(request,h) {
return'hello world';
}});
// Start the server
const start = async function() {
try {
await server.start();
}
catch (err) {
console.log(err);
process.exit(1);
}
console.log('Server running
at:', server.info.uri);
};
start();
Kong
● Cloud-Native
● Dynamic Load Balancing
● Hash-based Load Balancing
● Circuit-Breaker
● Health Checks
● Service Discovery
● Serverless
● WebSockets
● OAuth2.0
● Logging
● Security
● Syslog
● SSL
● Monitoring
● Forward Proxy
● Authentications
● Rate-limiting.
● Transformations
● Caching
● CLI
● REST API
● Geo-Replicated
● Failure Detection & Recovery
● Clustering
● Scalability
● Performance
● Plugins
Challenges
Security
Authentication & Authorization
Rate Limit
Scalability
Security
HTTPS
Access Control
Restrict HTTP methods
Input validation
Validate content types
Management endpoints
Error handling
Audit logs
Security headers
CORS
Sensitive information in HTTP requests
● Parameters Exploitation
● Identity Theft
● Abusing authorization system
● Man-In-The-Middle
● DOS & DDOS
Security
Authentication & Authorization
API keys
OAuth access tokens
JSON Web Tokens
https://zapier.com/engineering/apikey
-oauth-jwt/
● Use API keys if you expect developers to build internal
applications that don’t need to access more than a single user’s
data.
● Use OAuth access tokens if you want users to easily provide
authorization to applications without needing to share private
data or dig through developer documentation.
● Use JWT in concert with OAuth if you want to limit database
lookups and you don’t require the ability to immediately revoke
access.https://blog.restcase.com/restful-
api-authentication-basics/
API : Authentication
Rate Limit
User rate limits
IP/Network rate limits
Server rate limits
Regional data limits
Resource specific rate limits
Dynamic rate limits
Leaky Bucket
Fixed Window
Sliding Log
Sliding Window
express-rate-limit
hapi-ratelimiter
flask-limiter
Rate Limit
const rateLimit = require("express-rate-limit");
app.enable("trust proxy"); // only if you're behind
a reverse proxy (Heroku, Bluemix, AWS ELB, Nginx,
etc)
const apiLimiter = rateLimit({
windowMs: 15 * 60 * 1000, // 15 minutes
max: 100
});
app.use("/api/", apiLimiter);
Scaling
CDN
Application level caching
Database Caching
Cloudflare/
Cloudfront/Akamai
Varnish/NGINX
Redis/Memcache
https://hackernoon.com/restful-api-design-step-by-step-guide-2f2c9f9fcdbf
https://www.apiacademy.co/lessons/2015/04/api-design-101-api-design-basics
https://docs.microsoft.com/en-us/azure/architecture/best-practices/api-design
https://blog.mwaysolutions.com/2014/06/05/10-best-practices-for-better-restful-api/
Resources

More Related Content

What's hot (20)

Rest api standards and best practices
Rest api standards and best practicesRest api standards and best practices
Rest api standards and best practices
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
 
An Introduction To REST API
An Introduction To REST APIAn Introduction To REST API
An Introduction To REST API
 
RESTful API - Best Practices
RESTful API - Best PracticesRESTful API - Best Practices
RESTful API - Best Practices
 
Api types
Api typesApi types
Api types
 
Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web API
 
API
APIAPI
API
 
API Design- Best Practices
API Design-   Best PracticesAPI Design-   Best Practices
API Design- Best Practices
 
Restful Web Services
Restful Web ServicesRestful Web Services
Restful Web Services
 
Rest api and-crud-api
Rest api and-crud-apiRest api and-crud-api
Rest api and-crud-api
 
Learn REST in 18 Slides
Learn REST in 18 SlidesLearn REST in 18 Slides
Learn REST in 18 Slides
 
REST-API overview / concepts
REST-API overview / conceptsREST-API overview / concepts
REST-API overview / concepts
 
RESTful Web Services
RESTful Web ServicesRESTful Web Services
RESTful Web Services
 
API for Beginners
API for BeginnersAPI for Beginners
API for Beginners
 
Api presentation
Api presentationApi presentation
Api presentation
 
Rest web services
Rest web servicesRest web services
Rest web services
 
API for Beginners
API for BeginnersAPI for Beginners
API for Beginners
 
Rest API
Rest APIRest API
Rest API
 
React & GraphQL
React & GraphQLReact & GraphQL
React & GraphQL
 
Introduction to API
Introduction to APIIntroduction to API
Introduction to API
 

Similar to REST API Design & Development

Oracle API Platform Cloud Service Best Practices & Lessons Learnt
Oracle API Platform Cloud Service Best Practices & Lessons LearntOracle API Platform Cloud Service Best Practices & Lessons Learnt
Oracle API Platform Cloud Service Best Practices & Lessons Learntluisw19
 
Web api security
Web api securityWeb api security
Web api security9xdot
 
Webinar: Embracing REST APIs through APPSeCONNECT
Webinar: Embracing REST APIs through APPSeCONNECTWebinar: Embracing REST APIs through APPSeCONNECT
Webinar: Embracing REST APIs through APPSeCONNECTAPPSeCONNECT
 
CIS14: Early Peek at PingFederate Administrative REST API
CIS14: Early Peek at PingFederate Administrative REST APICIS14: Early Peek at PingFederate Administrative REST API
CIS14: Early Peek at PingFederate Administrative REST APICloudIDSummit
 
Mule esb api layer
Mule esb api layerMule esb api layer
Mule esb api layerAnand kalla
 
Mule esb api layer
Mule esb api layerMule esb api layer
Mule esb api layerKhasim Saheb
 
apidays LIVE Hong Kong - Orchestrating APIs at Scale by Hieu Nguyen Nhu
apidays LIVE Hong Kong - Orchestrating APIs at Scale by Hieu Nguyen Nhuapidays LIVE Hong Kong - Orchestrating APIs at Scale by Hieu Nguyen Nhu
apidays LIVE Hong Kong - Orchestrating APIs at Scale by Hieu Nguyen Nhuapidays
 
Extend soa with api management spoug- Madrid
Extend soa with api management   spoug- MadridExtend soa with api management   spoug- Madrid
Extend soa with api management spoug- MadridVinay Kumar
 
Mule esb api layer
Mule esb api layerMule esb api layer
Mule esb api layerirfan1008
 
Mule esb–api layer
Mule esb–api layerMule esb–api layer
Mule esb–api layercharan teja R
 
Mule esb api layer
Mule esb api layer Mule esb api layer
Mule esb api layer javeed_mhd
 

Similar to REST API Design & Development (20)

Oracle API Platform Cloud Service Best Practices & Lessons Learnt
Oracle API Platform Cloud Service Best Practices & Lessons LearntOracle API Platform Cloud Service Best Practices & Lessons Learnt
Oracle API Platform Cloud Service Best Practices & Lessons Learnt
 
Web api security
Web api securityWeb api security
Web api security
 
Webinar: Embracing REST APIs through APPSeCONNECT
Webinar: Embracing REST APIs through APPSeCONNECTWebinar: Embracing REST APIs through APPSeCONNECT
Webinar: Embracing REST APIs through APPSeCONNECT
 
CIS14: Early Peek at PingFederate Administrative REST API
CIS14: Early Peek at PingFederate Administrative REST APICIS14: Early Peek at PingFederate Administrative REST API
CIS14: Early Peek at PingFederate Administrative REST API
 
API Testing Basics.pptx
API Testing Basics.pptxAPI Testing Basics.pptx
API Testing Basics.pptx
 
Getting Started with API Management
Getting Started with API ManagementGetting Started with API Management
Getting Started with API Management
 
Mule esb api layer
Mule esb api layerMule esb api layer
Mule esb api layer
 
Mule esb api layer
Mule esb api layerMule esb api layer
Mule esb api layer
 
Mule esb api layer
Mule esb api layerMule esb api layer
Mule esb api layer
 
Api Layer
Api LayerApi Layer
Api Layer
 
Api design part 1
Api design part 1Api design part 1
Api design part 1
 
Mule api
Mule  apiMule  api
Mule api
 
Mule api
Mule  apiMule  api
Mule api
 
API Gateway report
API Gateway reportAPI Gateway report
API Gateway report
 
apidays LIVE Hong Kong - Orchestrating APIs at Scale by Hieu Nguyen Nhu
apidays LIVE Hong Kong - Orchestrating APIs at Scale by Hieu Nguyen Nhuapidays LIVE Hong Kong - Orchestrating APIs at Scale by Hieu Nguyen Nhu
apidays LIVE Hong Kong - Orchestrating APIs at Scale by Hieu Nguyen Nhu
 
Extend soa with api management spoug- Madrid
Extend soa with api management   spoug- MadridExtend soa with api management   spoug- Madrid
Extend soa with api management spoug- Madrid
 
Mule esb api layer
Mule esb api layerMule esb api layer
Mule esb api layer
 
Mule esb–api layer
Mule esb–api layerMule esb–api layer
Mule esb–api layer
 
Mule esb–api layer
Mule esb–api layerMule esb–api layer
Mule esb–api layer
 
Mule esb api layer
Mule esb api layer Mule esb api layer
Mule esb api layer
 

Recently uploaded

Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 

Recently uploaded (20)

Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 

REST API Design & Development