Authorize API key
-
I need to call wordpress endpoints from outside without basic auth. So I used api key for that. I defined my api key inside the config file. I am able to get main user details by calling the below endpoint.
https://mysite.com/wp-json/wp/v2/users/1
But I am getting a n error while calling for another user as follows
https://mysite.com/wp-json/wp/v2/users/2
Error:
‘code’: ‘rest_user_cannot_view’,
‘message’: ‘Sorry, you are not allowed to list users.’,
‘data’: {
‘status’: 401
}
How I can authorize the API key for all users? Please help
Or please tell any other method for api calls without using username and password
The topic ‘Authorize API key’ is closed to new replies.