The term API (Application Programming Interface) is typically used for when referring to a set of methods that are publicly exposed in order to interact/communicate with another application. Let’s say you write a web application that you would like other people to extend and add more features to. In order to do that you create an API…
Here is an example of a very popular “WEB” API: http://apidoc.digg.com/
Digg created a set of public web methods that are accessible via HTTP (hence why I call them “web” methods) and that allowed me to create my own little app on my server that displays Digg data. Now all APIs are different and their is no standard naming convention that I know of.
Google has them as well http://code.google.com/. When you integrate with external API you call that a mashup. I created my own Google maps mashup and you can see it here
Here is another more in-depth example:
Let’s say you have a contacts database and you would like to expose that via an API. Here are the steps you would need to take. Assuming that you are not a programmer I’m going to keep this light.
- Write a new page using your programming language (Perl, C#, PHP, Python, Rubi, etc) that talks to your contacts database and call it api.php (Will use PHP for this example)
- Create a method inside your page that will return contact info and call it GetContacInfoByName(string name).
- Write the necessary code to take a parameter and call that function, so let’s say if I wanted to invoke the GetContactInfoByName method I need to use <domain>/api.php?invoke=GetContactInfoByName&name=Chris This URL contains two parameters “invoke” and “name”. Invoke is used for selecting the method you wish to trigger and name is used for retrieving the data.
I wrote a page on my wiki and created a some code examples for the client/API and the response. Client being the API.