⚠️Draft Content
Storyblok
Search Storyblok's Documentation
  1. Merge Stories

Management API

Merge Stories

This endpoint is used to merge the content of two stories.

https://mapi.storyblok.com/v1/spaces/:space-id/stories/:story-id/merge

Path Parameters

  • :space_id

    required number

    Numeric ID of a space

  • :story_id

    number

    This story's contents will be overridden by the content of the Story Id passed in the request body.

Request Body Properties

  • merge_with

    number

    The Id of the story we want to merge the current story with.

Request
curl "https://mapi.storyblok.com/v1/v1/spaces/296898/stories/522672112/merge" \ 
  -X PUT \
  -H "Authorization: YOUR_OAUTH_TOKEN" \
  -H "Content-Type: application/json" \
  -d "{\"merge_with\": 531460722}"
Request
// Using the Universal JavaScript Client:
// https://github.com/storyblok/storyblok-js-client
Storyblok.put('/v1/spaces/296898/stories/522672112/merge', {
    "merge_with": 531460722
})
  .then(response => {
    console.log(response)
  }).catch(error => { 
    console.log(error)
  })
Request
$client = new \Storyblok\ManagementClient('YOUR_OAUTH_TOKEN');

$payload = [
    "merge_with" =>  531460722
];

$client->put('/v1/spaces/296898/stories/522672112/merge', $payload)->getBody();
Request
require 'storyblok'
client = Storyblok::Client.new(oauth_token: 'YOUR_OAUTH_TOKEN')

payload = {
    "merge_with" =>  531460722
}

client.put('/v1/spaces/296898/stories/522672112/merge', payload)
Request
HttpResponse<String> response = Unirest.put("https://mapi.storyblok.com/v1/v1/spaces/296898/stories/522672112/merge")
  .header("Content-Type", "application/json")
  .header("Authorization", "YOUR_OAUTH_TOKEN")
  .body("{\"merge_with\": 531460722}")
  .asString();
Request
var client = new RestClient("https://mapi.storyblok.com/v1/v1/spaces/296898/stories/522672112/merge");
var request = new RestRequest(Method.PUT);

request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "YOUR_OAUTH_TOKEN");
request.AddParameter("application/json", "{\"merge_with\": 531460722}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
import Foundation

let headers = [
  "Content-Type": "application/json",
  "Authorization": "YOUR_OAUTH_TOKEN"
]

let postData = NSData(data: "{\"merge_with\": 531460722}".data(using: String.Encoding.utf8)!)

let request = NSMutableURLRequest(url: NSURL(string: "https://mapi.storyblok.com/v1/v1/spaces/296898/stories/522672112/merge")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0)
request.method = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
Request
import requests

url = "https://mapi.storyblok.com/v1/v1/spaces/296898/stories/522672112/merge"

querystring = {}

payload = "{\"merge_with\": 531460722}"
headers = {
  'Content-Type': "application/json",
  'Authorization': "YOUR_OAUTH_TOKEN"
}

response = requests.request("PUT", url, data=payload, headers=headers, params=querystring)

print(response.text)