-
Notifications
You must be signed in to change notification settings - Fork 191
Closed
Description
const wp = new WP({
endpoint: endpoint,
username: username,
password: password
});
wp.posts().filter({status: 'any'}).embed().id(id).then(function(data) {
console.log(data)
})
When I try to retrieve an post that is set to draft, I'm unable to retrieve the post. When I log the error, i got a 403 permission error.
error:
{ [Error: cannot GET /wp-json/wp/v2/posts/631?_embed=true (403)]
status: 403,
text: '{"code":"rest_forbidden","message":"You don\'t have permission to do this.","data":{"status":403}}',
method: 'GET',
path: '/wp-json/wp/v2/posts/631?_embed=true' },
The user credential i sent to WP is a user with Admin privilege.
Thank you so much for your help!
Metadata
Metadata
Assignees
Labels
No labels