Using wordpress jetpack json api

I installed the jetpack plugin for my own wordpress site. The JSON API function in jetpack allows me to use the rest of the APIs ( http://developer.wordpress.com/docs/api/ ). However, I do not understand how to use it.

https://public-api.wordpress.com/rest/v1/sites/ $ site / posts /

How can I find my site, for example?

Any examples anyone can share?

+6
source share
3 answers
+11
source

You can replace $site with a domain and (if necessary) the path to your self-styled Wordpress site where Jetpack is 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 receive an error message: {"error":"unauthorized","message":"API calls to this blog have been disabled."} With your own site, make sure you enable json api in the general section of the Jetpack plugin settings .

enable json api for jetpack

+2
source

This does not give a direct answer to your question, but maybe others who come across this message, like me, would like to know how to fix the problem.

In my case, I:

  • Using Jetpack
  • Stand alone site

I was getting the error:

{"error": "unauthorized", "message": "API calls to this blog are disabled." }

To fix this:

  • Disable Jetpack Plugin
  • Reconnect.

Bug fixed!

0
source

Source: https://habr.com/ru/post/946850/


All Articles