Not another what now? If you are someone who is plugged in to the world of WordPress and is paying attention to what is going on, as I am, then you will most definitely have been hearing about the WordPress REST API. A lot. And, perhaps getting quite excited about it, like I am.
But, I’ve got a feeling that most of you out there have not heard of it. And probably the phrase “REST API” means nothing to you either.
There are LOADS of blog posts all over the internet about this, but I haven’t come across any that would tell non-techy folk why they should think this is cool. And they should!
So what’s it all about?
First off, API stands for Application Programming Interface. What it means, is that if there is an application or website that does stuff, you can do some of that stuff from outside that application or website.
Confused? Don’t worry, the good news is that you have probably used APIs already. So you will definitely be able to understand it.
A very commonly used API…
Potentially the most common you might have used is the Facebook API. Facebook, as a website, does stuff. You can use it to share statuses and images, send messages, interact with people on pages, events and groups.
You might also use the Facebook app on your smartphone or tablet. This looks like Facebook, and works like Facebook, but it lives on your phone. When you post something to Facebook, the app needs to send that off to the Facebook server, and it does this via an API.
Similarly in order for an app to show you the latest posts on your news feed, it needs to go and get them, via an API.
You will probably also have experienced using the API through a 3rd party (i.e. not Facebook).
Ever used an app or website that asks you to login via Facebook? Then you’re then presented with a screen that says they want access to X, Y and Z from your account? And then you can do things like see your most posted words, or post a status update via that website? The Facebook API enables all of these things.
People are able to offer these types of services with Facebook because they make large parts of their APIs available to 3rd party companies and developers.
OK, that’s the API bit, what is the REST bit?
As I mentioned at the start of this post, we’re talking here about the WordPress REST API. We’ve talked about what an API is already. In this post I’m not going to go into detail about what the “REST” part is.
Just understand that the “REST” part is referring to the technical structure of the API. It’s something that makes working with a complicated thing very much more simple.
Additionally “REST” is completely generic. This means that it doesn’t matter what the REST API is accessing – a WordPress site, Facebook, whatever – anything else can access it – a website, a mobile app, whatever.
And what has all this got to do with WordPress?
Now that we have access to the WordPress REST API, it starts to open up a lot of opportunities, here’s a few:
- We can allow 3rd parties to offer apps and features that link with our websites.
- It becomes easier to create mobile apps that link to our websites and even allow users to log in to their accounts.
- It opens the possibility of creating standalone templates and themes that are detached from the WordPress core.
- You could use WordPress as an application platform for a mobile app. i.e. just as the engine, it doesn’t even need to have a website attached to it that’s accessible via a browser!
- Create a completely standalone, redesigned WordPress admin system, like WordPress’ own Calypso admin system
Do I need to know about this if I’m not a coder?
I believe that understanding the technology that is available and what it can be used for is very powerful, whether you’re a coder or website builder or not. I’m hoping that by reading this article you’re starting to get little thoughts popping up in your head.
“I wonder if this would work for that idea I’ve got.”
“I bet my customers / website visitors would benefit from being able to do X.”
WordPress is a great platform, clearly I’m a big fan. It’s ease of use has allowed millions of people to build websites and blogs and reach audiences all over the world. It’s flexibility has allowed developers to tailor websites to client’s specific needs.
The addition of new features like the REST API takes all of those benefits and puts WordPress on a new level opening up all sorts of new possibilities.
Where to go from here
I’m warning you, this stuff is a can of worms and is highly addictive! Depending on who you are, you might want to consider the following:
Business Owners / Website Owners / Entrepreneurial Types
- Got questions? Stick them in the comments form below and I’ll get back to you. Share the knowledge!
- Got a website, web app or app idea that you think could use the WordPress REST API? Why not get in touch for a chat about it?
- Slightly more in depth, slightly outdated, but still a good read on WPMU’s blog on The Rest API (and how it could change the world forever)
Developers and Coders
- The official REST API Handbook on WordPress.org
- The REST API OAuth1 .0a Server Pluign – required for using the Oauth authentication method until it becomes part of WordPress Core
- A detailed overview of the OAuth flow for WordPress from the Envato blog. In fact, it’s the bible on the topic as far as I’m concerned.