WordPress JSON REST API Version 1.1 Released with New Authentication Documentation

Over the weekend, Ryan McCue and collaborators released version 1.1 of the JSON REST API plugin. The WP API team is aiming to have it ready for inclusion in WordPress 4.1, which will drop later this year.

This release focused heavily on testing, fixing bugs discovered through tests, and improving the API documentation. New routes have been added for taxonomies and terms. Excerpts and password-protected post handling have also been improved. Revision endpoint tests are new in 1.1. Coverage for post endpoint testing is now at more than 54% for the whole class and more than 80% for the main methods. McCue says this figure will continue to rise over the next few releases. You can view all the changes and bug fixes for this release on GitHub.

The WP API team often receives questions regarding how to handle authentication. Version 1.1 includes full documentation on authentication methods, including cookie authentication (for plugins/themes running on a site) and OAuth (for desktop/web/mobile clients accessing a site externally). A basic authentication method is also included in the docs and is useful for development purposes only.

I’ve been working with the WP API team to help get documentation organized and presented in a way that’s easy to read and navigate. We’re in the process of merging all the docs into one centralized hub at wp-api.org, which pulls from the various docs in the WP API GitHub repos. We’re working to make this a top-notch resource for any developer who wants to build with the new API.

WordPress API Documentation

Work for version 1.2 is already underway. “With version 1.2 and onwards, we’ll be tackling a bunch of extra testing for our endpoints, with the aim of eventually reaching >90% coverage,” McCue noted in the release announcement. If you’d like to join in collaboration on GitHub, the team is always looking for help.

Are any of our readers already building something with the new JSON REST API? Let us know in the comments. Is there anything specific that you’d like to see added to the documentation?

7 Comments


  1. Good job, congratulations. This API will be one of the main reasons to use WordPress 4.

    Report


    1. Very cool! Is it ready for people to use now? Do you accept contributions? Did you build it for a certain project or just for fun?

      Report


  2. Great article – I was looking for a way to create and modify posts via REST and found your article about the plugin while searching around.

    Unfortunately, when I installed and attempted to activate the plugin, my entire site went down. Any browser I point at http://dazzagreenwood.com/ draws the following error: “Call to undefined function current_action()”. Any thoughts on how best to fit it back up would be much appreciated.

    Thanks!

    Report


    1. Update: Accessed the plugin directory directly on the server and just moved the entire json-rest-api plugin to a safe place… site is working now.

      Report


      1. Dazza, did you ever find out what was causing this? I’m running into the same problem. One thing I’m wondering about is whether the call to current_action() needs to be given context in some way – most of the times I see it referenced is in the format of “$wp_list_table->current_action();” rather than simply “current_action();”

        Report

Comments are closed.