Bummer! This is just a preview. You need to be signed in with a Treehouse account to view the entire video.
How APIs Work1:27 with Naomi Freeman
API is an acronym for Application Programming Interface. This allows our program to interact with other programs. Individual resources are operated on via something called an endpoint.
APIs don’t exist in isolation. Instead, APIs expose functionality of an application or service that exists independently of the API.
We have learned a lot about rest and rails, but
we haven't learned much about APIs yet.
API is an acronym for application programming interface.
This just means how our program can talk to other programs.
Remember those get and post methods?
These are some of the actions a restful API can perform.
So if you have a music app on your phone,
it might be getting information from a web version of that application.
To get a song, it will call get and send that request,
a get request, to the web service.
The Web service will look for the song ID, and say okay, and
pass it back to your phone.
APIs can also be used between programs,
like when you log into a program using Facebook.
An API is behind the scenes moving information between Facebook and
the service you are logging into.
In our app, we will be using a model like with a song service and
assume we are building an API so that a phone app, or another program on the web,
can call the information from our o.todo lists to another place,
where we can sort the list by incomplete or complete items.
To do this, we will need to expose some endpoints of our app.
So, what's an endpoint?
An endpoint is just one end of a communication channel.
They often take the form of a URL.
You need to sign up for Treehouse in order to download course files.Sign up