Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wordpress JsonAPI - /wp-json/ was not found on this server

I am using the following plugin Json Rest API.

To test the plugin the documentation states that I should just use:

$ curl -i http://testpress-maxximus.rhcloud.com/wp-json/ HTTP/1.1 404 Not Found Date: Sat, 24 May 2014 07:01:21 GMT Server: Apache/2.2.15 (Red Hat) Content-Length: 303 Content-Type: text/html; charset=iso-8859-1  <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>404 Not Found</title> </head><body> <h1>Not Found</h1> <p>The requested URL /wp-json/ was not found on this server.</p> <hr> <address>Apache/2.2.15 (Red Hat) Server at testpress-maxximus.rhcloud.com Port 8 0</address> </body></html> 

As you can see nothing is found by the URL. Any recommendations if there is a problem with the API or wordpress?

I appreciate your reply

like image 481
Carol.Kar Avatar asked May 24 '14 07:05

Carol.Kar


People also ask

Where do I find my WordPress JSON file?

Accessing all of your site data via the REST API is as simple as composing a URL. For any WordPress site running at least version 4.7, add the following string to the end of your site's url: /wp-json/wp/v2 (e.g., http://example.com/wp-json/wp/v2 ). Put that URL in your browser, and see what comes up.

What is WP JSON in WordPress?

What Is The WordPress JSON REST API (WP API) & How Does It Work? JSON, which stands for JavaScript Object Notation, is a lightweight data-interchange format based on a subset of the JavaScript code language. It's easy for humans to read and write and easy for machines to parse and generate.

How do I enable REST API in WordPress?

Download the WordPress REST API Basic Auth plugin. Log in to your WordPress Dashboard and go to Plugins -> Add New. Click on the Upload Plugin button and select the plugin's zip file. Go to the Installed Plugins menu and activate the plugin from there.

How do I know if WordPress REST API is enabled?

Is the WordPress REST API enabled? The best way to check is to visit this URL: https://yoursite.com/wp-json. If you see some information which seems related to your WordPress REST API, it works. If you see something, it means that, at least, your WordPress REST API is enabled.


2 Answers

The current version of REST api for sites with pretty permalinks not enabled, the url

    yoursite.com/?rest_route=/  

will work .

like image 187
Anoop D Avatar answered Oct 02 '22 16:10

Anoop D


The WordPress JSON API depends on pretty permalinks, make sure you have them enabled for the site.

like image 41
Eric Andrew Lewis Avatar answered Oct 02 '22 16:10

Eric Andrew Lewis