Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
APIs

(for beginners)
1. API Basics
2. How does it work

3. Demo
4. Webhooks
Application
Programming
Interface
APIs expose
something useful
An Interface
Used by a Program
To interact with

an Application
No (direct)
human usage
of APIs
Developers
write Programs
which consumes APIs
API Consumption
Web APIs
API
API
API
API
Web-101
Web-101
Web-101
Web-101
Human interface
Readable content

HTML / CSS
API
Programming interface
Structured data
{"richestPeople":[
{"firstName":"Bill", “lastName":"Gates", “value":"81"},
{"firstNa...
Let’s compare
https://api.github.com/users/devitagus
https://github.com/devitagus
Github website
Github API
Let’s play with Facebook graph API
Daily life
examples
Maps
Maps
Google Maps API
Login
Aggregators
Payments
Twilio API
UBER
Shares of Twilio (NYSE:TWLO) have more than quadrupled from its IPO price of $15.
Favspot
http://www.programmableweb.com/category/all/apis
As a developer,
I want to show venues

of next gigs in town on

a map
Timeout content manager
will enter venue addresses
Timeout content manager
doesn’t know
GPS coordinates of venues
There’s an API for that
Google Geocoding API
developers.google.com/maps/documentation/geocoding/
10 Downing St, London
10 Downing St, London
{
"location" : {
"lat" : 51.5034066,
"lng" : -0.1275923
}
} This is called JSON
How does it work?
API call is an HTTP request
https://maps.googleapis.com/maps/api/geocode/json?address=10 Downing St, London
Are we done?
We should now
integrate the
Google Maps API
http://maps.google.com/maps?
q=51.503066,-0.1275923
I want the app to
send text messages
if a gig is cancelled
Let’s look at some code
Step 1 - Sign up to Twilio
Step 2 - Fetch credentials
Step 3 - Write some ruby
require 'twilio-ruby'
account_sid = 'AC__________'
auth_token = '_____________'
client = Twilio::...
Step 4 - Run code
Your program sent a text!
WEBHOOKS
(API )-1
Don’t call us, we’ll call you
Webhook vs API call
API My app
API Call
Webhook vs API call
API My app
WEBHOOK
API Call
EXAMPLE
Typeform, please
call notify me as soon
a new member applied
Webhook
Typeform to capture leads
Slack for my sales team
Lead Management
API
Service B exposes methods
to read, create or update data
WEBHOOK
Typeform pushes data
as soon as available
API
Slack exposes methods
to read, create or update data
Introducing Zapier
Demo
When you’ll hit
Zapier's limit, come
learn to code at
Le Wagon!
Thank you!
API for Beginners
API for Beginners
API for Beginners
API for Beginners
Upcoming SlideShare
Loading in …5
×

API for Beginners

6,500 views

Published on

What's an API and why do you need one.

Published in: Technology

API for Beginners

  1. 1. APIs
 (for beginners)
  2. 2. 1. API Basics 2. How does it work
 3. Demo 4. Webhooks
  3. 3. Application Programming Interface
  4. 4. APIs expose something useful
  5. 5. An Interface
  6. 6. Used by a Program
  7. 7. To interact with
 an Application
  8. 8. No (direct) human usage of APIs
  9. 9. Developers write Programs which consumes APIs
  10. 10. API Consumption
  11. 11. Web APIs
  12. 12. API API API API
  13. 13. Web-101
  14. 14. Web-101
  15. 15. Web-101
  16. 16. Web-101
  17. 17. Human interface Readable content
 HTML / CSS
  18. 18. API
  19. 19. Programming interface Structured data {"richestPeople":[ {"firstName":"Bill", “lastName":"Gates", “value":"81"}, {"firstName":"Carlos", “lastName":"Slim", “value”:"79"}, {"firstName":"Warren", “lastName":"Buffet", "value":"72"} ]}
  20. 20. Let’s compare https://api.github.com/users/devitagus https://github.com/devitagus Github website Github API
  21. 21. Let’s play with Facebook graph API
  22. 22. Daily life examples
  23. 23. Maps
  24. 24. Maps
  25. 25. Google Maps API
  26. 26. Login
  27. 27. Aggregators
  28. 28. Payments
  29. 29. Twilio API
  30. 30. UBER Shares of Twilio (NYSE:TWLO) have more than quadrupled from its IPO price of $15.
  31. 31. Favspot
  32. 32. http://www.programmableweb.com/category/all/apis
  33. 33. As a developer,
  34. 34. I want to show venues
 of next gigs in town on
 a map
  35. 35. Timeout content manager will enter venue addresses
  36. 36. Timeout content manager doesn’t know GPS coordinates of venues
  37. 37. There’s an API for that
  38. 38. Google Geocoding API developers.google.com/maps/documentation/geocoding/
  39. 39. 10 Downing St, London
  40. 40. 10 Downing St, London { "location" : { "lat" : 51.5034066, "lng" : -0.1275923 } } This is called JSON
  41. 41. How does it work?
  42. 42. API call is an HTTP request https://maps.googleapis.com/maps/api/geocode/json?address=10 Downing St, London
  43. 43. Are we done?
  44. 44. We should now integrate the Google Maps API
  45. 45. http://maps.google.com/maps? q=51.503066,-0.1275923
  46. 46. I want the app to send text messages if a gig is cancelled
  47. 47. Let’s look at some code
  48. 48. Step 1 - Sign up to Twilio
  49. 49. Step 2 - Fetch credentials
  50. 50. Step 3 - Write some ruby require 'twilio-ruby' account_sid = 'AC__________' auth_token = '_____________' client = Twilio::REST::Client.new(account_sid, auth_token) client.messages.create( from: '+336123456789', to: '+3370000000000', body: 'Hi buddy, you should attend Le Wagon!' )
  51. 51. Step 4 - Run code
  52. 52. Your program sent a text!
  53. 53. WEBHOOKS (API )-1
  54. 54. Don’t call us, we’ll call you
  55. 55. Webhook vs API call API My app API Call
  56. 56. Webhook vs API call API My app WEBHOOK API Call
  57. 57. EXAMPLE
  58. 58. Typeform, please call notify me as soon a new member applied Webhook
  59. 59. Typeform to capture leads Slack for my sales team Lead Management
  60. 60. API Service B exposes methods to read, create or update data
  61. 61. WEBHOOK Typeform pushes data as soon as available API Slack exposes methods to read, create or update data
  62. 62. Introducing Zapier
  63. 63. Demo
  64. 64. When you’ll hit Zapier's limit, come learn to code at Le Wagon!
  65. 65. Thank you!

×