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_id required number
Numeric ID of a space
Query parameters
Section titled “Query parameters”- by_story_id required number
ID of the story whose versions shall be returned.
- by_release_id number
ID 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 number
Default:
1. Learn more under Pagination. - per_page number
Default:
25. Max:100. Learn more under Pagination. - show_content boolean
Enable the retrieval of the content of each story version. Disable by default.
Response properties
Section titled “Response properties”- story_versions object[]
An array of objects representing a story version.
- id number
Numeric id of the story version
- created_at string
Creation date (Format:
yyy-MM-dd'T'HH:mm:ssZ) - user_id number
User/numeric id of collaborator
- user object
Name of the author
- id number
The user ID
- firstname string
First name of collaborator
- lastname string
Last name of collaborator
- alt_email string
Email of collaborator
- avatar string
Avatar of collaborator usually an image
- userid string
User ID of collaborator
- friendly_name string
Friendly name of collaborator
-
- story_id number
ID of the story
- status string
Publication status of the version
- release_id number
ID of the release
- parent_id number
ID of the parent folder
- content object
This 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"// Using the Universal JavaScript Client:// https://github.com/storyblok/storyblok-js-clientStoryblok.get('spaces/288868932106293/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/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"}})var request = URLRequest(url: URL(string: "https://mapi.storyblok.com/v1/spaces/288868932106293/story_versions?by_story_id=174957")!)request.setValue("YOUR_OAUTH_TOKEN", forHTTPHeaderField: "Authorization")request.httpMethod = "GET"let (data, _) = try await URLSession.shared.data(for: request)print(try JSONSerialization.jsonObject(with: data))val client = HttpClient { install(ContentNegotiation) { json() } install(DefaultRequest) { url { takeFrom("https://mapi.storyblok.com/v1/") headers.append("Authorization", "YOUR_OAUTH_TOKEN") } }}
val response = client.get("spaces/288868932106293/story_versions") { url { parameters.append("by_story_id", "174957") }}
println(response.body<JsonElement>())Get in touch with the Storyblok community