Create a REST API with PHP

The abbreviation API stands for Application Programming Interface. What does it do? Well, let’s say it enables your website to be plugging enabled. This means that other websites can request information from your website and your website can process the data and send the result back to the website that requested it. Your source code is always kept intact from outsiders. API is highly synonymous with Object Oriented Programming (OOP), since without the OOP concept the plug-n-play ability of your website wouldn’t be achieved.

A really good example of an API would the Facebook Platform where thousands of new applications get added everyday. How do they work? Simple. Suppose you have a website and you want to make use of the Facebook API. So you request a particular information (suppose the number of friends of a user) and Facebook returns the result to you. So you see, you are not accessing the source codes of Facebook but you can use the information located in Facebook and adapt it for your own use. That’s API in a nutshell. So how do you get to make one? Here’s a great article by Ian from Gen X Design:

One of the latest (sort of) crazes sweeping the net is APIs, more specifically those that leverage REST. It’s really no surprise either, as consuming REST APIs is so incredibly easy… in any language. It’s also incredibly easy to create them as you essentially use nothing more than an HTTP spec that has existed for ages. One of the few things that I give Rails credit for is its well thought-out REST support, both for providing and consuming these APIs (as its been explained by all the Rails fanboys I work with).

Source: http://www.gen-x-design.com/archives/create-a-rest-api-with-php/

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: