I have had the pleasure of working with the WordPress.com REST API over the past few weeks and am very excited to start “dogfooding” this resource everywhere I can.
One cool feature is that all the endpoints are self-documenting. In fact, the documentation for the REST API is built by the API itself! With this information we were able to build a console to help debug and explore the various resources that are now available through the new API. So let me introduce you to the new REST console for WordPress.com.
A word of caution: the console is only available when you are logged into WordPress.com and is hooked up to the live system, so be careful with your POST
requests!
At its simplest you can supply the method, path, query, and body for the resource you wish to examine (it’s pre-populated with /me
). Press “Submit” to see the response status for your request and an expandable JSON object that you can explore. All links
listed under meta
are active, so click one to make another request.
To get a better idea of what kind of parameters a request can take, select it under the “Reference” section. It will then provide an interface with some contextual help to let you know which path, query, and body parameters it accepts, what each of those parameters are for, and a field for you to provide the value.
You can try out the console by visiting https://developer.wordpress.com/console
or by expanding the “Developer Console” pane at the bottom of any of the REST Documentation pages.
So go explore the new REST API and build something awesome!
Nice job! When is this coming to WordPress.org?
If you install Jetpack your WordPress.org blog will soon be available through the same API. Maybe one day something like it can work its way into core.
Reblogged this on http://www.miliapsingkapnapitu.com.