Podcast Episode

248 – An Overview of the WordPress REST API

Announcements

Is there a plugin for that?

With more than 50,000 plugins in the WordPress repository, it’s hard to find the perfect one. Each week, I will highlight an interesting plugin form the repository.

For more great plugins, download my 50 Most Useful Plugins eBook.

Google Maps Easy is the easiest way to create Google Map with markers, locations and clusterization. Any data on the map: text, images, videos. Custom map marker icons

An Overview of the WordPress REST API

What Is an API?
API is short for Application Program Interface. In layman’s terms, it’s the agreed set of standardized ways that a particular piece of software can be used; the rules defined for its interaction with the wider world, which govern how other pieces of software can talk to a program and how it will respond.

What is a REST API?
A REST API, in turn, is a particular architectural approach to putting together these rules. REST stands for Representational State Transfer. It’s a methodology designed to let programs talk to each other in as simple a way as possible.

It’s an inherently flexible format, but implementations are expected to share certain core characteristics.

Why Does the REST API Matter?

  1. You will be able to use WordPress data with other coding languages outside of PHP
  2. You will be able to create custom mobile applications pulling data from your WordPress site
  3. The WordPress Frontend will be optional
  4. The backend can be completely redesigned. Much like WordPress.com’s new interface
  5. More Javascript integration.

Call To Action

Sign up for next webinar

Full Transcript

Business Transcription is provided by GMR Transcription.

On today's episode we're gonna do a brief overview on the WordPress REST API and what it is and how it works right here on Your Website Engineer podcast episode number 248.

Hello everybody, welcome back to another episode of your Website Engineer podcast. My name is Dustin and today we're going to dive in and I'm gonna try to briefly describe what the WordPress REST API is, how it works and how it's going to kind of revolutionize the way that we use WordPress. And I am honest with you right here upfront that I don't know a lot about the REST API but I do know some overarching things that help me to at least kind of elaborate and share on where the future of WordPress is happening. So we'll talk about that in a little bit.

There seems to be a lot of things in the news this week so there's a lot of things to cover, but the first thing is we'll let you know about the WordPress webinar that's happening this Friday, September 4 at noon Eastern daylight savings time. And you can register over at YourWebsiteEngineer.com/webinar. And we're gonna be talking about HTML and CSS, just the basics, how it works. How does code actually work?

Have you ever tried to change colors from some of your text in your WordPress dashboard and just found it extremely frustrating? Or have you ever tried to make the fonts bigger or smaller or any of those small little tweaky things? Have you ever tried to get the spacing just right on a text widget? That's what we're gonna cover. We're gonna talk about all of these things. It's completely free to sign up for the webinar. It's completely free to add some of these things to your WordPress site. And then I promise you you'll learn something about how to make sure that you can properly format your post, your pages, all of that content and make your website look exactly the way that you want it to.

I wish there were something like this when I got started. And since there wasn't I'm gonna go ahead and create it because I spent years and years and years just trying to figure out how HTML worked and how to make it work with the correct tags and things along those lines. So that is the first announcement this week.

The next thing I wanna let you know about is about the WordPress survey. There is a survey that is happening this year. It happens every single year and it normally is a survey that the results are shared at Word Camp, San Francisco. Well, this year it's Word Camp U.S. that is happening in December but basically it is a five- to eight-minute survey. And it just basically gives them some ideas of who's using WordPress, what they're using it for, what type of hourly rate you're using if you're consulting. It's kind of a neat little survey. It's interesting to hear those results year after year.

The survey shouldn't take you any more than five to eight minutes. There's a link in the show notes for it. I won't say the URL because it's kind of a pain, but you can go ahead and register – not register but fill out the survey over there. It's at wp-survey.poll [inaudible][00:02:24].com. And then there's some more stuff after that. So, just head over to the show notes for episode number 248 and you can take that survey.

Another thing in regards to WordPress 4.4 and its upcoming release, the new default theme 2016 is now available. You can find out more about that. There's a link to the show notes for that episode – or for that theme as well. And the cool part is it's already out there on Get Hub, so if you wanted to go ahead and try it you could download it from Get Hub and then upload it as a theme to your WordPress library or to your WordPress themes area. And you can go ahead and get started in using that.

Now that will be the default theme that comes out in WordPress 4.4 and this is the fifth – the default theme that has happened. You know it used to be way back in the day you used to get Kubrick was the theme that you got when you installed WordPress. And then it went 2010, 2011, 2012, 2013 and 2014, 2015 and now we've got 2016 which will be coming out. It's kinda like a car. They come out the year before the year actually happens. So that's something else that's happening in the news.

Another thing, and I just feel like there's news and news and news, there is a new action bar. And the action bar is something that was talked about. It's a new feature to WordPress.com. It's basically a little bar in the bottom right-hand corner if you are logged into WordPress.com.

It now says follow so if you wanted to simply follow a site and then follow along and get all the site's updates via the WordPress.com reader you can do that. But there's also these three little buttons, three little dots to the right of the follow button and you can find out more about what theme that particular WordPress.com site is using. You can get a short link for that poster page so you can do some cool things with sharing there. And then you can manage your sites, you can collapse the bar, you can do all kinds of cool little things. And it's all WordPress.com related stuff. So if you have a WordPress.com site go ahead and check that out. And if you don't, it's just not a feature that you'll be using in the near future, that is for sure.

Another thing, and the last piece of news that I wanna share with you today is, there's an article that was posted out there on elegant themes. And this was posted last week or two weeks ago and it just talks about the history of Automatic's acquisitions. And it's kind of a neat little short – I was gonna say short but it's kind of a lengthy article that talks about all the different companies that Automatic has purchased over the last ten years or so.

And so the – I'm not gonna go through here all of them but they do start out with Gravitar that was purchased in 2007. And then it goes all the way to Woo Commerce which was bought right now in 2015. So there's, I don't know, a dozen or more companies that have been acquired. And then those products have either been – Automatic has purchased them to shut them down because they competed with Automatic or they've been rolled in and added as new features. So I think that’s kinda cool.

It was interesting to me as I was reading it, like some of my co-workers at Automatic, actually their companies were bought and then they were acquired by Automatic to continue to develop whatever that product or theme was, so that was pretty cool. Stuff like Vault Press used to be called [inaudible][00:05:25] Garage and that was purchased and then rolled into Vault Press which was kinda cool. So that is just another article. You can find that in the show notes for episode number 248 as well.

Now moving on to the is there a plug-in for that section? There is a plug-in that I wanna share today and it's called Google Maps Easy. This is the easiest way to create a Google Maps with markers, locations and clusterizations. I didn't even know that was a word but you can add any type of data, text images and videos and you can do custom map icons which is pretty cool.

There's a really – I mean, if you go and look at this plug-in in the WordPress repository you can see it and the screenshots look pretty amazing of what you can do with this plug-in. You can create these Google Maps and then you can create your own custom image markers. So if you wanted to say like I'm going on a cruise and you show a picture of the Caribbean, you can say the cruise stops here, here, here and here. And then you can have pictures with each of those markers which is pretty cool.

If you have rental properties and you wanna have little icons show up where these rental properties are, kind of like an Air B & B website, you could do all of that. It's really cool. And so if you have a need to put some sort of markers and maybe you have multiple locations that are within a close proximity or you wanted to just kinda highlight different areas on a map, this would be the perfect plug-in for you. Again, it's called Google Maps Easy and you can find that in the WordPress repository. There's a link to it in the show notes.

And also on the WordPress repository, if you're there, there's kind of a short little mini red banner that goes across the top that says, have you take the WordPress 2015 survey yet? So that survey that I talked about in the news section, that you can get to immediately and instantly right from the WordPress repository, which is really nice. And it kind of is that first and foremost. When you get there you see this red text at the top, you know, oh, I should probably fill out that survey so we can get some really great information. We can learn about the different things that are going on in the WordPress space, which is really, really cool.

All right. Today we are going to move in and talk about the WordPress REST API. Sometimes it's referred to as the Jayson REST API. And I'm gonna be partially reading by getting a lot of information form a blog article over at WPMUDev.org mainly because of the fact that I don't know a lot about the WordPress REST API. But I just wanna give you some overarching ideas and just – it's going to be coming very, very soon. It's going to be built into WordPress but we'll get to that in just a second.

So, let's see, let's dive in and just kind of – let's break down some of these terms so you can understand what these different things are. So what does API stand for? An API is – it stands for an application program interface. Basically it is the agreed on set of standardized ways that a particular piece of software can be used. The rules defined for its interaction with the wider world which govern how other pieces of software in the program can talk to it and how it will respond.

And so there's a lot of times with a WordPress plug-in they'll ask for an API key and those are – that's just a way. It's a way for one service to talk to another service. And so within – built into – I'm thinking off the top of my head like MailChip has an API. And you ask for an API key to link your MailChip plug-in to your MailChip account.

And then through MailChip's own API, their own application program interface, they can communicate and send data back and forth between WordPress and between MailChip. And so that's what API stands for.

Now, what is a REST API? A REST API is a particular artectual approach to putting together these rules. And so like all the rules that API has to follow, then these rules are put together in the REST API. And REST stands for representational state transfer. It's a methodology designed to let programs talk to each other in as simple a way as possible.

And so it's a very flexible format and it gives you the ability for data to transfer from place to place without actually having to use an interface. You know, the WordPress dashboard is a great use of an interface. You go in, you make changes with your WordPress dashboard and then those things are saved right to WordPress. Well, within an API you can make changes, you can save them within your WordPress dashboard and then you can push data to another place or different things.

So that's kind of an overarching kind of at a high level what these API things are, what is an API. And so basically it's a way to send data from one place to another. And it can include like the user data, taxonomies, all kinds of stuff. Anything that's within your WordPress dashboard, all your data, has this ability to be transferred to different places or used in different ways in different places.

Now the thing is that the WordPress doesn't have this built in décor right now. It is built into some of the WordPress.com's functionality and some of WordPress.com's features. And so you can see if you use WordPress.com and go to WordPress.com/post and add a new post, you can see that the posting experience is much different than the WordPress WP-admin dashboard. And this is because that WordPress.com is actually using the API to create a new user interface on top of the current WP admin user interface. And so that's one simple way that it can be used.

Okay. So you may be thinking, okay Dustin, why are we saying this? Why are we talking about this? Why is there so much hype about the REST API? You know, there's a lot of power in what this can do and how it can change the WordPress ecosphere. So let's talk about that for just a little bit. And I know this is kind of high level and, again, I don't understand it all and I'm always trying to dig in and learn more about this. But just remember that the API, the REST API is a way for data to move from WordPress to another platform back and forth and be able to communicate and send data from one place to another. So that's kind of an overarching nutshell of what the – how the REST API works and what it is.

But let's talk about a few applications, a few different ways that this can be important for all of us who are using WordPress. So the first way is it allows us to cut the cord with PHP. Even though PHP is very powerful and it gives the ability to pull all our information from our database within WordPress, it powers more than 80 percent of modern websites because it's dynamic. It allows us to generate pages based on different feeds and different – you know, like that's the way that WordPress works. It is all pulled out of the database using PHP.

With an API – with this REST API we're able to pull this information from WordPress and use it with different platforms. So you could actually take a WordPress plug-in and through the API you can actually run it on rubion rails or you could use some other type of platform that's out there, some other type of code type language, which is pretty cool. You know, even No.JS or some of the other newer technologies that're out there. We can start using the data that's already in our WordPress site to create some really amazing things.

And so it basically gives you the richness of the WordPress ecosystem and how successful it is with all of these millions and millions of downloads for plug-ins and themes and stuff like that. And the ways that they've been monetized, you know, some people have a – like Backup Buddy is, for example, a premium plug-in based on WordPress. But with an API they could start doing backups for different types of websites, even just static websites. It will take some code rewrites but it gives the power for those types of plug-ins to be moved to different platforms, which is pretty cool.

The other thing that you can do, another thing is that now we'll give true mobile integration. So WordPress has – arguably they've done a better job than most mainstream content management systems in the fact that they do a lot of things that work well and look good on mobile. But true integration with regards to IOS and Android outside the browser have remained – it's a really high elusive goal.

And so the – one of the cool things is using the REST API the folks over at App Presser have been able to pull in data from your website to build a – allow you to build an app that you can put on the Android store or the IOS store. And you can put this information – like it's pulling the information from your website so you only have one website, but then it's pulling this information into the app using the API and then displaying that out in the app which is really cool. So that's another neat thing. I'm sure we'll see lots more plug-ins and different things coming along the way that will allow us to take our WordPress site and natively make it into an IOS or Android app.

The other thing that is really cool is that you will be able to be – the frontend will be completely optional. And so you won't necessarily need a frontend anymore, if you will. So the WordPress frontend is merely another external application hitting all of its endpoints. And so what this allows to do is to create a custom WP-admin if you want. And so this is kind of a neat thing as well.

So if you wanted to create a custom interface that looks different than WordPress normally does, if you wanted to show this to your clients and tell – Rainmaker I think does a good job with this. Like they're – they have an overlay on top of WordPress right now that allows it to be their own platform. And it gives them special areas to upload their own content and kind of manage your sites in different ways. But it's still running on WordPress itself. And so that's something to think about as well. So that's another use case for the WordPress API.

The backend is being – that's the same thing so I guess the frontend and the backend are able to be reimagined. You can really create exactly what you want it to be. And then the last piece is that you can get onboard with the Java script bandwagon. So Java script is kind of taking over the world. There's a lot of Java script that's being used everywhere. And so – which is really cool, so the REST API makes WordPress a potential partner with technologies rather than a competitor.

And so instead of using – being an either/or now it's like an end solution, that WordPress will not start working better with using Java script and Java script can be – you can use that a lot more efficiently. So those are some of the ideas and just a few of the ways that the REST API will take course over the next few months. I think that it's slated to go into the WordPress 4.4 release that's coming out in December but right now there's a WordPress plug-in that you can use if you wanted to start experimenting with the API. It's called WP REST API and you can download that and start using that. But, you know, in the near future it's going to be rolled into core so that means there won't be anything to turn on. You just go ahead and start using it on your website.

So I think that's kind of neat. I think that's where we'll leave with the high level overview. Sorry if it got a little bit on the confusing side but just know the REST API that's coming is going to be very powerful. It's going to allow us to use the power of WordPress in many, many different ways. And I expect to see lots and lots of different products out there to help us make the most use of this. And it will start being able to – WordPress will be able to connect to different services and just say it's going to be a game-changer when it comes.

And so I would say looking out in the future, 2016, there's going to be a lot of different platforms and a lot of different things that are focused on WordPress and allow us to connect with them through the WordPress API.

All right. That's going to wrap up this episode. Thanks so much for tuning in and getting confused just along as I did as we went through this episode. I know it's not a simple subject but I think it's important to just know it's on the horizon and it's coming. Also don't forget about the WordPress webinar that's happening in just a couple days. You can register over at YourWebsiteEngineer.com/webinar. And I think that's it. Next week I'm on vacation but I've got an episode already for you and so you'll hear that next week. And until then, we'll talk again soon. Take care. Bye-bye.

Leave a Reply