Cloning using dimensions app through API?

Is it possible to programmatically clone pages, leaving them connected as Alternates? It is tedious cloning pages manually when creating a new localization. Thank you.

2 Likes

I second, this is a basic function that needs to exist in SB!

Hello @fsmith and @Germaip,

it is possible to do so there are two cases that will require a different procedure:

  1. Case: The original story is already part of a group of alternatives which means that "group_id" will contain a space-wide unique groups id.
    You just need to make a copy of that page by getting the complete story with the request Storyblok API Documentation and make necessary modifications like changing the parent of it so it gets placed in the desired folder. After that, you can create the copy by keeping the "group_id" as it was in the original story and make a POST request as shown here Storyblok API Documentation

  2. Case: The original story isn’t part of an alternative group yet and "group_id" is empty.
    You will need to generate a group id and save this in the original story by updating it with the request Storyblok API Documentation after that you can proceed as before in case 1 and create the linked copy of that story.

Our suggestion is to use a guid for the "group_id".

Best regards
Hannes