DEV Community

Cover image for How APIs work — An Analogy For Dummies

How APIs work — An Analogy For Dummies

Timothy Choi on April 28, 2020

originally posted on Medium I was working on an university project with some course mates when I had this conversation. My course mate said: “I d...
Collapse
 
delphinocons profile image
Angelo Hulshout 🇮🇹 🇳🇱

Nice one, but one thing is missing in your analogy. Yes, interface and protocol are there, but by introducing the Tellers you introduced not only an interface or API, but also a set of services.

I do like your way of explaining though - are you in any way working as a trainer or coach? I am, might be worth discussing some time :-)

Collapse
 
tyteen4a03 profile image
Timothy Choi • Edited

Yes, the tellers are Endpoints in my analogy.

Collapse
 
delphinocons profile image
Angelo Hulshout 🇮🇹 🇳🇱

Checked again - looks like I missed a paragraph while scanning your article, you mentioned that indeed.

Note to self: don't do quick scans on articles at bed time.

Collapse
 
kanhalelor profile image
robSyntax

API - Application Programming Interface. It is a way of allowing you to access the data from another application or a way of applications to communicate with each other.

Take the example of a restaurant, since it belongs to someone else and you are not allowed to go to the Kitchen therefore the menu is the API. Allows you to make an order for food. Food is like data which you request for. The order you make is called an API call. When you make an order, the waiter will give you a response eg the food is available or not. Same happens with APIs, when you make an api call, you will either get a successful response and get your data or get an error and no data.