• How to retrieve post status using rest API? I can get the post using this API parameter getRequest(‘wp/v2/posts?per_page=100’)

    Now I want to filter post using post status. How many posts are published, private, trash, etc.. How to get post status data?

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter pmehtpli

    (@pmehtpli)

    i am geting this error

    24-Mar-2018 07:58:13 Europe/Zurich] PHP Fatal error: Uncaught GuzzleHttp\Exception\ClientException: Client error: GET https://stage.exil.cl/backstage/wp-json/wp/v2/posts?status=pending resulted in a 400 Bad Request response:
    {“code”:”rest_invalid_param”,”message”:”Ung\u00fcltige(r) Parameter: status”,”data”:{“status”:400,”params”:{“status”:”St (truncated…)
    in /home/exilcl/public_html/stage.exil.cl/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:111

    it seem wordpress doesn’t support REST for status parameter.
    Might be you can add status something like this &status=pedium and then retrieve this posts by yourself manually.

    @neo332 status is supported, as you can see in the documentation.

    @pmehtpli Any status other than publish would require the user to be logged in. Is the request authenticated? See the documentation on Authentication for more.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to retrieve post status using rest API?’ is closed to new replies.