2

The title pretty much says it all, if I try eg. /wp-json/wp/v2/posts?id=1, I get all the posts as response. URL parameters are not working as they should. According to the REST API Handbook, the server is not configured properly to detect URL parameters. There's a common solution given for nginx servers, but I use apache, so I have no idea how to solve this.

1 Answer 1

5

You’re using the wrong endpoint. Look at the documentation. id is not one of the parameters for the posts endpoint.

The correct way to retrieve a post with the ID of 1 is:

/wp-json/wp/v2/posts/1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.