REST API

REST API
An answer from the REST API. It’s a Json object, that was send to a Linux terminal via curl ( it’s a tool to transfer data from or to a server).

“WordPress 4.7 comes with REST API endpoints for posts, comments, terms, users, meta, and settings.” (Source: WordPress’ text about the API).

One of the great news in WordPress 4.7 is the REST API. Now it is possible to exchange data in the form of Json Objects.

Let’s try out the REST API in a simple terminal. In bash try this:

curl http://research-wordpress.dk/wp-json/wp/v2/categories

Perhaps the result above seems like gibberish to the uninitiated. But if we use a Json parser online, you’ll get a human readable result.

The Json object unfolded. You can see one category.
The Json object unfolded. You can see one category.

If you’re eyes are in top condition, you can see:

  • name: “Book Review”
  • description: “As a researcher I read a lot of books … etc.”

So a standard WordPress installation is able to exchange data between a behemoth of platforms, such as apps on mobile devices, and any kind of code that’s able to process Json, such as:

  • Ajax
  • Python
  • Bash
  • PHP
  • Ruby
  • Nodejs
  • etc.

The possibilities are virtually endless. REST API marks a huge step foreward.

Read more: REST API Reference.

Statistics

  • WordPress 102
  • CMS 100 (should include all, in theory but does not)
  • Joomla 11
  • Drupal 8
  • Magento 11

Occurence of the word x in reports at Office365 @BAAA (visited: Oct. 10th 2016)

Take these numbers with a grain of salt. As far as I can see the system counts the occurrence of the word – not the number of reports. A dedicated fan might write WordPress many, many times …