Using the wordpress jetpack json api

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/

Read More

How do i find my $site for example?

Any examples that anyone can share?

Related posts

Leave a Reply

3 comments

  1. 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.

    enable json api for jetpack

  2. 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:

    • Using Jetpack
    • Self-hosted site

    I was receiving the error:

    {“error”:”unauthorized”,”message”:”API calls to this blog have been disabled.”}

    In order to fix it:

    • Disconnect the Jetpack plugin
    • Reconnect again.

    Fixed the issue!