Retrieve a Single Story
Returns a single story object for the specified full_slug
, id
or uuid
.
https://api.storyblok.com/v2/cdn/stories/(:full_slug|:id|:uuid)
Path Parameters
-
:full_slug
stringThe full slug of the story, combining the parent folder(s) and the designated story slug
-
:id
numberThe numeric ID of the story
-
:uuid
stringThe UUID of the story (important: it is required to append the query param
find_by=uuid
)
Query Parameters
-
token
required stringA preview or public access token configured in a space.
-
find_by
stringAdded if you want to query by
uuid
instead of using the numericid
-
version
stringDefault:
published
. Possible values:draft
,published
-
resolve_links
enumUsed to resolve internal links of link fields used in a story. Resolved links are included in the
links
property of the response. Possible values arestory
,url
, andlink
. Entries can be resolved two levels deep usingresolve_links_level
. Learn more in this developer guide.Possible values Description link Provides access to additional information such as a linked story's path, parent_id, is_folder, published, is_startpage, position, alternates, real_path, and more. url If only the path of a linked story is required, this value provides the minimum amount of information in the response. story Resolves and returns the complete story object of a linked story. -
resolve_links_level
numberDefault:
1
. Possible values:1
,2
Used to resolve up to two levels of links. For example, if a story has a link field that references another story, the links in this story will also be resolved ifresolve_links_level
is set to2
. -
resolve_relations
stringUsed to resolve relations to other stories established via a multi-option or single-option field. Resolved relations are included in the
rels
property of the response. A maximum of50
stories can be resolved. If this limit is exceeded, the story UUIDs are included in therel_uuids
property of the response and can be used for further API requests (this is handled automatically when using one of Storyblok's official frontend SDKs). Entries can be resolved two levels deep.To resolve the stories selected in one field, provide the technical name of the immediate parent component of the field, followed by a
.
and the field name. To resolve the stories selected in multiple fields, provide a comma-separated list.Example:
resolve_relations=page.author,page.categories
Further information can be found in this tutorial.
-
from_release
stringUsed to access a story version associated with a specific release by providing the release ID
-
cv
numberUsed to access a particular cached version of a published story by providing a Unix timestamp. Further information is found under Cache Invalidation.
-
language
stringUsed to obtain translated versions of one or more stories. Accepts any language code that is configured in the Storyblok space. Used in the context of field-level translation.
-
fallback_lang
stringUsed to define a custom fallback language to handle untranslated fields. As standard, the default language defined in the Storyblok is used. Please note that the language code needs to be specified with underscores, even if it is defined with hyphens. E.g.,
es_co
instead ofes-co
. -
resolve_assets
numberUsed to resolve asset metadata, including custom metadata. The resolved metadata is included in the
assets
property of the response. This parameter is only available in the Business plan and above. Please refer to our Pricing for further information.
Response Properties
-
story
The Story ObjectThe complete story object
-
name
stringThe complete name provided for the story
-
created_at
stringCreation date (Format:
yyyy-MM-dd'T'HH:mm:ssZ
) -
published_at
stringLatest publishing date (Format:
yyyy-MM-dd'T'HH:mm:ssZ
) -
updated_at
stringLatest update date (Format:
yyyy-MM-dd'T'HH:mm:ssZ
) -
id
numberThe numeric ID
-
uuid
stringGenerated UUID string
-
content
objectAn object containing the field data associated with the specific story type's specific content structure. Also includes a
component
property with the story type's technical name. -
slug
stringThe slug specific for the story
-
full_slug
stringThe full slug of the story, combining the parent folder(s) and the designated story slug
-
sort_by_date
stringDate defined in the story's entry configuration (Format:
YYYY-mm-dd
) -
position
numberNumeric representation of the story's position in the folder
-
tag_list
string[]Array of tag names
-
is_startpage
booleantrue
if the story is defined as root for the folder -
parent_id
numberID of the parent folder
-
meta_data
objectObject to store non-editable data that is exclusively maintained with the Management API
-
group_id
stringGroup ID (UUID string), shared between stories defined as alternates
-
first_published_at
stringFirst publishing date (Format:
yyyy-MM-dd'T'HH:mm:ssZ
) -
release_id
numberID of the current release (can be requested with the
from_release
API parameter) -
lang
stringLanguage code of the current language (can be requested with the
language
API parameter) -
path
stringValue of the real path defined in the story's entry configuration (usually, this value is only required for Storyblok's Visual Editor)
-
alternates
object[]An array containing objects that provide basic data of the stories defined as alternates of the current story
-
id
numberThe numeric ID
-
name
stringThe complete name provided for the story
-
slug
stringThe slug specific for the story
-
published
booleantrue
if a story has been published at least once (even if it is currently in draft) -
full_slug
stringThe full slug of the story, combining the parent folder(s) and the designated story slug
-
is_folder
booleantrue
if the instance constitutes a folder
-
-
default_full_slug
stringContains the complete slug of the default language (if the app Translatable Slugs is installed)
-
translated_slugs
object[]Array of translated slug objects (if the app Translatable Slugs is installed)
-
path
stringValue of the translated slug
-
name
stringThe complete name provided for the story
-
lang
stringLanguage code of the current language (can be requested with the
language
API parameter) -
published
booleantrue
if a story has been published at least once (even if it is currently in draft)
-
-
-
cv
numberUsed to access a particular cached version of a published story by providing a Unix timestamp. Further information is found under Cache Invalidation.
-
rels
The Story ObjectArray of resolved stories (if the
resolve_relations
parameter is in use)-
name
stringThe complete name provided for the story
-
created_at
stringCreation date (Format:
yyyy-MM-dd'T'HH:mm:ssZ
) -
published_at
stringLatest publishing date (Format:
yyyy-MM-dd'T'HH:mm:ssZ
) -
updated_at
stringLatest update date (Format:
yyyy-MM-dd'T'HH:mm:ssZ
) -
id
numberThe numeric ID
-
uuid
stringGenerated UUID string
-
content
objectAn object containing the field data associated with the specific story type's specific content structure. Also includes a
component
property with the story type's technical name. -
slug
stringThe slug specific for the story
-
full_slug
stringThe full slug of the story, combining the parent folder(s) and the designated story slug
-
sort_by_date
stringDate defined in the story's entry configuration (Format:
YYYY-mm-dd
) -
position
numberNumeric representation of the story's position in the folder
-
tag_list
string[]Array of tag names
-
is_startpage
booleantrue
if the story is defined as root for the folder -
parent_id
numberID of the parent folder
-
meta_data
objectObject to store non-editable data that is exclusively maintained with the Management API
-
group_id
stringGroup ID (UUID string), shared between stories defined as alternates
-
first_published_at
stringFirst publishing date (Format:
yyyy-MM-dd'T'HH:mm:ssZ
) -
release_id
numberID of the current release (can be requested with the
from_release
API parameter) -
lang
stringLanguage code of the current language (can be requested with the
language
API parameter) -
path
stringValue of the real path defined in the story's entry configuration (usually, this value is only required for Storyblok's Visual Editor)
-
alternates
object[]An array containing objects that provide basic data of the stories defined as alternates of the current story
-
id
numberThe numeric ID
-
name
stringThe complete name provided for the story
-
slug
stringThe slug specific for the story
-
published
booleantrue
if a story has been published at least once (even if it is currently in draft) -
full_slug
stringThe full slug of the story, combining the parent folder(s) and the designated story slug
-
is_folder
booleantrue
if the instance constitutes a folder
-
-
default_full_slug
stringContains the complete slug of the default language (if the app Translatable Slugs is installed)
-
translated_slugs
object[]Array of translated slug objects (if the app Translatable Slugs is installed)
-
path
stringValue of the translated slug
-
name
stringThe complete name provided for the story
-
lang
stringLanguage code of the current language (can be requested with the
language
API parameter) -
published
booleantrue
if a story has been published at least once (even if it is currently in draft)
-
-
-
links
The Link Object[] or The Story Object[]An array of resolved links (dependent on the value of the
resolve_links
parameter).-
id
numberThe numeric ID
-
uuid
stringGenerated UUID string
-
slug
stringThe full slug of the story or folder
-
path
Value of the real path defined in the story's entry configuration
-
real_path
stringEither the full slug of the story or folder with a leading
/
, or, if existent, the value of the real path defined in the story's entry configuration with a leading/
-
name
The complete name of the story or folder
-
published
true
if a story has been published at least once (even if it is currently in draft) -
parent_id
numberID of the parent folder
-
is_folder
booleantrue
if the instance constitutes a folder -
is_startpage
booleantrue
if the story is defined as root for the folder -
position
numberNumeric representation of the story's position in the folder
-
published_at
stringLatest publishing date (Format:
yyyy-MM-dd'T'HH:mm:ssZ
); only included ifinclude_dates=1
is specified -
created_at
stringCreation date (Format:
yyyy-MM-dd'T'HH:mm:ssZ
); only included ifinclude_dates=1
is specified -
updated_at
stringLatest update date (Format:
yyyy-MM-dd'T'HH:mm:ssZ
); only included ifinclude_dates=1
is specified -
alternates
objectAn array containing objects that provide basic data of the different language versions of a story using Storyblok's Field Level Translation. Important: not to be confused with actual story alternates.
-
path
Translated slug of the story (if the app Translatable Slugs is installed; otherwise, it matches the slug of the parent object)
-
name
Translated name of the story (if the app Translatable Slugs is installed)
-
lang
Language code of this story variant
-
published
true
if a story has been published at least once (even if it is currently in draft) -
translated_slug
Translated slug of the story (if the app Translatable Slugs is installed; otherwise, it matches the slug of the parent object)
-
-
name
stringThe complete name provided for the story
-
created_at
stringCreation date (Format:
yyyy-MM-dd'T'HH:mm:ssZ
) -
published_at
stringLatest publishing date (Format:
yyyy-MM-dd'T'HH:mm:ssZ
) -
updated_at
stringLatest update date (Format:
yyyy-MM-dd'T'HH:mm:ssZ
) -
id
numberThe numeric ID
-
uuid
stringGenerated UUID string
-
content
objectAn object containing the field data associated with the specific story type's specific content structure. Also includes a
component
property with the story type's technical name. -
slug
stringThe slug specific for the story
-
full_slug
stringThe full slug of the story, combining the parent folder(s) and the designated story slug
-
sort_by_date
stringDate defined in the story's entry configuration (Format:
YYYY-mm-dd
) -
position
numberNumeric representation of the story's position in the folder
-
tag_list
string[]Array of tag names
-
is_startpage
booleantrue
if the story is defined as root for the folder -
parent_id
numberID of the parent folder
-
meta_data
objectObject to store non-editable data that is exclusively maintained with the Management API
-
group_id
stringGroup ID (UUID string), shared between stories defined as alternates
-
first_published_at
stringFirst publishing date (Format:
yyyy-MM-dd'T'HH:mm:ssZ
) -
release_id
numberID of the current release (can be requested with the
from_release
API parameter) -
lang
stringLanguage code of the current language (can be requested with the
language
API parameter) -
path
stringValue of the real path defined in the story's entry configuration (usually, this value is only required for Storyblok's Visual Editor)
-
alternates
object[]An array containing objects that provide basic data of the stories defined as alternates of the current story
-
id
numberThe numeric ID
-
name
stringThe complete name provided for the story
-
slug
stringThe slug specific for the story
-
published
booleantrue
if a story has been published at least once (even if it is currently in draft) -
full_slug
stringThe full slug of the story, combining the parent folder(s) and the designated story slug
-
is_folder
booleantrue
if the instance constitutes a folder
-
-
default_full_slug
stringContains the complete slug of the default language (if the app Translatable Slugs is installed)
-
translated_slugs
object[]Array of translated slug objects (if the app Translatable Slugs is installed)
-
path
stringValue of the translated slug
-
name
stringThe complete name provided for the story
-
lang
stringLanguage code of the current language (can be requested with the
language
API parameter) -
published
booleantrue
if a story has been published at least once (even if it is currently in draft)
-
-
-
rel_uuids
stringAn array of all UUIDS of resolvable stories. Only provided if the
resolve_relations
parameter is in use and the limit of resolvable relations is exceeded. -
link_uuids
stringAn array of all UUIDS of linked stories. Only provided if the
resolve_links
parameter is in use and the limit of resolvable links is exceeded.
curl "https://api.storyblok.com/v2/cdn/stories/posts/my-third-post?token=ask9soUkv02QqbZgmZdeDAtt" \
-X GET \
-H "Accept: application/json" \
-H "Content-Type: application/json"
// Using the Universal JavaScript Client:
// https://github.com/storyblok/storyblok-js-client
Storyblok.get('cdn/stories/posts/my-third-post', {})
.then(response => {
console.log(response)
}).catch(error => {
console.log(error)
})
$client = new \Storyblok\Client('YOUR_STORYBLOK_SPACE_ACCESS_TOKEN');
$client->getStoryBySlug('/posts/my-third-post')->getBody();
require 'storyblok'
client = Storyblok::Client.new(oauth_token: 'YOUR_OAUTH_TOKEN')
client.story('/posts/my-third-post')
HttpResponse<String> response = Unirest.get("https://api.storyblok.com/v2/cdn/stories/posts/my-third-post?token=ask9soUkv02QqbZgmZdeDAtt")
.asString();
var client = new RestClient("https://api.storyblok.com/v2/cdn/stories/posts/my-third-post?token=ask9soUkv02QqbZgmZdeDAtt");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "https://api.storyblok.com/v2/cdn/stories/posts/my-third-post?token=ask9soUkv02QqbZgmZdeDAtt")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0)
request.method = "GET"
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://api.storyblok.com/v2/cdn/stories/posts/my-third-post"
querystring = {"token":"ask9soUkv02QqbZgmZdeDAtt"}
payload = ""
headers = {}
response = requests.request("GET", url, data=payload, headers=headers, params=querystring)
print(response.text)
{
"story": {
"name": "My third post",
"created_at": "2024-02-08T16:26:24.425Z",
"published_at": "2024-02-08T16:30:09.300Z",
"id": 440448565,
"uuid": "e656e146-f4ed-44a2-8017-013e5a9d9395",
"content": {
"_uid": "cfe0ff0b-3211-4bb7-8128-66e6ad262a56",
"component": "page"
},
"slug": "my-third-post",
"full_slug": "posts/my-third-post",
"sort_by_date": null,
"position": 0,
"tag_list": [],
"is_startpage": false,
"parent_id": 440448337,
"meta_data": null,
"group_id": "b913a671-f1e9-436a-bc5d-2795d2740198",
"first_published_at": "2024-02-08T16:27:05.705Z",
"release_id": null,
"lang": "default",
"path": null,
"alternates": [
{
"id": 440452827,
"name": "Mein dritter Beitrag",
"slug": "mein-dritter-beitrag",
"published": true,
"full_slug": "beitraege/mein-dritter-beitrag",
"is_folder": false,
"parent_id": 440452826
}
],
"default_full_slug": "posts/my-third-post",
"translated_slugs": [
{
"path": "posts/my-third-post",
"name": null,
"lang": "fr",
"published": null
},
{
"path": "posts/mein-dritter-beitrag",
"name": "Mein dritter Beitrag",
"lang": "de",
"published": true
}
]
},
"cv": 1707409909,
"rels": [],
"links": []
}