r/AskProgramming • • Mar 26 '20

APIs Explained ...

I dunno but I don't understand APIs fluently. Does anyone know of an informative article or perhaps a website or just personally explain to me frankly wtf APIs are an why we need them ...

Edit: Thanks everyone for your empathetic contributions. Guess what; I have a better understanding of APIs now than I did before.

53 Upvotes

60 comments sorted by

View all comments

Show parent comments

6

u/frostbyte650 Mar 26 '20

Yeah, it sounds like you’re just calling them and they’re using their own internet to connect to the API

1

u/cellwall-999 Mar 26 '20

But without a voice? Really. I mean you just use a code like the same one you use to check your phone's IMEI and then a prompt.

And you can do that even with a Nokia 3310.

4

u/frostbyte650 Mar 26 '20

That’s how dial-up internet worked like 20 years ago

2

u/cellwall-999 Mar 26 '20

What do you mean?

3

u/frostbyte650 Mar 26 '20

Internet used to go through the phone lines as a series of beeps but now everything is digital cuz that sucked, now you’re just calling them and directing an automated service to use the internet for you

I can’t fit the entire history of the internet in a reddit post, but do some googling it’s pretty interesting

0

u/cellwall-999 Mar 26 '20

I still don't quite get it. Will ggl it though.

4

u/newcomertv Mar 26 '20

When your at it, look into phreaking.

They essentially whistled into the phone to call people for free. I'll leave the connection of you pressing a button on a flip-phone up to you ;)

https://www.britannica.com/topic/phreaking

0

u/cellwall-999 Mar 26 '20

This is not it. Far far away from this*

1

u/frostbyte650 Mar 26 '20 edited Mar 26 '20

No, that’s exactly along the lines I’m talking about, the history of the internet is crazy man & it all started with phones

In fact, before they made a computer Jobs & Wozniak made hacking devices that would play the right sounds to do this stuff like give you free long distance

3

u/javier123454321 Mar 26 '20

That is correct. You can look at a service like Twilio that does exactly that (through an API). The Api looks something like this (at a very high level)

You call in to a number that the bank set up.

The api has a function that checks the number that is calling to see if it is registered in their database.

If it is registered, then it prompts you for your pin.

When you send your pin, they check if that pin matches the pin for your number, sends back a response.

Then you select the option you want (say, send money)

the api asks to who, how much, and checks if you have enough money.

Then if everything is ok, and you confirmed, the api sends the money.

This is literally what an api does. You are interacting with the system without knowing what the system is doing. And yes, you are doing it online through your pone connection. (remember that the internet used to be phone lines back in the day)

You could set up the same type of system, but instead of sending money, it could make make a call that instructs it to make a post to reddit, but you would need a different api (that you would have to build).

2

u/Shinxsu Mar 26 '20

TIL one can interact with APIs via phone and digitized tones (keypresses).

Thx for that tidbit