Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
The public facing part of an app/class/system rhat you can hook a different application into
-
@Afrographics
class Hello {
public void hello() {
return;
}
}
There you go, hello is part of the public API of this class
But if you mean a web api, look for RESTApi frameworks for your desired language :) -
kiki353244yWhen you write console.log(‘hello’), you use either your browser or node api
When you go to devrant.com you use devrant web api which returns a webpage
When you tap ++ in the app you use devrant rest api which accepts the id of the rant and returns a status code (was the operation successful or not) -
kiki353244yApi is an exposed part of anything that you can interact with. Ui is an exposed part too but api is for robots and ui is for humans
-
It is for using some service without knowing how it works, you just use it from the methods they provide.
-
APPLICATION PROGRAMMING INTERFACE IS A THING THAT ALLOWS YOU TO INTERACT WITH OTHER THINGS THAT YOU NORMALLY WOULDN'T BE ABLE TO INTERACT WITH.
WHY YOU ASK?
WELL BECAUSE GOD IS DEAD AND SO IS HUMANITY'S ABILITY TO GOOGLE -
Now for an actual useful answer that isn't total shitpost.
Take a game for example.
You are a nice developer and want to give players some degree of extending or changing up the game.
So you set out to write a ModAPI that exposes (to a certain degree) classes, functions, values, fields, etc. That are capable of changing the game at runtime.
An example would be
class Player implements LivingEntitiy {
float x,y,z; //location
//Exposed to API
public vec3 getLocation() {
return new vec3(x,y,z);
}
...
}
Now your modding class
import com.name.game.modapi;
class MyMod implements GameMod {
modapi api = new modapi();
api.initialize();
System.out.println(api.getPlayer().getLocation());
}
Related Rants
What is an API in simple term ?
And some examples of API
question
api
backend