I’m using the Pipelines Storyblok app.
I’m able to retrieve single stories using my preview token, such as:
But, when I use my preview branch token, I get a 404 response “This record could not be found”.
My goal is to get the content of a single story by ID from a particular pipeline stage. Is there a way to do that?
Alright, that worked!
Here are the two points I did not understand:
- In order to query by UUID, add the parameter: find_by=uuid
- The story ID for a particular story on the Preview pipeline stage is not same value as the story ID (for the same story) on a different pipeline stage. If you want to query the API for a given story on different pipeline stages, the UUID works.
To 1. You need to switch to the particular id type you’re using if you want to have only 1 story but you can also use the
by_uuids parameter instead:
It allows you to get one or more stories by their UUIDs.
To 2. https://www.storyblok.com/faq/what-is-difference-between-story-id-and-uuid
We recommend to use UUIDs instead of the legacy
id in all cases.