Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Introduction to APIs

Introduction to APIs

A brief overview of APIs for an audience who had no previous experience with APIs

Lark Mullins

March 18, 2016
Tweet

More Decks by Lark Mullins

Other Decks in Programming

Transcript

  1. Who Am I? Lark Mullins • Lead Developer for Outreach

    Technologies in OIT • We developed Webregistry, Golinks, OnCampus, and other applications across campus • [email protected]
  2. What is an API? Application Program Interface “In computer programming,

    an application programming interface (API) is a set of routines, protocols, and tools for building software applications. An API expresses a software component in terms of its operations, inputs, outputs, and underlying types. An API defines functionalities that are independent of their respective implementations, which allows definitions and implementations to vary without compromising the interface. A good API makes it easier to develop a program by providing all the building blocks. A programmer then puts the blocks together.” - Wikipedia
  3. What is an API? Application Program Interface “...APIs are sets

    of requirements that govern how one application can talk to another...APIs make it possible for big services like Google Maps or Facebook to let other apps "piggyback" on their offerings...APIs do all this by "exposing" some of a program's internal functions to the outside world in a limited fashion.” - ReadWriteWeb http://readwrite.com/2013/09/19/api-defined
  4. “Types” of APIs Web Service API • SOAP • XML-RPC

    (Remote Procedure Call) • JSON-RPC (Remote Procedure Call) • RESTful https://ffeathers.wordpress.com/2014/02/16/api-types/
  5. “Types” of APIs Class-Based API • Java • iOS •

    Android • OS X • Windows https://ffeathers.wordpress.com/2014/02/16/api-types/
  6. “Types” of APIs Other API Types • Library-based APIs •

    Hardware APIs • Websocket APIs • Any many others https://ffeathers.wordpress.com/2014/02/16/api-types/
  7. SOAP vs. RESTful APIs SOAP SOAP brings it’s own protocol

    and focuses on exposing pieces of application logic (not data) as services. SOAP exposes operations. SOAP is focused on accessing named operations, each implement some business logic through different interfaces. http://spf13.com/post/soap-vs-rest
  8. SOAP vs. RESTful APIs RESTful RESTs sweet spot is when

    you are exposing a public API over the internet to handle CRUD operations on data. REST is focused on accessing named resources through a single consistent interface. http://spf13.com/post/soap-vs-rest
  9. How to Use APIs Normally APIs are consumed using URI

    (Uniform Resource Identifier) Examples: POST https://api.ncsu.edu/1/students https://api.ncsu.edu/1/students/123456789
  10. How to Use APIs • SDK (Software Development Kit) •

    cURL, command line tool • JavaScript XMLHttpRequest (aka: Ajax)
  11. Conclusions • APIs are a mechanism to expose data and/or

    logic of an application to an external client • Two main types of API: SOAP and RESTful • Various ways to consume and use APIs within websites and applications