Show Me Your WP REST API v2 Apps
WordPress 4.4 development hit the ground running last week, only a few hours after the launch of 4.3. We’re already close to 100 commits, and digging through the 385 responses on my “what’s on your wishlist” post. One feature that many of you want is the WP REST API (heard of it?). Lots of work has gone into it, and some people are already using a flavor of it in production – two that I know of:
- Wired uses the REST API for communication between some of their internal systems
- the New York Times for our Live Coverage platform (example – Republican Debate: Analysis and Highlights)
Both use version 1.*. I am working on an upgrade path for the NYT to version 2.
The point of this post is to solicit feedback from the general community:
- What have you built using v2 of the REST API?
- Are you running the project in production? If so, please post a link 🙂
- Have you upgraded from v1 to v2? If so, how was it?
- If you believe in the project, would like to see it in core, and haven’t built anything with it: what’s stopping you?
Let’s take the excitement everyone has for the feature and start stress-testing it. Build something. Anything! And then report your findings back here.
Scott Bolinger 5:34 pm on August 25, 2015 Permalink | Log in to Reply
The WP-App Project is using v2. It’s still under development, but making good progress: https://github.com/wp-app/wp-app
I like v2 better than v1, it’s coming along great. One thing that’s still really difficult is authentication from 3rd party clients (like mobile apps). It won’t be possible to build a widely used mobile app until OAuth is in core, with a simple way to create tokens.
prionkor 5:35 pm on August 25, 2015 Permalink | Log in to Reply
I have built an EmberJS app top of WP REST API. Unfortunately it is not live yet 🙂
Scott Taylor 5:38 pm on August 25, 2015 Permalink | Log in to Reply
v1 or v2?
prionkor 5:41 pm on August 25, 2015 Permalink | Log in to Reply
Version 1. Yet to look at V2. Appreciate all of your hard work. Merging into core or not it is already an valuable asset to WP community! 🙂
Scott Taylor 5:42 pm on August 25, 2015 Permalink | Log in to Reply
try out v2 when you can and make note of any pain points
Ahmad Awais 7:28 pm on August 25, 2015 Permalink
I am working on a theme with REST API v2 and having no documentation has been the biggest pain point so far. Reading source is the only work around at the moment.
JS Morisset 5:43 pm on August 25, 2015 Permalink | Log in to Reply
WPSSO has support for REST API v2 — it adds a new ‘head’ field that contains two arrays: the ‘html’ array is a list of all social meta tags created by WPSSO for that post/term/user, and the ‘parts’ array provides the same, but with each meta tag exploded into its parts. See http://wpsso.com/codex/plugins/wpsso/notes/modules/wordpress-rest-api-v2/ for an example post REST API response.
js.
Florian Girardey 5:43 pm on August 25, 2015 Permalink | Log in to Reply
I have built a little Backbone application with the WP REST API v1.
An iOS and Android app is currently in development.
They only use my own custom endpoints, so i’m about to try a v1 to v2 update.
My question is : When the WP REST API will meet the core (maybe in the 4.4?) if my apps are still running on WP REST API v1, did the update will broke my apps ?
Maybe a way to make the feature plugin take over the core in the first place would be great.
Justin Sainton 5:51 pm on August 25, 2015 Permalink | Log in to Reply
We’re working on v2 integration for WP eCommerce – https://github.com/wp-e-commerce/WP-e-Commerce/tree/feature/rest-api. Basically just barely stubbed out right now, but I’m hoping to be able to devote a few weeks to it next month. Should have a lot more to report back at that point.
Adam Silverstein 6:50 pm on August 25, 2015 Permalink | Log in to Reply
I built a very simple demo Backbone app on top of the v1 api, then updated it to use v2.
Main pain points were lack of documentation (at the time) and changes in the api between versions.
https://github.com/adamsilverstein/backbone-demo
Ahmad Awais 7:33 pm on August 25, 2015 Permalink | Log in to Reply
How to enable the demos?
J.D. Grimes 7:04 pm on August 25, 2015 Permalink | Log in to Reply
I played around with v1 a while back, but I have yet to build anything with v2. I’m one of those people in your 4th category: I believe in the project and want to see it in core, but I haven’t built anything with it yet. So I’ll try to explain why. It isn’t because I don’t want to, or that I’m waiting for the API to mature. It is because I don’t have time to build something that people can’t use. If the API was in core, I would be building something with it right now. Yes, literally. I’m building a feature in a plugin right now that could use it, but I’m using wp_ajax_* instead, because that is the API that core offers. From the perspective of a plugin developer wanting to extend the API and add their own endpoints, the REST API is a developer feature. And I’m not going to ask users to install a developer tool just so they can use my completely unrelated plugin—even if that tool is itself a plugin. I really don’t think usage of the API by plugins will ever take off unless it is in core. Not because it isn’t nice to use, but because it currently requires duplication of work, and folks just can’t do that. I think that is the biggest pain-point for a lot of people :).
martijnn94 7:08 pm on August 25, 2015 Permalink | Log in to Reply
Working an a vacancy site at the moment on V2, already so satified compared to projects I made with V1. Especially the easy way to manipulate and add data to the response which wasnt easaly possible in V1.
Had to hack V1 basicly to make it possible to create a multiple tax query with soring on distance based on coordinates. Way easier in V2!
Using Angular for both of the projects!
Mike Nelson 8:20 pm on August 25, 2015 Permalink | Log in to Reply
We extended the REST API to serve Event Espresso data (lots of it in custom tables) using v1. We looked into v2 but figured we’d stick with whatever’s considered “stable”.
We built a few code samples to show how to use our integration. One of them is a calendar that shows Event Espresso events and fetches the data from a separate server. Initially, however, we had cross-site scripting issues because it didn’t want to send an ajax request to a different domain (because the demo calendar was hosted on a separate server than where the Event Espresso data was contained), and so we needed to activate the CORS REST API addon which currently only works with v1 (and it’s not even considered stable for v1).
I would think that it would be a fairly frequent occurence that siteA wants to fetch REST API data from siteB over javascript, no?
So I guess this is mostly a vote for adding CORS support to v2. Maybe just in an addon for now, but I wouldn’t object to it being added to core either.
borekb 9:53 pm on August 25, 2015 Permalink | Log in to Reply
The admin screens of VersionPress 2.0 are being built in JavaScript / React, talking to the backend using WP REST API v2. http://versionpress.net/
Lester Chan 2:07 am on August 26, 2015 Permalink | Log in to Reply
I am using v1, but since v2 is not backward compatible, I will guess I have to wait.
Rouven Hurling 5:48 am on August 26, 2015 Permalink | Log in to Reply
I’m using v1 in a custom backend.
I did a trial update to v2 just before the last beta got out (which broke some of my changes).
For me the update was pretty easy, once I figured out which functions I needed to use, which took a while and some questions in the slack channel, because some of them weren’t in the docs (new register_post_type args for example).
brad989 5:53 am on August 26, 2015 Permalink | Log in to Reply
I’m using v2 in an AngularJS powered theme. http://demo.redeyetheme.com
kokarn 9:24 am on August 26, 2015 Permalink | Log in to Reply
IKEA Sweden’s restaurant pages is built with V1.
http://www.ikea.com/ms/sv_SE/restaurang/index.html
Helen Hou-Sandi 3:07 pm on August 26, 2015 Permalink | Log in to Reply
Cool!
NateWr 3:00 pm on August 26, 2015 Permalink | Log in to Reply
Not quite production, but getting close to release. Gonna go with the beta and hope for the best. Did not transition from v1 to v2. Outline of a couple projects I’m using it on here:
https://make.wordpress.org/core/2015/07/23/rest-api-whos-using-this-thing/#comment-26367
I’d also like to make use of it in some of my free plugin development. But obviously can’t touch it until it’s in core. Not going to bundle it. Seems like a maintenance nightmare.
Matthew Haines-Young 3:01 pm on August 26, 2015 Permalink | Log in to Reply
We’ve just launced a new website for the digital product studio Ustwo ustwo.com. Built on V2.
The front facing site is built in React and runs on a Node server totally separate from the WP install used to manage all the content.
As well as using the standard endpoints, we have written quite a few custom ones too, and V2 of the API made this really easy to do.
Jake Spurlock 4:30 pm on August 26, 2015 Permalink | Log in to Reply
In addition the data sync we built, we also use the JSON API for the WIRED liveblog, using React for rendering. Example here: http://www.wired.com/2015/06/apple-wwdc-liveblog/
Tanner Moushey 5:58 pm on August 26, 2015 Permalink | Log in to Reply
I’m using V2 for the StudyChurch study builder along with Backbone js. You can see it in action here
Dave Navarro, Jr. 5:58 pm on August 26, 2015 Permalink | Log in to Reply
I am using v1 to share posts between multiple web sites. I’ve been porting it to v2, but it’s been difficult as there are significant differences.
I’ve also not been able to get v2 to let me access user data, which is causing delays on a project for syncing users between multiple sites.
Mustafa Uysal 11:42 am on August 28, 2015 Permalink | Log in to Reply
We are using v1 on the nefisyemektarifleri. Here is the video https://www.youtube.com/watch?v=kuErLgmJEbs
Huseyin Berberoglu 2:47 pm on August 28, 2015 Permalink | Log in to Reply
As Mustafa said; we are using v1 on the nefisyemektarifleri.com to communicate with our native applications. We have a lot of custom services.
Our application downloaded more than 1 million and selected for interview by Google. The interview published yesterday on Google Developers YouTube channel. Here is the video https://www.youtube.com/watch?v=kuErLgmJEbs
See our application in action (only Turkish recipes); Android: https://play.google.com/store/apps/details?id=com.nefisyemektarifleri.android iOS: https://itunes.apple.com/us/app/nefis-yemek-tarifleri/id947863045
(same video link with more explanation)
Huseyin Berberoglu 2:50 pm on August 28, 2015 Permalink | Log in to Reply
As Mustafa said; we are using v1 on the nefisyemektarifleri.com to communicate with our native applications. We have a lot of custom services.
Our application downloaded more than 1 million and selected for interview by Google. The interview published yesterday on Google Developers YouTube channel. Here is the video https://www.youtube.com/watch?v=kuErLgmJEbs
See our application in action (only Turkish recipes); Android: https://play.google.com/store/apps/details?id=com.nefisyemektarifleri.android iOS: https://itunes.apple.com/us/app/nefis-yemek-tarifleri/id947863045
(same video link with more explanation)