WordPress has been gradually moving away from being just a blogging for years now. The final nail in the coffin of that outdated perception is the REST API. As WordPress enters the arena of full web application capable frameworks, the REST API is what makes interaction through third parties part of the core system. Available right now in the form of the REST API Plugin, the goal of the project is to enable predictable, resource-oriented URLs, standardized return structures and to use HTTP response codes to indicate API errors. In this article I’ll take a look at the basics of the REST API and how you can use it right now to make your website or web application that much better. The Basics Once you’ve downloaded and activated the plugin your site is ready to go and your API base path will be /wp-json/. This means that to get all your posts from an external application you can make a request to http://yoursite.com/wp-json/something. In most cases the “something” in the URL will start with /wp/v2 which indicates that you are using version 2 of the API The easiest way to try out the new API is to make sure you’re logged in to the website you’ve installed and activated the plugin on and
Share This