Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Start a free Basic trial
to watch this video
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.
API Notes
APIs don’t exist in isolation. Instead, APIs expose functionality of an application or service that exists independently of the API.
Further Reading
-
0:00
[MUSIC]
-
0:04
We have learned a lot about rest and rails, but
-
0:07
we haven't learned much about APIs yet.
-
0:10
API is an acronym for application programming interface.
-
0:14
This just means how our program can talk to other programs.
-
0:19
Remember those get and post methods?
-
0:21
These are some of the actions a restful API can perform.
-
0:24
So if you have a music app on your phone,
-
0:26
it might be getting information from a web version of that application.
-
0:31
To get a song, it will call get and send that request,
-
0:35
a get request, to the web service.
-
0:37
The Web service will look for the song ID, and say okay, and
-
0:41
pass it back to your phone.
-
0:44
APIs can also be used between programs,
-
0:46
like when you log into a program using Facebook.
-
0:49
An API is behind the scenes moving information between Facebook and
-
0:53
the service you are logging into.
-
0:56
In our app, we will be using a model like with a song service and
-
1:00
assume we are building an API so that a phone app, or another program on the web,
-
1:05
can call the information from our o.todo lists to another place,
-
1:09
where we can sort the list by incomplete or complete items.
-
1:14
To do this, we will need to expose some endpoints of our app.
-
1:18
So, what's an endpoint?
-
1:20
An endpoint is just one end of a communication channel.
-
1:24
That's it.
-
1:25
They often take the form of a URL.
You need to sign up for Treehouse in order to download course files.
Sign up