• Hi there,

    We’ve created a plugin that adds API endpoints to the official JSON API that’s included in WordPress, accessible with the /wp-json/ URL.

    However, we’ve got a user’s website that doesn’t seem to have this URL available. It throws back a 404. And because of that, our plugin is useless as we can’t access the endpoints. Even though the website is using 4.7.1. I believe the API should be enabled by default, right ?

    I’m not sure what I can do to debug that issue, as I don’t have direct access to the site. The use disabled all plugins except for mine, still no API endpoint accessible. Could the source of the issue be in the template ?

    Also, can I add some code in my plugin to check if the JSON API is working/enabled properly ?

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • I think, but I could be wrong, that you’ve swapped the JetPack API endpoint in for the core WP-API endpoint. I believe that for WordPress proper the endpoint should be /wp/v2/ The JetPack plugin also contains a JSON API module, which I’m guessing is what uses the /wp-json/ endpoint. So it may be that you are getting the 404 error because you’re using the JetPack API endpoint without the JetPack plugin being installed or the JetPack API module being activated.

    Hope that helps!

    I sit corrected after looking back at the documentation in more detail: the full endpoints for core are /wp-json/wp/v2/ and custom endpoints do use /wp-json/ So I’ve got nothing. Sorry.

    Except this: https://blog.sucuri.net/2017/02/content-injection-vulnerability-wordpress-rest-api.html

    I know the site you are trying to debug is using 4.7.1, so it wouldn’t have been impacted by whatever changes were made to the API in 4.7.2 to address this issue, but could they be using a WAF or security plugin that turned off some/all of the API functionality to block this issue? Don’t know how you check for that without direct access to the site.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘JSON API disabled ?’ is closed to new replies.