Why can't I just use WordPress REST API? Rooftop vs. WP-API

Rooftop uses the WordPress REST API - so what makes it a better choice then just a WordPress installation?

There are quite a few things you need to do to make the WordPress REST API flexible and useful for third-party websites and apps. We've answered the common issues in Rooftop with a set of plugins, which are open-source and free for you to use.

All of these plugins - and more - are included in the hosted Rooftop plans, and tailored for fast, secure access to your content.

Token authentication

Out of the box, WordPress REST API uses either OAuth or basic auth. OAuth isn't a very good fit for projects which only have a small number of consumers (and it's a faff to set up). Basic auth isn't secure by default, and assigns the rights of the authenticating user.

We've written a plugin to give you token-based authentication for your client applications. You can manage tokens in your Rooftop account, and decide whether the user should be a read-only or read-write user.

Preview header access

Your content editors need to be able to preview content which they're creating in Rooftop, before it's published. We've written a plugin which allows you to pass a 'preview' header with your API request to see content which is in draft mode. That means you can show your content editors a preview in context, exactly as you would if you were using WordPress to develop a website locally.

Adding useful metadata to REST responses

If you're relying completely on the API to drive your website or app, you need a few more pieces of metadata to move through the data. We've added ancestors and children to the _links key

Access to menu data

By default, the WordPress REST API doesn't give access to menus. That'll probably change, but for now we've contributed to the wp-api-menus plugin to make it work with the WP API v2.

Events

One common use-case for WordPress is to show data about events. You might just need a list of 'things happening', or something much more complicated with ticket sales. WordPress has some great events plugins already, but none of them take an API-first approach to the data.

We're developing a plugin to store, manage, and expose event data in a sensible, extensible way in the API.

Content clean-up

WordPress makes assumptions about the URL structure of your website, and takes advantage of that then placing links in content. That's fine if your site is running WordPress, but it's no good if you're consuming your content from an API.

We've developed a plugin to parse and clean up these URLs, into a URL-agnostic link format which you can consume however you want. Maybe that's in a website, or perhaps in a custom URI scheme for a mobile application. Anything's possible.

Exposing data from popular third-party plugins

WordPress has a rich ecosystem of plugins. Two of our favourites are Advanced Custom Fields (ACF) and GravityForms. They add a lot of value and flexibility for content editors, so they're included in Rooftop.

But neither plugin makes use of the WP API standard, so we've developed plugins to expose the data in a structured way. In the case of ACF, the content is delivered alongside the base WordPress content fields, so there's no extra work to consume it.

In the case of GravityForms, we've developed a plugin to expose the form options for you to consume in your application or website. In the near future, we'll include the ability to post data back into Rooftop so the GravityForms loop is closed.

(As an aside, there is a GravityForms API. But it's not easy to integrate with the rest of the WordPress REST API so we started again).

Client libraries in popular languages

We're committed to building client libraries for the Rooftop API. The first Ruby and Ruby on Rails libraries: in the near future we'll be targeting Node/JS, Swift, Microsoft .NET, PHP, Python and others.

It's all open-source. Don't reinvent the wheel!

Our core application, plugins and libraries are open-source and hosted on GitHub. Don't reinvent the wheel by starting from scratch with the WP API - you're welcome to use the Rooftop libraries, and we look forward to your contribution.