WP-API get posts with status=draft returns 401
-
I understand why for the public you would not want to show posts that are in draft mode, but I have a special circumstance where I need to show posts that are in draft to the public, a user not logged in.
If I put this post (20512) in draft I get this error when trying the GET the page.
https://localhost:2029/wp-json/wp/v2/pages/20512?status=publish,draft{
code: “rest_forbidden”,
message: “Sorry, you are not allowed to do that.”,
data: {
status: 401
}
}Is there a workaround, plugin or method I can use to get drafts with the API?
thanks,
Paul
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘WP-API get posts with status=draft returns 401’ is closed to new replies.