Bring entities on draft mode Strapi

Scenario

I'm trying to get all entities from an endpoint, the ones on draft mode, and the ones on published mode. I know that if I want to post on draft mode, I have to post published_at on null on the body request.

If I do:

/posts?published_at_null=true 

that returns an empty array.

Question

How can I do to return ALL the posts?


Solution 1:

It is on the documentation

https://strapi.io/documentation/developer-docs/latest/developer-resources/content-api/content-api.html#publication-state

But quick answer, URL + '?_publicationState=preview'

https://forum.strapi.io/t/draft-and-posted-entities/3576/2