-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Labels
Description
Package
storyblok-js-client (Client SDK)
Bug Description
When calling the Management API to get a story by an ID, you get a 404 response if you pass in an improper param such as "version" (version is something you can use in the CDN API, but not management). 404 is an odd error message for this and very confusing to debug.
Steps to Reproduce
Call API with a param that isn't in the documentation
Expected Behavior
Helpful response error code and message
Actual Behavior
404 error code and message
Code Sample
try {
const {
data: { story },
} = await StoryblokManagement.get(`spaces/${process.env.WWW_STORYBLOK_SPACE_ID}/stories/${storyId}`, version: 'draft')
} catch (error) {
console.error('Error fetching story from Management API:', error)
}Environment
N/AError Logs
Additional Context
No response
Reactions are currently unavailable