June 29 2010
WP-RESTful WordPress Plugin
Tagged Under : api, extension, networking, plugin, rest, restful, Wordpress
Hello!
I’m 99% sure that you already heard about APIs or REST APIs, it’s what Twitter, flickr and a lot more companies use to share they’re resources with a consumer.
A consumer can be anything from a website (for example, showing your Twitter updates on your blog or personal website) to a desktop / mobile application (iPhone, Android, Windows Mobile, …).
This is possible because all information sent to and from the API is encoded in either two common, inter-platform language, XML and JSON.
The difference between a regular API and a REST API is on the way they work. A REST API requires two entities to work, a client and a server.
Download WP-RESTful (Version 0.1)
Download WP-RESTful Users Plugin (Version 0.1)
Download WP-RESTful Categories Plugin (Version 0.1)
Download WP-RESTful Tags Plugin (Version 0.1)
Follow me for real-time updates
How does it work?
WP-RESTful uses OAuth, a widely, commonly and open source API implementation used all over the World (Wide Web).
The way it work is fairly simple.
First a Consumer registers with a Server. At this point the Server will provide the Consumer with 2 tokens, a public and a private token. The public token will be used to communicate and identify the Consumer with the Server while the private token will be stored locally for security and integrity reasons.
After this the Consumer will request the Server with a Request Token. This Request Token will be used to initiate the Authentication Protocol in where the Consumer will be required to authorize the Server.
The Server will create 2 new token (definitive tokens). They will be our authentication tokens.
I know this sounds and seems complicated but you won’t need to do anything as the Plugin will do almost everything for you (Registration and Authentication process are manual).
Plugin features
- Add new Plugins to API Plugin to extend functionalities to any way you want/need. (See next group)
- Fully manageable Client and Server side.
- Ability to choose what fields are allowed to be returned to the consumer.
- Ability to restrict modules to OAuth authentication process or liberated them and make them open.
- Load balance system where you can specify how many requests a given consumer is allowed in a 60 minute timeframe.
- Out of the box Post and Comments management.
- And much more…
Plugins
As stated on “Plugin Features” you have the ability to develop and/or add new modules to your REST API. This means, for example, if you use a plugin like WP E-Commerce, you can develop a plugin for the REST API in order to provide support for WP E-Commerce resources.
The way these plugins are developed is very similar to how plugins for WordPress are developed.
You can see this video that explains how plugins work and how you can develop them.
Requirements?
All requirements for the plugin to work properly are addressed by the plugin itself, upon activation. You can see your system status on WP-RESTful link after activation the plugin.
How to install?
This plugin is installed like any other WordPress plugin out there.
- First you need to download it from WordPress Plugin Repository.
- Upload the contents of the compacted file to your plugin folder on your WordPress installation.
- Go to your WordPress Administration page and activate the Plugin (Plugins → Installed → WP-RESTful → Activate)
- Create a new page, name it API, set the permalink to /api and set the content as [REST_return] and save the page.
- Go to WP-RESTful → WP-RESTful to check your system status.
I need help!
Check these two videos. They will help you starting up.
This post will be updated, if needed, to reflect changes made to the plugin.












[...] This post was mentioned on Twitter by José P. Airosa, Eurico Leite. Eurico Leite said: RT @joseairosa: WP-RESTful WordPress Plugin | PHP, CSS, HTML, Web & beyond http://bit.ly/ctw1ib [...]
[...] WP-RESTful WordPress Plugin | PHP, CSS, HTML, Web & beyond [...]
Can this plugin be used to interact with other REST APIs from other services such as Google, Freshbooks, Basecamp, etc, etc?
Hello Tony,
Unfortunately no. This plugin is intended to install and have a fully working REST API on your Blog that will let other entities connect to your blog and, in the other hand, will let you connect to other WP-RESTful APIs from other Blogs.
Anyways, I’ve been working on the last few days on what you just asked. I will be releasing a new version of the plugin that will enable this functionality.
Thanks for your feedback!
Great! Specifically – I use WordPress as a centralized project management portal while developing client websites. I’ve been looking for a solution that will pull in various services I use to mange these projects and present them simply in my client portal site – a Google Doc here, a Freshbooks project task list there, etc. Rather than write custom code for each I’m looking to use a framework such as this to add different service APIs to my portal sites. I’m looking forward to watching this WP-RESTful project develop, very solid work here.
Hello Jose,
GREAT work! Congratulations!
Do you have any plan to document the way an external non-wp platform can connect and use the WP-RESTful API of a WP installation.
I realize that a wrapper for it can be a time consuming thing.
Thank you very much,
Clement
And .. I can’t wait to see the next version including the interfacer with other APIs ..
Keep us updated each time you have the chance
Hello Clement,
Thank you for your words
I have provided all the files needed for this on the “API Client PHP” folder. It works exactly as Twitter API works.
I will try to make a screencast on that in the future days.
Best regards!
Wow.. So much work ..
Right. “API Client PHP” is exactly what i need
I’m working on that as we speak
My idea is to provide 2 things:
1- An easy way to develop in-house plugins with oother APIs
2- Provide a working and simple framework for easy connection with external non wp-restful APIs.
I will try to have it ready til the end of the month.
You’ve got a new friend
Thank you,
[...] consultar mais informação na página do Plugin ou directamente no repositório de Plugins do WordPress Share this on [...]
Congratulations for the work with this plugin, really amazing stuff here. Thanks!
Thanks a lot Nuno.
Be sure to check new version by the end of the month
After reading all of the documentation, which it quite impressive, I’m still trying to figure out a good use for this. Can you list a few situations in which I would want to use this framework? The developer above with the multiple clients gives me sort of an idea. Specifically why did you develop this plugin?
Hello Zach,
Thank you for the comment.
I developed this plugin, first of all, out of fun and challenge. Secondly for a few end-game implementations:
- iPhone/Andorid/Windows Mobile app development for your blog
- Blog networking (connect more than one blog that you own to each other)
- Unified login system
- Development of a centralized blog info repository. (this is one thing that I’m thinking of for the future, basically think of this like feed aggregation, but with the possibility of sharing more than only posts… basically you can share almost everything you want from your blog)
- Advertisement system maybe. There surely is an application for this but it needs to be very well thought.
Hello! have you seen this before?
Warning: Cannot modify header information – headers already sent by (output started at /home/dusting/public_html/wp-content/themes/OnDemand/header.php:12) in /home/dusting/public_html/wp-content/plugins/wp-restful/lib/REST.inc.php on line 669
Warning: Cannot modify header information – headers already sent by (output started at /home/dusting/public_html/wp-content/themes/OnDemand/header.php:12) in /home/dusting/public_html/wp-content/plugins/wp-restful/lib/REST.inc.php on line 671
Not Found
The requested URL /api was not found.
I’m trying to work it out as we speak. Any tips would be really appreciated!
Thanks, Dustin!
Hello Dustin.
Thank you for your feedback.
That problem has also been reported by other user and I’m on the way to fix it. I apologize if it’s taking a bit of time but the work at my company has increased a lot in the past few weeks.
Doing my best.
Sorry for the inconvenience.
No worries.. You can drop me a line on twitter when you’ve got it sorted.. @thorstone137
Thanks!