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 withdiscover.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 thegeneral
section of your jetpack plugin settings.This doesn’t directly answer your question but maybe others coming across this post, as I did, would want to know how to possible fix the problem.
In my case I am:
I was receiving the error:
{“error”:”unauthorized”,”message”:”API calls to this blog have been disabled.”}
In order to fix it:
Fixed the issue!