Get Story Versions (New)
This allows you to retrieve the versions of a story and the corresponding author information. You can also filter the results based on pagination using the page
parameter. This can be done with a GET request on the story version you wish to retrieve.
https://mapi.storyblok.com/v1/spaces/:space_id/story_versions
This endpoint returns story versions created after 2024-08-28. For older versions, use the legacy endpoint.
Path Parameters
-
:space_id
required numberNumeric ID of a space
Query Parameters
-
by_story_id
required numberID of the story. When this is passed, the endpoint returns versions of this particular story.
-
by_release_id
numberID of the release. When this is passed, the endpoint returns versions of all stories within the release and stories not associated with a particular release.
-
page
numberDefault:
1
. Learn more under Pagination. -
per_page
numberDefault:
25
. Max:100
. Learn more under Pagination.
Response Properties
-
story_versions
object[]An array of objects with each object representing a version and details about the version
-
id
numberNumeric id of the story version
-
created_at
stringCreation date (Format:
yyyy-MM-dd'T'HH:mm:ssZ
) -
user_id
numberUser/numeric id of collaborator
-
user
objectName of the author
-
id
numberThe user ID
-
firstname
stringFirst name of collaborator
-
lastname
stringLast name of collaborator
-
alt_email
stringEmail of collaborator
-
avatar
stringAvatar of collaborator usually an image
-
userid
stringUser ID of collaborator
-
friendly_name
stringFriendly name of collaborator
-
-
story_id
numberID of the story
-
status
stringPublication status of the version
-
release_id
numberID of the release
-
parent_id
numberID of the parent folder
-
Example Request
curl "https://mapi.storyblok.com/v1/spaces/302787/story_versions?by_story_id=174957" \
-X GET \
-H "Authorization: YOUR_OAUTH_TOKEN" \
-H "Content-Type: application/json"
// Using the Universal JavaScript Client:
// https://github.com/storyblok/storyblok-js-client
Storyblok.get('/spaces/302787/story_versions', {
"by_story_id": "174957"
})
.then(response => {
console.log(response)
}).catch(error => {
console.log(error)
})
$client = new \Storyblok\ManagementClient('YOUR_OAUTH_TOKEN');
$client->get('/spaces/302787/story_versions', [
"by_story_id" => "174957"
])->getBody();
require 'storyblok'
client = Storyblok::Client.new(oauth_token: 'YOUR_OAUTH_TOKEN')
client.false('/spaces/302787/story_versions', {:params => {
"by_story_id" => "174957"
}})
HttpResponse<String> response = Unirest.get("https://mapi.storyblok.com/v1/spaces/302787/story_versions?by_story_id=174957")
.header("Authorization", "YOUR_OAUTH_TOKEN")
.asString();
var client = new RestClient("https://mapi.storyblok.com/v1/spaces/302787/story_versions?by_story_id=174957");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "YOUR_OAUTH_TOKEN");
IRestResponse response = client.Execute(request);
import Foundation
let headers = [
"Content-Type": "application/json",
"Authorization": "YOUR_OAUTH_TOKEN"
]
let request = NSMutableURLRequest(url: NSURL(string: "https://mapi.storyblok.com/v1/spaces/302787/story_versions?by_story_id=174957")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0)
request.method = "GET"
request.allHTTPHeaderFields = headers
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()
import requests
url = "https://mapi.storyblok.com/v1/spaces/302787/story_versions"
querystring = {"by_story_id":"174957"}
payload = ""
headers = {
'Content-Type': "application/json",
'Authorization': "YOUR_OAUTH_TOKEN"
}
response = requests.request("GET", url, data=payload, headers=headers, params=querystring)
print(response.text)
Example Request with Pagination
curl "https://mapi.storyblok.com/v1/spaces/302787/story_versions?by_story_id=174957&page=2" \
-X GET \
-H "Authorization: YOUR_OAUTH_TOKEN" \
-H "Content-Type: application/json"
// Using the Universal JavaScript Client:
// https://github.com/storyblok/storyblok-js-client
Storyblok.get('/spaces/302787/story_versions', {
"by_story_id": "174957",
"page": "2"
})
.then(response => {
console.log(response)
}).catch(error => {
console.log(error)
})
$client = new \Storyblok\ManagementClient('YOUR_OAUTH_TOKEN');
$client->get('/spaces/302787/story_versions', [
"by_story_id" => "174957",
"page" => "2"
])->getBody();
require 'storyblok'
client = Storyblok::Client.new(oauth_token: 'YOUR_OAUTH_TOKEN')
client.false('/spaces/302787/story_versions', {:params => {
"by_story_id" => "174957",
"page" => "2"
}})
HttpResponse<String> response = Unirest.get("https://mapi.storyblok.com/v1/spaces/302787/story_versions?by_story_id=174957&page=2")
.header("Authorization", "YOUR_OAUTH_TOKEN")
.asString();
var client = new RestClient("https://mapi.storyblok.com/v1/spaces/302787/story_versions?by_story_id=174957&page=2");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "YOUR_OAUTH_TOKEN");
IRestResponse response = client.Execute(request);
import Foundation
let headers = [
"Content-Type": "application/json",
"Authorization": "YOUR_OAUTH_TOKEN"
]
let request = NSMutableURLRequest(url: NSURL(string: "https://mapi.storyblok.com/v1/spaces/302787/story_versions?by_story_id=174957&page=2")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0)
request.method = "GET"
request.allHTTPHeaderFields = headers
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()
import requests
url = "https://mapi.storyblok.com/v1/spaces/302787/story_versions"
querystring = {"by_story_id":"174957","page":"2"}
payload = ""
headers = {
'Content-Type': "application/json",
'Authorization': "YOUR_OAUTH_TOKEN"
}
response = requests.request("GET", url, data=payload, headers=headers, params=querystring)
print(response.text)