Doesn’t seem to work
-
Hi All,
I am pretty new to WordPress but not new to REST API’s as a concept.
I am currently using WP v4.9.5 (as stated on the ‘At a glance’ section of the dashboard in the admin panel) hosted on wpengine.com.
Given the above version, I understand that the REST API’s starting from v4.7 onwards are available out of the box and no additional plugins are required. This being said, I proceeded to install the Application Passwords plugin as per the instructions on the same page to try out the basic authentication.
I have a user ‘ApiUser’ in WordPress with ‘Admin’ role for which I generated a password that looked like:
eref HgfY HKJH iuot REEt <-(fake password)
I used an online tool to Base64Encode the username and newly generated password as follows:
Base64Encoding of ‘ApiUser:erefHgfYHKJHiuotREEt’ results in ‘QXBpVXNlcjplcmVmSGdmWUhLSkhpdW90UkVFdA==’Using ‘Postman’ I set the Headers as follows:
content-type:application/json
authorization: basic QXBpVXNlcjplcmVmSGdmWUhLSkhpdW90UkVFdA==and made a simple GET request to:
https://mywebsite.wpengine.com/wp-json/wp/v2/users
https://mywebsite.wpengine.com/wp-json/wp/v2/pagesThe response I get is 401 Unauthorized
I was wondering if I was on the right track or if there was something that I was missing out on. Basically I am trying to access site content via the API’s
- The topic ‘Doesn’t seem to work’ is closed to new replies.