Skip to content

πŸ› [Bug]: Management API 404 When Incorrect ParamsΒ #433

@richardtaylordawson

Description

@richardtaylordawson

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/A

Error Logs

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions