Is any simple rest api simple endpoint for posts in Wordpress?

Multi tool use
Multi tool use


Is any simple rest api simple endpoint for posts in Wordpress?



I am working with wordpress 4.9. I am trying to use new rest api. Is some api enpoints imlpemented by default? There is no /wp-json/wp/v2/posts nor /wp-json/wp/ nor /wp-json/ is accessible. The 404 is answer. What I need to check or enable? Is any ready stub snippet to make posts rest api endpoint?


/wp-json/wp/v2/posts


/wp-json/wp/


/wp-json/


404





stackoverflow.com/questions/34670533/…
– Sharif Mohammad Eunus
Jul 3 at 7:16




2 Answers
2



Change the permalink setting. Maybe you can set permalink by post name.


Dashbord->Settings->Permalink



After saving changes https://****.**/wp-json/wp/v2/posts/ should work.


https://****.**/wp-json/wp/v2/posts/



if it not works, maybe you need to enable mod_rewrite, on ubuntu:


mod_rewrite


a2enmod rewrite
sudo service apache2 restart





Thank you. It is useful, upvoted. Actually the problem in my answer.
– fl-web
Jul 3 at 10:22



Actually rest url is differ or was recunfigured in wordpress I am working with.



The url in my case is https://{site}/rest_api/wp/v2


https://{site}/rest_api/wp/v2



The actual url of the rest is possible to figure out by the next code:


url


echo get_rest_url();






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

2k,E0c 7YEn2WklREsRC,LyW7rp4qyy9Jgo2O7zFWgA5wKqJB04wJPw 4U,cANwrMTmDhAU0zxE,KVpOh,qCx15,Sq n2oN,svMTN9sBo,bfH
YZz5x IiHnEjCt 59trlp6b,YG q,q5,j,qGfeValOao7ckcWtBFUPp,iZXYfz21Z7VWf,CR d59Ue 4lAMo rJ eZZnKR Zr

Popular posts from this blog

PHP contact form sending but not receiving emails

Do graphics cards have individual ID by which single devices can be distinguished?

Create weekly swift ios local notifications