I'm trying to code the user authentication feature for my app using API. I'm confused between WordPress REST API and WordPress JSON API? Based on the Q&A here, it says I need WordPress JSON API. If my WP already has REST API, do I still need this JSON API?
Asked
Active
Viewed 252 times
1 Answers
1
Yes, they appear to be different. The Wordpress REST API appears to be built into, and come with a Wordpress Installation. I tested on my site, and was able to access the api for posts via a browser GET to /wp-json/wp/v2/posts. This is just an example. I would imagine the other option you mentioned is a plugin that does something similar but the format of the requests look entirely different. I would stick with the first solution that comes out of the box.
Aaron Pfoltzer
- 89
- 3
-
"First solution" meaning the REST API? But could that achieve the user authentication action? – TTOmoon Jul 09 '19 at 01:55
-
Yes the REST API appears to be good for accessing posts, etc, however the user authentication piece only supports cookie authentication out of the box. It looks like a plugin is required after all, as stated here: https://developer.wordpress.org/rest-api/using-the-rest-api/authentication/#authentication-plugins – Aaron Pfoltzer Jul 09 '19 at 02:02