Hello,
you can try below API
GET /wp-json/wp/v2/posts?status=publish,draft,trash
set your domain name . like :
example.com/wp-json/wp/v2/posts?status=publish,draft,trash
Hi @narolainfotech,
http://localhost/wp-json/wp/v2/posts?status=publish,draft,trash
It give me error as mention below
{“code”:”rest_invalid_param”,”message”:”Invalid parameter(s): status”,”data”:{“status”:400,”params”:{“status”:”Status is forbidden.”},”details”:{“status”:{“code”:”rest_forbidden_status”,”message”:”Status is forbidden.”,”data”:{“status”:401}}}}}
Regards
Sachin
The API reference says we can only send one status value at a time. If true, you’d need to make separate requests for each desired status.
I would have expected the ability to send an array of status values. Sending an array in a GET request is a little strange, we use empty square brackets for each array element. For example:
example.com/wp-json/wp/v2/posts?status[]=publish&status[]=draft&status[]=trash
I’m not too confident this would work, but no harm in trying it 🙂