As of Jetpack 1.9, the WordPress.com REST API can now access self-hosted WordPress blogs with the Jetpack plugin installed.
Instead of just building for the WordPress.com platform, you can build awesome applications that interact with WordPress in general. Any applications built using the API for WordPress.com will automatically work with Jetpack-enabled sites running Jetpack 1.9 or higher.
Check out our documentation, create an app, and get started today!
Reblogged this on Hew.vc and commented:
Super exciting. The scale you can reach here as a developer is mind-boggling.
Reblogged this on Jeremy Herve.
More than a little confused how this works with a self hosted site.
- Is everything still going through the wordpress.com public API – which then access our self hosted site (via Jetpack link)?
- Is user authentication, authenticating against accounts that have been created on our own site, or is it just authenticating users who have wordpress.com accounts?
- Any plans to release a rest api for wordpress.org self hosted sites that allows them to operate independently of wordpress.com?
The public JSON API is not working at all for my self-hosted site with JetPack installed and connected. Is there a tutorial that explains this? Also, the sites not hosted at the domain root. its in a subdirectory: site.com/folder/wordpress
Can you try URLencoding the site url? Since there are slashes in it it needs to be encoded.
Site should contain the subdirectory but you will need to urlencode $site
That worked!! Thank you so much. Dumb that I did not think of that.
I have another question. Can I make the API calls secure? I mean the api should only return results if the user is authorised to access the blog. I am using Jetpack to enable JSON and can not find a way to limit access to my posts.
Is it a public blog?
For some reason, the reply shows at the wrong place, please delete one of the replies at your will…
Yes, it is a self-hosted public blog (user can not join, but posts are public). I am concerned that REST API will make it super easy to pick up the content. I only serve excerpts in the RSS feed. However, the REST API always provides full content by default.
We currently don’t offer an option to disable public API calls (our view is that since the content is already public, it’s ok to offer it in another format) – if it’s a private blog we usually detect it and automatically disable the feature.
I can mark your suggestion for having an option, though.
I think, it will be a lot better if JSON API works like XML RPC. You should have an option to ask for user credentials before reading the full content of the posts. This way we can create a user with (minimum) read access and use it to call the API. Or else the API should return only the excerpt (or whatever is set for the RSS Feed).
I hope to see this option in Jetpack some day.