SlideShare a Scribd company logo
1 of 27
APIs Demystified
                  Brandon West




brandon.west@sendgrid.com         @brandonmwest
Application Programming Interface
Application Programming Interface
Application Programming Interface
Application Programming Interface
Application Programming Interface
An API:
 Describes an Interface
Through which Programs can interact
      with an Application
API
API is an umbrella term...
API
API
API
API
API is an umbrella term...
API is an umbrella term...
...but we usually mean Web API
API is an umbrella term...
...but we usually mean Web API




    So, what’s a Web API?
Typical Web Request

                Give me
                            Web Server
Client        google.com!




             Here you go!
HTTP Requests in Google Chrome
HTTP Request Headers
GET /intl/en_com/images/srpr/logo3w.png HTTP/1.1
Host: www.google.com
Connection: keep-alive
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS
X 10_7_1) AppleWebKit/535.1 (KHTML, like Gecko)
Chrome/14.0.835.202 Safari/535.1
Accept: */*
Referer: http://www.google.com/
Accept-Encoding: gzip,deflate
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3


HTTP Response Headers
HTTP/1.1 200 OK
Content-Type: image/png
Last-Modified: Fri, 05 Aug 2011 02:40:26 GMT
Date: Tue, 18 Oct 2011 21:54:02 GMT
Expires: Tue, 18 Oct 2011 21:54:02 GMT
Cache-Control: private, max-age=31536000
X-Content-Type-Options: nosniff
Server: sffe
Content-Length: 7007
X-XSS-Protection: 1; mode=block
So what about APIs?

                      Give me my
                      klout score!
                                     Klout API
API Implementation




                     Here you go!
API Call (via HTTP)
http://api.klout.com/1/klout.json?users=brandonmwest&key=XXXXXXXXXXXXX
API Payload

<?xml version="1.0" encoding="UTF-8"?>
<users>
  <user>
    <twitter_screen_name>brandonmwest</twitter_screen_name>
    <kscore>52.26</kscore>
  </user>
</users>
End Points, Methods and Calls
APIs are awesome
brandon.west@sendgrid.com   @brandonmwest

More Related Content

Similar to APIs Demystified

Using an API
Using an APIUsing an API
Using an APIAdam Culp
 
HTTP Basic - PHP
HTTP Basic - PHPHTTP Basic - PHP
HTTP Basic - PHPSulaeman .
 
RESTFul Web Services - Intro
RESTFul Web Services - IntroRESTFul Web Services - Intro
RESTFul Web Services - IntroManuel Correa
 
SAPO Messenger Meets Web 2.0
SAPO Messenger Meets Web 2.0SAPO Messenger Meets Web 2.0
SAPO Messenger Meets Web 2.0Luis Troni
 
Modern webservices using gRPC and Protocol Buffers in Golang
Modern webservices using gRPC and Protocol Buffers in GolangModern webservices using gRPC and Protocol Buffers in Golang
Modern webservices using gRPC and Protocol Buffers in GolangOmidHojabri1
 
Google Protocol Buffers + gRPC
Google Protocol Buffers + gRPCGoogle Protocol Buffers + gRPC
Google Protocol Buffers + gRPCImal hasaranga
 
CocoaConf: The Language of Mobile Software is APIs
CocoaConf: The Language of Mobile Software is APIsCocoaConf: The Language of Mobile Software is APIs
CocoaConf: The Language of Mobile Software is APIsTim Burks
 
PHP Training: Module 1
PHP Training: Module 1PHP Training: Module 1
PHP Training: Module 1hussulinux
 
Python tools for testing web services over HTTP
Python tools for testing web services over HTTPPython tools for testing web services over HTTP
Python tools for testing web services over HTTPMykhailo Kolesnyk
 
What I learned about APIs in my first year at Google
What I learned about APIs in my first year at GoogleWhat I learned about APIs in my first year at Google
What I learned about APIs in my first year at GoogleTim Burks
 
Plack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and serversPlack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and serversTatsuhiko Miyagawa
 
SnorGen User Guide 2.0
SnorGen User Guide 2.0SnorGen User Guide 2.0
SnorGen User Guide 2.0Sungho Yoon
 
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...apidays
 
Web Server-Side Programming Techniques
Web Server-Side Programming TechniquesWeb Server-Side Programming Techniques
Web Server-Side Programming Techniquesguest8899ec02
 

Similar to APIs Demystified (20)

Using an API
Using an APIUsing an API
Using an API
 
HTTP Basic - PHP
HTTP Basic - PHPHTTP Basic - PHP
HTTP Basic - PHP
 
Introduction to python scrapping
Introduction to python scrappingIntroduction to python scrapping
Introduction to python scrapping
 
RESTFul Web Services - Intro
RESTFul Web Services - IntroRESTFul Web Services - Intro
RESTFul Web Services - Intro
 
SAPO Messenger Meets Web 2.0
SAPO Messenger Meets Web 2.0SAPO Messenger Meets Web 2.0
SAPO Messenger Meets Web 2.0
 
Gohan
GohanGohan
Gohan
 
Modern webservices using gRPC and Protocol Buffers in Golang
Modern webservices using gRPC and Protocol Buffers in GolangModern webservices using gRPC and Protocol Buffers in Golang
Modern webservices using gRPC and Protocol Buffers in Golang
 
Google Protocol Buffers + gRPC
Google Protocol Buffers + gRPCGoogle Protocol Buffers + gRPC
Google Protocol Buffers + gRPC
 
Crafting APIs
Crafting APIsCrafting APIs
Crafting APIs
 
CocoaConf: The Language of Mobile Software is APIs
CocoaConf: The Language of Mobile Software is APIsCocoaConf: The Language of Mobile Software is APIs
CocoaConf: The Language of Mobile Software is APIs
 
PHP Training: Module 1
PHP Training: Module 1PHP Training: Module 1
PHP Training: Module 1
 
Python tools for testing web services over HTTP
Python tools for testing web services over HTTPPython tools for testing web services over HTTP
Python tools for testing web services over HTTP
 
What I learned about APIs in my first year at Google
What I learned about APIs in my first year at GoogleWhat I learned about APIs in my first year at Google
What I learned about APIs in my first year at Google
 
Plack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and serversPlack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and servers
 
Web Dev 21-01-2024.pptx
Web Dev 21-01-2024.pptxWeb Dev 21-01-2024.pptx
Web Dev 21-01-2024.pptx
 
SnorGen User Guide 2.0
SnorGen User Guide 2.0SnorGen User Guide 2.0
SnorGen User Guide 2.0
 
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
 
Cgi
CgiCgi
Cgi
 
Web Server-Side Programming Techniques
Web Server-Side Programming TechniquesWeb Server-Side Programming Techniques
Web Server-Side Programming Techniques
 
unit1 part 1 sem4 php.docx
unit1 part 1 sem4 php.docxunit1 part 1 sem4 php.docx
unit1 part 1 sem4 php.docx
 

Recently uploaded

New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
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
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
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
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
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
 
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
 
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 Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 

Recently uploaded (20)

New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
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
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
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
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
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
 
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?
 
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 Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 

APIs Demystified

Editor's Notes

  1. \n
  2. API stands for Application Programming Interface.\nGlad I could clear that up. Thanks for coming, any questions?\n
  3. An application is anything that lets you perform a specific task that isn&amp;#x2019;t a core function of the device. For example, receiving a phone number on a smartphone is a core function of the device, but if you want to do something more important like launch birds at pigs or make fart sounds, you need to download a specific application made for doing just that. \n\nYou can think of an application like a toaster. You plug it into your power source and it does a specific task (making toast). \n
  4. Programming is not magic. Programming is getting a machine to perform an operation or a set of operations by giving it instructions. Let&amp;#x2019;s go back to our toaster. You&amp;#x2019;re all set up with your shiny new toaster, and it&amp;#x2019;s time to make some delicious sourdough toast. You need to give the toaster some instructions that tell it how dark you want the toast to be. So you give the toaster some instructions, and you yell &amp;#x201C;HEY TOASTER, MAKE MY TOAST VERY DARK.&amp;#x201D; But the toaster doesn&amp;#x2019;t listen to you, and stares at you like you&amp;#x2019;re a fool.\n\n\n
  5. We tried yelling instructions at our toaster, but it didn&amp;#x2019;t work. That&amp;#x2019;s because we didn&amp;#x2019;t use an interface that the toaster understood. If we instead turn the toast darkness dial, we are now giving the toaster instructions in a way that it expects and understands. That&amp;#x2019;s an example of &amp;#x201C;application programming&amp;#x201D; - you&amp;#x2019;ve told your application how you expect it to behave by giving it instructions, but it didn&amp;#x2019;t mean anything until we had an interface that provided those instructions to the toaster in a way that is meaningful to both us and the toaster.\n\nThe most important part of &amp;#x201C;application programming interface&amp;#x201D; is in fact the last part, interface. An interface is a connection point that allows some interaction to take place between discrete components. \n\nThe cool thing is that the components don&amp;#x2019;t care about how the other is going to act, as long as it plays by the rules. For example, think of standard mains electrical wiring in your house. You can plug any device into a power outlet, and as long as it follows the rules defined by the system (it can operate at 60hz and 120 volts), it will work. \n\nInterfaces are not just limited to hardware like a power outlet or a dial on a toaster. They can also describe connection points between software. Think of any software that uses plugins or add-ons, such as your browser extensions, or macros in Excel. Those extensions are interfacing with the rest of the browser or the rest of the spreadsheet via software connection points; in fact, they are talking to those applications via an API.\n\nWhat&amp;#x2019;s the deal with toaster knobs going to 6?\n\n
  6. APIs describe a set of expectations, but they don&amp;#x2019;t actually describe how those expectations are going to be implemented and used. You can&amp;#x2019;t open up an API on your iPhone or your laptop and run it like an application. APIs are generally invisible to end users, but you use them everyday without realizing it. You interact with real, concrete implementations of APIs rather than with the APIs themselves. \n\nThink back to the power outlet, you plug something in and as long as it plays by the rules, it works. Your Twitter client on your smartphone plugs in to the Twitter API to perform certain tasks, such as showing tweets by people you follow, or posting a new tweet. As long as the Twitter client you are using adheres to the expectations of the Twitter API, it works. The API doesn&amp;#x2019;t care if you&amp;#x2019;re using Android or an iPhone or if the code using the API is written in Java or Objective C. In geek speak we say that the interface is agnostic, because it doesn&amp;#x2019;t care at all about how it is implemented.\n\n
  7. Let&amp;#x2019;s think back to the toaster. In order to make darker toast, we had to turn a knob that is hardwired to the heating element. But imagine if our toaster had an API to describe and handle instructions like &amp;#x201C;change the toast setting&amp;#x201D; or &amp;#x201C;start toasting&amp;#x201D;, and instead of being wired directly to the hardware, the knob interfaced with an API? The API doesn&amp;#x2019;t care what&amp;#x2019;s talking to it, only that whatever is talking to it follows the rules. The knob being turned would tell the API &amp;#x201C;change the darkness setting&amp;#x201D;, and the API would then apply that setting to the toaster.\n\nNow that we have a layer that abstracts the interface, we could add a voice module that knows what we mean when we yell that we want darker toast. The voice module code would interpret the command, translate it so it can communicate with the API, and the API would again communicate with the toaster to affect the necessary changes. Now we&amp;#x2019;ve got a toaster you can yell at!\n\nA voice activated toaster sounds crazy, but would actually be possible using some programmable hardware such as an Arduino. People have done stuff more ridiculous than this - someone made a pair of sneakers that uses an accelerometer to post to twitter every time you take a step.\n\n\n
  8. The term API is general and broad in scope, and can be applied to many different situations. Sometimes this variability can lead to confusion. APIs at different scopes can seem very different, but they always do basically the same thing; they give you an interface to provide instructions.\n\n
  9. Operating System -&gt; Hardware ( Device driver )\n\nA device driver is like an API but with a hardware component. Operating systems don&amp;#x2019;t care what hardware you plug into them as long as there is a device driver to describe the interaction. \n
  10. \nCode -&gt; Code framework ( Java core or .NET Framework )\n\nA developer writing code in Java might use low-level methods that are built into the programming language to perform a task such as checking that a password is at least 8 characters or to take the square root of a number. These are tasks that could be manually, but it makes a lot more sense to abstract the details so developers can focus on the interesting stuff. This also allows for the code that handles these specific tasks to be optimized in ways that wouldn&amp;#x2019;t always happen if we had to code them up every time.\n\n\n
  11. \nProgram -&gt; Operating System ( Save this file, etc)\n\nPrograms can interact with an operating systems API to handle tasks like creating, opening, and writing to files, playing sounds, and outputting graphics to devices. Can you imagine if every developer had to handle these low-level operations in their code? Programs would be much larger, take longer to write, and there would be a lot more inconsistency. With these APIs, developers can tell the operating system &amp;#x201C;I need a progress bar and a few buttons&amp;#x201D; and the OS provides standard, consistent widgets for use.\n\n\n
  12. App -&gt; Web App (show all arcades near the user&amp;#x2019;s area code on a map)\n
  13. APIs can refer to a lot of different types of interfaces, as we&amp;#x2019;ve just seen. But nowadays, when people are talking about APIs, there&amp;#x2019;s a really good chance that they are referring to web APIs unless they specify some other context. \n\nA web API is an interface with additional layers that standardize communications and give options on how to format the input and output so that they can be commonly used across multiple systems.\n\nA protocol layer defines and enables communication between multiple parts of a system - for example, the protocol that manages traffic on the internet is called TCP/IP, and it&amp;#x2019;s responsibly for telling machines how to find one another and giving them a common language for trading data back and forth.\n\nWeb APIs make use of a widely implemented and well known protocol called HTTP, or hypertext transfer protocol. You&amp;#x2019;ve used HTTP a lot - every time you load something in your browser, chances are that you are sending your request and receiving the response via HTTP.\n\n\n
  14. APIs can refer to a lot of different types of interfaces, as we&amp;#x2019;ve just seen. But nowadays, when people are talking about APIs, there&amp;#x2019;s a really good chance that they are referring to web APIs unless they specify some other context. \n\nA web API is an interface with additional layers that standardize communications and give options on how to format the input and output so that they can be commonly used across multiple systems.\n\nA protocol layer defines and enables communication between multiple parts of a system - for example, the protocol that manages traffic on the internet is called TCP/IP, and it&amp;#x2019;s responsibly for telling machines how to find one another and giving them a common language for trading data back and forth.\n\nWeb APIs make use of a widely implemented and well known protocol called HTTP, or hypertext transfer protocol. You&amp;#x2019;ve used HTTP a lot - every time you load something in your browser, chances are that you are sending your request and receiving the response via HTTP.\n\n\n
  15. APIs can refer to a lot of different types of interfaces, as we&amp;#x2019;ve just seen. But nowadays, when people are talking about APIs, there&amp;#x2019;s a really good chance that they are referring to web APIs unless they specify some other context. \n\nA web API is an interface with additional layers that standardize communications and give options on how to format the input and output so that they can be commonly used across multiple systems.\n\nA protocol layer defines and enables communication between multiple parts of a system - for example, the protocol that manages traffic on the internet is called TCP/IP, and it&amp;#x2019;s responsibly for telling machines how to find one another and giving them a common language for trading data back and forth.\n\nWeb APIs make use of a widely implemented and well known protocol called HTTP, or hypertext transfer protocol. You&amp;#x2019;ve used HTTP a lot - every time you load something in your browser, chances are that you are sending your request and receiving the response via HTTP.\n\n\n
  16. These requests return information that the browsers know how to handle - HTML to describe how things are laid out for presentation, images to be rendered, and javascript files to add dynamic behavior and interactivity.\n\nEach resource, whether is an image or an HTML page or a javascript file, is requested by it&amp;#x2019;s own HTTP request and delivered in it&amp;#x2019;s own HTTP response. Loading a webpage is a big HTTP conversation made up of exchanges between your browser and the web server.\n\nLet&amp;#x2019;s take a peek behind the curtain and look at an actual HTTP exchange.\n\n\n
  17. This is a subset of the HTTP Requests that my browser made to Google in order to load the google homepage. This information is readily available for you to explore and play with.\nAll I had to do was go to the tools menu and select Developer Console, then click on the Network tab.\n\nYou can see a variety of information about each request... (explain some of the categories)\n\nWe&amp;#x2019;re going to examine the actual request and response for the highlighted row, which is the Google logo.\n
  18. These are the headers of an HTTP exchange, both the request and the response. Headers are descriptive information about the requester. \n\nThe top line is called the Request Line - it describes the HTTP method being invoked (in this case, &amp;#x201C;GET&amp;#x201D;, because we are getting a resource from the server), the location of the resource, and the protocol (HTTP/1.1)\n\nAfter that, you see a collection of header lines. Each header is a piece of information that helps the server respond to request appropriately. *speak about various headers*\n\nAnd in the response, at the top you see the protocol and a status code. You&amp;#x2019;ve seen these status codes before - if you&amp;#x2019;ve ever seen &amp;#x201C;404 not found&amp;#x201D;, that&amp;#x2019;s an HTTP status code saying that the server couldn&amp;#x2019;t locate the resource that was requested. \n\nThe response headers describe the content to the requester so that the browser can handle it - you can see that it&amp;#x2019;s an image, so the browser can treat it as an image. You can also see information that helps the browser cache the image to reduce load time and bandwidth usage.\n\nWhat you are seeing here is just metadata - data that describes the interaction. The actual payload, in case the image file, is sent back to the browser after the response header has been sent.\n
  19. We&amp;#x2019;ve got this great protocol for handling the transfer of resources between remote machines. It&amp;#x2019;s been around for 20 years, it&amp;#x2019;s widely supported, well-documented, and easy to use in code. All of that is pretty great and it&amp;#x2019;s pretty much exactly the sort of transport layer that we need to enable web API calls.\n\nA browser uses HTTP to request resources like HTML files, images, and javascript from a server that knows how to respond to HTTP requests. HTTP is also used to send data to the web server, such as when we fill out a form on a website, but instead of using a HTTP GET, in this case we would use an HTTP POST request to indicate that we are sending information to the server rather than retrieving it.\n\nA web API uses HTTP in an analogous way, but for different types of resources. Let&amp;#x2019;s use Klout&amp;#x2019;s API as an example. You can send a request via HTTP to Klout&amp;#x2019;s API that says &amp;#x201C;hey Klout, I&amp;#x2019;d like to retrieve my klout score.&amp;#x201D; The API would take that request and pass it to Klout&amp;#x2019;s code that handles retrieving that information from a database, receive a set of results from the database, and then package the retrieved resources so they can be sent back to the requester in a way that makes sense.\n
  20. Here is a look at the actual request we&amp;#x2019;d make to Twitter asking for the list of users that we follow, along with the response headers.\n\n\n\n
  21. Just as our browser understands how to handle HTML and images that are returned by HTTP requests, the programs that we write to interact with APIs have to understand how to handle the resource payloads that the API returns. That means that the payload needs to be machine-readable so that code can easily interact with the resource. And ideally, we&amp;#x2019;d like the payload to be at least somewhat human-readable so that we can understand it outside of the context of code as well.\n\nThere have been several different approaches for achieving these goals over the years. For the most part, two formats have won out, and they are XML and JSON. It&amp;#x2019;s incredibly rare to find a web API that doesn&amp;#x2019;t use these formats nowadays, and more often than not APIs will offer both. \n\nThis is really powerful stuff. It&amp;#x2019;s taking something that would typically be complicated and making it incredibly easy. When you use your voice-activated toaster, you don&amp;#x2019;t really worry about how the toast is made, you simply tell the toaster to make toast and the toaster gives you toast; you don&amp;#x2019;t have to understand how the circuitry in the toaster works.\n\n**Talk about apigee/mashery and how people can try out API calls**\n
  22. Web APIs are usually described in terms of end points, methods, and calls. \n\nYou can think of end points as generally corresponding to types of resources; in Klout&amp;#x2019;s API, there are end points for score, for users, and for relationships.\n\nMethods are just specific actions on those end points; for example, you can retrieve detailed information on a user, or you can retrieve a list of a user&amp;#x2019;s topics of influence. Both of these actions are referred to as methods on the User endpoint.\n\nCalls are just instances of these actions. You can think of each HTTP request that you make to an API method as a call. It&amp;#x2019;s really no different than a phone call - you specify a destination, establish a connection, communicate, and then disconnect.\n
  23. APIs make the world smaller - say you wanted to include maps on your website. Mapping is a tough problem in a lot of ways; finding and storing the map data, adding a nice user interface on top of it, etc. Luckily some really smart people at Google have solved that problem. \n\nThere are 4000+ APIs listed on Programmable Web. \n\nDiscover awesome use cases by mashing up APIs - for example, API that crawls Craigslists for rental properties and mashes it up with Google maps.\n\nAPIs give you access to a lot of features that wouldn&amp;#x2019;t otherwise be feasible - handle phone calls, send email, accept credit card payments without having to worry about PCI compliance.\n\nAPIs reduce the amount of infrastructure that you have to build and maintain. \n\nAPIs reduce the amount of code your developers have to write. Why write an authentication module when you can authenticate with Twitter or Facebook.\n\nAPIs increase customer loyalty - if code has been written around a specific API, their is a cost associated with making a change to a different provider.\n\nIf you build an API before you build your application, you enable flexibility if you decide to change course/do unexpected things\n
  24. Interesting to note that Klout actually built their whole business model on the fact that companies like Twitter and Facebook have an API - they use those APIs to pull data that allows them to apply mathematical models of influence to the users or those services. And then they have an API for accessing those results - which are then used in many social media clients.\n\n\n
  25. Full Contact started out with a specific application that received inbound email, added a bunch of contact information about the sender, and then delivered it.\n\nWhen they went to the TechStars program, David Cohen basically told them to stop worrying about the specific implementations and focus on the core problem - filling contact information. Now they have over 1100 developers using their platform.\n
  26. \n