API 101, What, Where, How
11st October 2019
HackUPC
Nicolas Grenié
@picsoung
@typeform
Slide 2
Slide 2 text
Nicolas Grenié
@picsoung
Slide 3
Slide 3 text
About me @picsoung
Developer Advocate
Passionate by APIs
Hackers
Slide 4
Slide 4 text
No content
Slide 5
Slide 5 text
About Typeform
Founded in 2013
$35M series B
200 employees
30+ countries
VideoAsk launched
API platform
Slide 6
Slide 6 text
Barcelona HQ
Slide 7
Slide 7 text
Barcelona HQ
Slide 8
Slide 8 text
Barcelona HQ
Slide 9
Slide 9 text
No content
Slide 10
Slide 10 text
Application
Programming
Interface
Slide 11
Slide 11 text
UI
Slide 12
Slide 12 text
UI
Slide 13
Slide 13 text
What is
going to
happen?
Slide 14
Slide 14 text
No content
Slide 15
Slide 15 text
You have
GIF?
Slide 16
Slide 16 text
Sure,
here
Slide 17
Slide 17 text
That was an API
Slide 18
Slide 18 text
APIs
Are servers
Talking to other
servers
Slide 19
Slide 19 text
Programmatic
Actions
Slide 20
Slide 20 text
No content
Slide 21
Slide 21 text
Examples
Slide 22
Slide 22 text
No content
Slide 23
Slide 23 text
Examples
Slide 24
Slide 24 text
Glovo
Slide 25
Slide 25 text
Examples
Slide 26
Slide 26 text
There is an API for (almost)
everything
Slide 27
Slide 27 text
APIs help you find an answer
Or
Offer an integration solution
Slide 28
Slide 28 text
How to call an API?
Slide 29
Slide 29 text
(Maybe)
Slide 30
Slide 30 text
Memes API!
https://api.imgflip.com
Slide 31
Slide 31 text
Memes API!
Slide 32
Slide 32 text
Step 1. - Run without coding
In the browser (GET requests)
In the terminal (using curl)
Using apps like Postman or Paw
Debug API calls, decoupled from your code
Slide 33
Slide 33 text
Step 2. - Implement in code
Working app calling API and displaying
results
Slide 34
Slide 34 text
No content
Slide 35
Slide 35 text
No content
Slide 36
Slide 36 text
What
About
Security?
Slide 37
Slide 37 text
API Key
oAuth
Slide 38
Slide 38 text
Advantage for API provider
Who is calling the API
Charging for API usage
Turn off bad users
Restrict access to your own data
Slide 39
Slide 39 text
Let’s try!
1. Read Typeform API documentation
https://developer.typeform.com/
2. Get a Personal Token
3. Add token to API call using Authorization header
Slide 40
Slide 40 text
Ex2: Get all the responses of a form
GET Request on
api.typeform.com/forms/{form_id}/responses
documentation
How to get someone else’s forms?
Slide 41
Slide 41 text
oAuth
Slide 42
Slide 42 text
Ex3: Implement oAuth
Read detailed article here to learn about oAuth
Create an Application on Typeform
Use received token to make calls
Store user details in database
Display profile info after logging in
Slide 43
Slide 43 text
No content
Slide 44
Slide 44 text
Webhooks
Ping me when something happens
Slide 45
Slide 45 text
Ex4: Deal with webhooks
Add {glitchapp}/webhook as webhook to your
form
Send test webhook event
Find ids of fields you want to display
Test it! http://bit.ly/tf-hackupc-rate
Slide 46
Slide 46 text
Takeaways
Slide 47
Slide 47 text
Takeaways
Use APIs
3 type of interactions
(API key, oAuth,
webhook)
Have fun!
Slide 48
Slide 48 text
One more thing
Slide 49
Slide 49 text
Questions?
Nicolas Grenié (@picsoung)
[email protected]
11st October 2019
HackerUPC - Barcelona