Open LeonardoCamargo31 opened 3 years ago
Hi,
I'm getting an error when trying to retrieve revisions to a post
Here's how I perform the basic auth:
const wp = new WPAPI({ endpoint: 'https://www.my-url.com/wp-json', username: 'username', password: 'password', auth: true, })
And my request looks like this:
wp .posts() .id(postId) .revisions() .then((result) => { console.log ('result', result) return result })
Error
{ code: 'rest_cannot_read', message: 'No permission to view revisions to this post.' data: {status: 401} }
In wordpress I'm using this plugin https://github.com/WP-API/Basic-Auth
Reference http://wp-api.org/node-wpapi/authentication/#basic-authentication
Am I doing something wrong? Can someone help me please
Have you checked your permissions to view posts? Is this your post?
@MartinSchere I have the role as administrator, I can see the post, but this post is not mine.
Hi,
I'm getting an error when trying to retrieve revisions to a post
Here's how I perform the basic auth:
And my request looks like this:
Error
In wordpress I'm using this plugin https://github.com/WP-API/Basic-Auth
Reference http://wp-api.org/node-wpapi/authentication/#basic-authentication
Am I doing something wrong? Can someone help me please