SlideShare a Scribd company logo
1 of 33
Download to read offline
REST APIs@alexjsinger

August 1st, 2016
What an API is How an API works
1 3
Where and why an
API is used
2
Goals
To understand…
#Servers
Servers
A computer on a network
Run software for specific tasks
Specialized servers for things like web pages,
emails, and databases
Networked systems need a way
to communicate with each other
Networked systems
communicate each other
Dash Button
Client-Server Model
Client-Server Model
Client Server
(laptop, phone, physical device) (…just a computer)
Challenges
Systems don’t “speak the same language”
Don’t expose server code
Change server code without breaking
communications
Ensure communication is secure
#RESTAPI
FTW
presentationalRe
rogrammingS
Transfer
A
P
I
pplication
nterface
tate
Request / response communication
HTTP
Request
https://www.twitter.com/onedirection
1. URL
2. Method
3. Header information
4. Body
Request / response communication
HTTP
Request
https://www.twitter.com/onedirection
Response
1. Data
2. Header information
3. Status Code
http://www.songzify.com/songssongssongzify.com
Request - URL (endpoint)
Unique address for a “thing” or resource on a server
Examples:
Domain Path
http://www.songzify.com/artists
Request - Method
A CRUD style verb to associate the endpoint with an action on the server
Method Description
GET Read resource data from the server
POST Create a resource on the server
PUT Update a resource on the server
DELETE Delete a resource from the server
Request - Method
A CRUD style verb to associate the endpoint with an action on the server
Method Description
GET Read resource data from the server
POST Create a resource on the server
PUT Update a resource on the server
DELETE Delete a resource from the server
Request - Method
A CRUD style verb to associate the endpoint with an action on the server
Method Description
GET Read resource data from the server
POST Create a resource on the server
PUT Update a resource on the server
DELETE Delete a resource from the server
Request - Method
A CRUD style verb to associate the endpoint with an action on the server
Method Description
GET Read resource data from the server
POST Create a resource on the server
PUT Update a resource on the server
DELETE Delete a resource from the server
Response - Data
Data returned by the server to the client after processing the request
The HTML content of a requested
web page
Examples:
JSON or XML of an API request
Response - Status Code
A numeric code to indicate the status of the request
Response - Status Code
A numeric code to indicate the status of the request
Common Codes:
Code Description
1xx Information i.e. 101 switching protocols
2xx Success i.e. 200 OK or 201 created
3xx Redirection i.e. 301 moved permanentely
4xx Client Error i.e. 401 unauthorized or 404 not found
5xx Server Error i.e. 500 internal server error
Putting it all together…
Requests use the URL, Method, Body and Headers to tell the server
what it wants to do.
GET https://api.twitter.com/1.1/statuses/user_timeline.json?
user_id=onedirection&screen_name=onedirection
Request:
Response:
Let’s take a look at the real data!
#DesignAPI
Think about features that API should expose on the server
Songzify
It should…
List all artists
List all songs by artist
List all songs
Allow an artist to be created
Allow an artist to be deleted
/artists
/songs/{artist_id}
/songs
/artists
/artists/{artist_id}
Endpoint
GET
GET
GET
POST
DELETE
Method
-
artist_id
-
artist_name
artist_id
Body
Dinner with an API
Exercise
Groups of 2
Think through a full dinner and
functionality a “Server” should
provide to satisfy the “Client”
Create a table showing the Endpoints,
Methods, and Body for each action
For each action, describe the expected
response from the server
#LearnMore
API Docs
API docs outline requirements for requests and response
It’s a good idea to become familiar with their structure since most REST
APIs follow the same format
Examples:
https://dev.twitter.com/rest/public
https://developer.spotify.com/web-api/endpoint-reference/
https://www.instagram.com/developer/endpoints/
REST APIs@alexjsinger

What an API is How an API works
1 3
Where and why an
API is used
2
Goals
To understand…
#ThankYou!

More Related Content

What's hot

Amy Sheldon-Source code
Amy Sheldon-Source codeAmy Sheldon-Source code
Amy Sheldon-Source codeaimsyayj
 
The never-ending REST API design debate
The never-ending REST API design debateThe never-ending REST API design debate
The never-ending REST API design debateRestlet
 
How To Use the Atomic App For Chrome
How To Use the Atomic App For ChromeHow To Use the Atomic App For Chrome
How To Use the Atomic App For ChromeAtomic Reach
 
Super simple introduction to REST-APIs (2nd version)
Super simple introduction to REST-APIs (2nd version)Super simple introduction to REST-APIs (2nd version)
Super simple introduction to REST-APIs (2nd version)Patrick Savalle
 
Salesforce composite api mule soft connector
Salesforce composite api mule soft connectorSalesforce composite api mule soft connector
Salesforce composite api mule soft connectorpqrs1234
 
Web REST APIs Design Principles
Web REST APIs Design PrinciplesWeb REST APIs Design Principles
Web REST APIs Design PrinciplesAnji Beeravalli
 
Week10web Poster
Week10web PosterWeek10web Poster
Week10web Posters1150245
 
HTTP Services & REST API Security
HTTP Services & REST API SecurityHTTP Services & REST API Security
HTTP Services & REST API SecurityTaiseer Joudeh
 

What's hot (9)

Amy Sheldon-Source code
Amy Sheldon-Source codeAmy Sheldon-Source code
Amy Sheldon-Source code
 
The never-ending REST API design debate
The never-ending REST API design debateThe never-ending REST API design debate
The never-ending REST API design debate
 
How To Use the Atomic App For Chrome
How To Use the Atomic App For ChromeHow To Use the Atomic App For Chrome
How To Use the Atomic App For Chrome
 
Super simple introduction to REST-APIs (2nd version)
Super simple introduction to REST-APIs (2nd version)Super simple introduction to REST-APIs (2nd version)
Super simple introduction to REST-APIs (2nd version)
 
Salesforce composite api mule soft connector
Salesforce composite api mule soft connectorSalesforce composite api mule soft connector
Salesforce composite api mule soft connector
 
Web REST APIs Design Principles
Web REST APIs Design PrinciplesWeb REST APIs Design Principles
Web REST APIs Design Principles
 
What's new in Rails 4.1
What's new in Rails 4.1What's new in Rails 4.1
What's new in Rails 4.1
 
Week10web Poster
Week10web PosterWeek10web Poster
Week10web Poster
 
HTTP Services & REST API Security
HTTP Services & REST API SecurityHTTP Services & REST API Security
HTTP Services & REST API Security
 

Similar to REST APIs overview

A Conversation About REST - Extended Version
A Conversation About REST - Extended VersionA Conversation About REST - Extended Version
A Conversation About REST - Extended VersionJeremy Brown
 
Nom Nom: Consuming REST APIs
Nom Nom: Consuming REST APIsNom Nom: Consuming REST APIs
Nom Nom: Consuming REST APIsTessa Mero
 
A Conversation About REST
A Conversation About RESTA Conversation About REST
A Conversation About RESTJeremy Brown
 
A Conversation About REST
A Conversation About RESTA Conversation About REST
A Conversation About RESTMike Wilcox
 
Api design and development
Api design and developmentApi design and development
Api design and developmentoquidave
 
Manindra kishore _incident_handling_n_log_analysis - ClubHack2009
Manindra kishore _incident_handling_n_log_analysis - ClubHack2009Manindra kishore _incident_handling_n_log_analysis - ClubHack2009
Manindra kishore _incident_handling_n_log_analysis - ClubHack2009ClubHack
 
Introduction to Web Architecture
Introduction to Web ArchitectureIntroduction to Web Architecture
Introduction to Web ArchitectureChamnap Chhorn
 
What is API - Understanding API Simplified
What is API - Understanding API SimplifiedWhat is API - Understanding API Simplified
What is API - Understanding API SimplifiedJubin Aghara
 
RESTful services
RESTful servicesRESTful services
RESTful servicesgouthamrv
 
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 5Charlin Agramonte
 

Similar to REST APIs overview (20)

API Basics
API BasicsAPI Basics
API Basics
 
A Conversation About REST - Extended Version
A Conversation About REST - Extended VersionA Conversation About REST - Extended Version
A Conversation About REST - Extended Version
 
Apitesting.pptx
Apitesting.pptxApitesting.pptx
Apitesting.pptx
 
Salesforce Integration
Salesforce IntegrationSalesforce Integration
Salesforce Integration
 
gofortution
gofortutiongofortution
gofortution
 
Nom Nom: Consuming REST APIs
Nom Nom: Consuming REST APIsNom Nom: Consuming REST APIs
Nom Nom: Consuming REST APIs
 
Api 101
Api 101Api 101
Api 101
 
A Conversation About REST
A Conversation About RESTA Conversation About REST
A Conversation About REST
 
A Conversation About REST
A Conversation About RESTA Conversation About REST
A Conversation About REST
 
REST API
REST APIREST API
REST API
 
Api design and development
Api design and developmentApi design and development
Api design and development
 
An Introduction To REST API
An Introduction To REST APIAn Introduction To REST API
An Introduction To REST API
 
Manindra kishore _incident_handling_n_log_analysis - ClubHack2009
Manindra kishore _incident_handling_n_log_analysis - ClubHack2009Manindra kishore _incident_handling_n_log_analysis - ClubHack2009
Manindra kishore _incident_handling_n_log_analysis - ClubHack2009
 
Introduction to Web Architecture
Introduction to Web ArchitectureIntroduction to Web Architecture
Introduction to Web Architecture
 
What is API - Understanding API Simplified
What is API - Understanding API SimplifiedWhat is API - Understanding API Simplified
What is API - Understanding API Simplified
 
RESTful services
RESTful servicesRESTful services
RESTful services
 
Switch to Backend 2023
Switch to Backend 2023Switch to Backend 2023
Switch to Backend 2023
 
Rest
Rest Rest
Rest
 
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
 
Ch-1_.ppt
Ch-1_.pptCh-1_.ppt
Ch-1_.ppt
 

Recently uploaded

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
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
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
 
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
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
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
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 

Recently uploaded (20)

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
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 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
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 

REST APIs overview

  • 2. What an API is How an API works 1 3 Where and why an API is used 2 Goals To understand…
  • 4. Servers A computer on a network Run software for specific tasks Specialized servers for things like web pages, emails, and databases
  • 5. Networked systems need a way to communicate with each other Networked systems communicate each other
  • 6.
  • 7.
  • 8.
  • 11. Client-Server Model Client Server (laptop, phone, physical device) (…just a computer)
  • 12. Challenges Systems don’t “speak the same language” Don’t expose server code Change server code without breaking communications Ensure communication is secure
  • 15. Request / response communication HTTP Request https://www.twitter.com/onedirection 1. URL 2. Method 3. Header information 4. Body
  • 16. Request / response communication HTTP Request https://www.twitter.com/onedirection Response 1. Data 2. Header information 3. Status Code
  • 17. http://www.songzify.com/songssongssongzify.com Request - URL (endpoint) Unique address for a “thing” or resource on a server Examples: Domain Path http://www.songzify.com/artists
  • 18. Request - Method A CRUD style verb to associate the endpoint with an action on the server Method Description GET Read resource data from the server POST Create a resource on the server PUT Update a resource on the server DELETE Delete a resource from the server
  • 19. Request - Method A CRUD style verb to associate the endpoint with an action on the server Method Description GET Read resource data from the server POST Create a resource on the server PUT Update a resource on the server DELETE Delete a resource from the server
  • 20. Request - Method A CRUD style verb to associate the endpoint with an action on the server Method Description GET Read resource data from the server POST Create a resource on the server PUT Update a resource on the server DELETE Delete a resource from the server
  • 21. Request - Method A CRUD style verb to associate the endpoint with an action on the server Method Description GET Read resource data from the server POST Create a resource on the server PUT Update a resource on the server DELETE Delete a resource from the server
  • 22. Response - Data Data returned by the server to the client after processing the request The HTML content of a requested web page Examples: JSON or XML of an API request
  • 23. Response - Status Code A numeric code to indicate the status of the request
  • 24. Response - Status Code A numeric code to indicate the status of the request Common Codes: Code Description 1xx Information i.e. 101 switching protocols 2xx Success i.e. 200 OK or 201 created 3xx Redirection i.e. 301 moved permanentely 4xx Client Error i.e. 401 unauthorized or 404 not found 5xx Server Error i.e. 500 internal server error
  • 25. Putting it all together… Requests use the URL, Method, Body and Headers to tell the server what it wants to do. GET https://api.twitter.com/1.1/statuses/user_timeline.json? user_id=onedirection&screen_name=onedirection Request: Response: Let’s take a look at the real data!
  • 27. Think about features that API should expose on the server Songzify It should… List all artists List all songs by artist List all songs Allow an artist to be created Allow an artist to be deleted /artists /songs/{artist_id} /songs /artists /artists/{artist_id} Endpoint GET GET GET POST DELETE Method - artist_id - artist_name artist_id Body
  • 28. Dinner with an API Exercise Groups of 2 Think through a full dinner and functionality a “Server” should provide to satisfy the “Client” Create a table showing the Endpoints, Methods, and Body for each action For each action, describe the expected response from the server
  • 30. API Docs API docs outline requirements for requests and response It’s a good idea to become familiar with their structure since most REST APIs follow the same format Examples: https://dev.twitter.com/rest/public https://developer.spotify.com/web-api/endpoint-reference/ https://www.instagram.com/developer/endpoints/
  • 32. What an API is How an API works 1 3 Where and why an API is used 2 Goals To understand…