How to export and import a translatable version of my story?
To export or import translatable versions of your story, you need to use the Storyblok Management API. Your block and field must have the “translatable” option enabled for the import to work.
Export Stories as XML
To export a story, you need your story ID and the ID of the space you want to export stories from. Then, you can make a GET request. Also, make sure you add Authorization to the header with your personal 0auth access token as the value.
You can find your 0Auth token in your Storyblok user account dashboard. You can also see our documentation for language code.
Importing Stories
You can either import stories as XML or JSON. To do this, just like when exporting stories, you need your story ID and the ID of the space, you want to import the story into. Since you’ll be updating your space, you need to make a PUT request and add Authorization to the header with your personal 0auth access token as the value. The body of the request should then contain the story you want to import in this format {"data": YOUR_STRINGIFIED_IMPORT_STORY}. It's important to note that imported stories can only be in JSON or XML format.
NOTE:
The data you’re importing must be a string. Whether it’s in XML or JSON format.
An easy way to check if the story update has worked is to access the same story in the Visual Editor and reload the page.
Parameters for the specific language
To export/import your story in specific languages already added to your space, add the optional param ?lang_code=language_code to the endpoint.
NOTE:
You can easily import and export translatable fields of your stories using the import translatable fields and export translatable fields apps respectively. The app is available in the Business plan or superior.
🍪 Cookie Notice
We use cookies to learn how you interact with our content, and show you relevant content and ads based on your browsing history. You can adjust your settings below. Here's our policy.