$30 off During Our Annual Pro Sale. View Details »

API 101, What, Where, When

API 101, What, Where, When

APIs could be scary at first, but they don't have to.

Here is a workshop that explains everything you know about APIs.

I usually do this workshop for first-timers hackathon participants.

Nicolas Grenié

October 11, 2019
Tweet

More Decks by Nicolas Grenié

Other Decks in Technology

Transcript

  1. API 101, What, Where, How 11st October 2019 HackUPC Nicolas

    Grenié @picsoung @typeform
  2. Nicolas Grenié @picsoung

  3. About me @picsoung Developer Advocate Passionate by APIs Hackers

  4. None
  5. About Typeform Founded in 2013 $35M series B ‍‍ 200

    employees 30+ countries VideoAsk launched API platform
  6. Barcelona HQ

  7. Barcelona HQ

  8. Barcelona HQ

  9. None
  10. Application Programming Interface

  11. UI

  12. UI

  13. What is going to happen?

  14. None
  15. You have GIF?

  16. Sure, here

  17. That was an API

  18. APIs Are servers Talking to other servers

  19. Programmatic Actions

  20. None
  21. Examples

  22. None
  23. Examples

  24. Glovo

  25. Examples

  26. There is an API for (almost) everything

  27. APIs help you find an answer Or Offer an integration

    solution
  28. How to call an API?

  29. (Maybe)

  30. Memes API! https://api.imgflip.com

  31. Memes API!

  32. 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
  33. Step 2. - Implement in code Working app calling API

    and displaying results
  34. None
  35. None
  36. What About Security?

  37. API Key oAuth

  38. Advantage for API provider Who is calling the API Charging

    for API usage Turn off bad users Restrict access to your own data
  39. 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
  40. 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?
  41. oAuth

  42. 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
  43. None
  44. Webhooks Ping me when something happens

  45. 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
  46. Takeaways

  47. Takeaways Use APIs 3 type of interactions (API key, oAuth,

    webhook) Have fun!
  48. One more thing

  49. Questions? Nicolas Grenié (@picsoung) nicolas.grenie@typeform.com 11st October 2019 HackerUPC -

    Barcelona