Skip to content

Commit 0d87817

Browse files
committed
API lesson plan additions
1 parent 5bf947c commit 0d87817

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

JavaScript Outlines/ApiAjaxJSon.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
API in a nutshell
3939
/////////////////
4040
• An API stands for Application Programming Interface, which is a fancy way of saying what one application exposes to another.
41+
• A better way to think about API's is that it is a CONTRACT between two things and how they interact with each other.
4142
4243
• Think of a restaurant as an analogy of an API.
4344
• You dont go staight up to the chef to place your order, you need to look at the menu and order something from there because that
@@ -66,7 +67,24 @@ API in a nutshell
6667
and wants to let you modify.
6768
• For example, you could update a user through a REST API, but they will only let you update the password and email... not the name.
6869
• You could also get users from this API, but they will not return the passwords of those users.
69-
• Again, the servers are secure because they only expose the information they want to expose.
70+
• Again, the servers are secure because they only expose the information they want to expose through this API.
71+
• In other words, the API is the contract between the server and the client.
72+
73+
• Libraries are another common form of API that pulls a specific code library into your own code.
74+
• Libraries have many methods definined in them that do specific things when you call them and return specific data when you call them.
75+
• This is an API as its a contract between the library code you've installed and your project that's using the library.
76+
• When using library API's, you have:
77+
• Different ways of accessing it (i.e. loading into your project, meta, etc.)
78+
• You can only use the methods that they expose (i.e. jquery library, etc)
79+
• You cannot access the internals of that library unless its through the methods of the API library exposed to you.
80+
81+
• The common theme of API's is that they only expose what they want you to be able to acess and hide everything else to make it as secure as possible.
82+
• Also common with API's is some sort of TOKEN to authenticate yourself with the API, which allows the application to know who's accessing it and limit
83+
what that person can access based on specific permissions.
84+
85+
86+
87+
7088
7189
7290

0 commit comments

Comments
 (0)