Overview



API

Application Programming Interface

An API is a contract between application (app) and service.

  • Consumer vs Provider

    • A software app is often the consumer of an API.
    • When an API is offered over a network for consumption, the service that offers the API is said to be the provider or “API provider.”
  • The app may outsource requirements for data or functionality through an API by calling that API. To illustrate…

    • Patient record
    • Location represented as a pin on a map
    • The execution of a financial transaction
  • It’s a technical contract

    • Like a legal contract, it represents an understanding by all parties involved
    • The contract also represents agreed-upon standards

REST

REpresentational State Transfer

  • Architectural style of the web
  • A standard / set of guidelines by which you can structure and create APIs
  • REST APIs have identifiable properties…
    • They make use of Resource-based URLs

The guiding architectural constraints required for an API to be considered RESTful:

  1. Client-Server Architecture
  2. Statelessness
  3. Layered System
  4. Cacheability
  5. Uniform Design
  6. Code on Demand

Client-Server Architecture and Statelessness

REST APIs sit on top of web technology, like a hat. Similar to the web, a client (your program) makes a request to a server for a resource (i.e. an object). You will likely be using some sort of library to create the request to the server. The protocol used is HTTP and it’s stateless. The server won’t remember anything about the particular client. If you want to maintain state like your login credentials, you must send it with each and every request - you will do this using Headers.

Glossary of Terms

  • DNS - Domain Name System
  • HTTP - HyperText Transfer Protocol
  • IP - Internet Protocol
  • TCP - Transmission Control Protocol
  • TLS - Transport Layer Security
  • UDP - User Datagram Protocol
  • URL and URI - Uniform Resource Locator (URL) and Uniform Resource Identifier (URI)