0

I am new to WordPress. I have installed WordPress and the plugin wp-json api user.

I used the following API to get the user nonce:
http://localhost/wordpress/?json=get_nonce&controller=user&method=register

Then I used the following to create a new user using the following request :

http://localhost/wordpress/api/user/register/?username=john&[email protected]&nonce=89a3935cdc&display_name=John

I am getting 404 in reponse.

2
  • If I use the following to get the nonce then it fails with 404http://localhost/wordpress/api/get_nonce/?controller=user&method=register Commented Mar 18, 2015 at 6:50
  • This is my nginx configuration : root /Users/shoonye; location /wordpress/ { index index.php index.html index.htm; } location ~.php { include /usr/local/etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } Commented Mar 18, 2015 at 6:53

2 Answers 2

0
I modified the nginx conf as below :
1) I added the try_files 
location /wordpress/ {
        index  index.php index.html index.htm;
try_files $uri $uri/ /wordpress/index.php?$args;
    }

    location ~.php {
    include /usr/local/etc/nginx/fastcgi_params;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
2) Added the perma links in the wordpress : Custom perma links
/api/

Now it works fine.
Sign up to request clarification or add additional context in comments.

Comments

0

Make sure you have checked "anyone ca register" from wordpress admin dashboard . Then go to settings > Json Api at the bottom there is a sample link that should be used for Json Api request , you may have redefined the api value and you are not passing the correct and current api value in your request .

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.