I am using the wpapi npm module to interface with the WP rest api in a node app. I am authenticated and my user created some draft posts. When I go to the dashboard with the same credentials, I can see/edit the draft posts as well.
I am using this method to list the drafts:
wp.posts().auth().param( 'context', 'edit' ).param( 'status', 'draft' )
But I keep getting this error:
{ code: 'rest_invalid_param',
message: 'Invalid parameter(s): status',
data: { status: 400, params: { status: 'Status is forbidden.' } } }
Here's where I've commented on the issue and some helpful context.
The curl response to http://localhost:8000/wp-json/wp/v2/posts?status=draft is the same error message so I don't believe the issue is with the node module.