I've installed the jetpack plugin for my self-hosted wordpress site. The JSON API feature in jetpack allows me to use the rest API (http://developer.wordpress.com/docs/api/). However i don't understand how to use it.
https://public-api.wordpress.com/rest/v1/sites/$site/posts/
How do i find my $site for example?
Any examples that anyone can share?
Just replace $site
with the URL of your site.
https://public-api.wordpress.com/rest/v1/sites/www.yoursite.com/posts/
You can replace $site
with the domain and (if needed) path of your selfhosted Wordpress site that has jetpack installed.
Just try this example where $site
was replaced with discover.wordpress.com
https://public-api.wordpress.com/rest/v1.1/sites/discover.wordpress.com/posts/
If you get the error: {"error":"unauthorized","message":"API calls to this blog have been disabled."}
with your own site make sure that you enabled the json api in the general
section of your jetpack plugin settings.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With