I am unable to get the user info from the REST API. The user has not any post created. I have installed the Basic-Auth plugin. Whenever I try to get the user info, I get the following error.
Request : https://example.com/wp-json/wp/v2/users/6
{
"code": "rest_user_cannot_view",
"message": "Sorry, you are not allowed to list users.",
"data": {
"status": 401
}
}
But whenever I request the other user, I get the info.
{
"id": 1,
"name": "asdf",
"url": "",
"description": "",
"link": "https://example.com/author/drzvikrant/",
"slug": "asdf",
"avatar_urls": {
"24": "https://secure.gravatar.com/avatar/4bc329d2835e6584d5b492fdc67a5cde?s=24&d=mm&r=g",
"48": "https://secure.gravatar.com/avatar/4bc329d2835e6584d5b492fdc67a5cde?s=48&d=mm&r=g",
"96": "https://secure.gravatar.com/avatar/4bc329d2835e6584d5b492fdc67a5cde?s=96&d=mm&r=g"
},
"meta": [],
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wp/v2/users/1"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wp/v2/users"
}
]
}
}
I need to get the user info, even if the user have not created any posts.