Get Story Versions
https://mapi.storyblok.com/v1/spaces/:space_id/story_versionsRetrieve the versions of a story.
Path parameters
Section titled “Path parameters”-
:space_idrequired numberNumeric ID of a space
Query parameters
Section titled “Query parameters”-
by_story_idrequired numberID of the story whose versions shall be returned.
-
by_release_idnumberID 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.
-
pagenumberDefault:
1. Learn more under Pagination. -
per_pagenumberDefault:
25. Max:100. Learn more under Pagination. -
show_contentbooleanEnable the retrieval of the content of each story version. Disable by default.
Response properties
Section titled “Response properties”-
story_versionsobject[]An array of objects representing a story version.
-
idnumberNumeric id of the story version
-
created_atstringCreation date (Format:
yyy-MM-dd'T'HH:mm:ssZ) -
user_idnumberUser/numeric id of collaborator
-
userobjectName of the author
-
idnumberThe user ID
-
firstnamestringFirst name of collaborator
-
lastnamestringLast name of collaborator
-
alt_emailstringEmail of collaborator
-
avatarstringAvatar of collaborator usually an image
-
useridstringUser ID of collaborator
-
friendly_namestringFriendly name of collaborator
-
-
story_idnumberID of the story
-
statusstringPublication status of the version
-
release_idnumberID of the release
-
parent_idnumberID of the parent folder
-
contentobjectThis object contains the Story’s content when the
show_contentparameter is used
-
Examples
Section titled “Examples”curl "https://mapi.storyblok.com/v1/spaces/288868932106293/story_versions\?by_story_id=174957" \ -H "Authorization: YOUR_OAUTH_TOKEN"// storyblok-js-client@>=7, node@>=18import Storyblok from "storyblok-js-client";
const storyblok = new Storyblok({ oauthToken: "YOUR_PERSONAL_ACCESS_TOKEN",});
try { const response = await storyblok.get('spaces/288868932106293/story_versions', { "by_story_id": "174957" }) console.log({ response })} catch (error) { console.log(error)}$client = new \Storyblok\ManagementClient('YOUR_OAUTH_TOKEN');
$client->get('spaces/288868932106293/story_versions', [ "by_story_id" => "174957"])->getBody();HttpResponse<String> response = Unirest.get("https://mapi.storyblok.com/v1/spaces/288868932106293/story_versions?by_story_id=174957") .header("Authorization", "YOUR_OAUTH_TOKEN") .asString();var client = new RestClient("https://mapi.storyblok.com/v1/spaces/288868932106293/story_versions?by_story_id=174957");var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "YOUR_OAUTH_TOKEN");IRestResponse response = client.Execute(request);import requests
url = "https://mapi.storyblok.com/v1/spaces/288868932106293/story_versions"
querystring = {"by_story_id":"174957"}
payload = ""headers = { 'Authorization': "YOUR_OAUTH_TOKEN"}
response = requests.request("GET", url, data=payload, headers=headers, params=querystring)
print(response.text)require 'storyblok'client = Storyblok::Client.new(oauth_token: 'YOUR_OAUTH_TOKEN')
client.get('spaces/288868932106293/story_versions', {:params => { "by_story_id" => "174957"}})let storyblok = URLSession(storyblok: .mapi(accessToken: .oauth("YOUR_OAUTH_TOKEN")))var request = URLRequest(storyblok: storyblok, path: "spaces/288868932106293/story_versions")request.url!.append(queryItems: [ URLQueryItem(name: "by_story_id", value: "174957")])let (data, _) = try await storyblok.data(for: request)print(try JSONSerialization.jsonObject(with: data))val client = HttpClient { install(Storyblok(MAPI)) { accessToken = OAuth("YOUR_OAUTH_TOKEN") }}
val response = client.get("spaces/288868932106293/story_versions") { url { parameters.append("by_story_id", "174957") }}
println(response.body<JsonElement>())Was this page helpful?
This site uses reCAPTCHA and Google's Privacy Policy (opens in a new window) . Terms of Service (opens in a new window) apply.
Get in touch with the Storyblok community