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
Section titled “Path parameters”-
:full_slugstringStory full slug
-
:idnumberStory ID
-
:uuidstringStory UUID
Query parameters
Section titled “Query parameters”-
tokenrequired stringA preview or public access token
-
find_byuuidRequired when using the story UUID as a path parameter.
-
versiondraft | publishedDefault:
published -
cvnumberCached version Unix timestamp (see Cache Invalidation)
-
from_releasestringAccess a story version in a specific release by providing the release ID
-
resolve_linksstory | url | linkResolve link fields. Resolved links are included in the
linksproperty of the response.link: Provides access to additional information, such as a linked story’sfull_slug,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.story: Resolves and returns the complete story object of a linked story.
-
resolve_links_level1 | 2Default:
1. Resolve up to two levels of links. -
resolve_relationsstringUsed to resolve referenced stories. Resolved stories are included in the
relsproperty of the response. Entries can be resolved two levels deep.A maximum of
50stories can be resolved in a single request. If this limit is exceeded, all story UUIDs are included in therel_uuidsproperty of the response and need to be resolved in subsequent API requests.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 -
resolve_level2Used to force resolve second-level relations when the first level reaches a limit of 100 relations.
While resolving relations, if the first level exceeds
100relations, the API, by default, stops looking for the second level. Usingresolve_level=2, second-level relations can be resolved even when the limit of first-level relations is reached. -
resolve_assetsnumberUsed to resolve asset metadata, including custom metadata. When
resolve_assets=1, an array of assets associated with the story appear in theassetsproperty of the response. -
fallback_langstringDefine a custom fallback language to handle untranslated fields. Accepts any language code that is configured in the Storyblok space. Note that the language code needs to be provided with underscores, even if it is defined with hyphens. E.g.,
es_coinstead ofes-co. -
languagestringRetrieve translated story version. Accepts any language code that is configured in the Storyblok space.
Response properties
Section titled “Response properties”-
storyThe complete story object -
relsArray of resolved stories -
linksAn array of resolved links -
rel_uuidsAn array of all UUIDS of referenced stories (if the limit of resolvable relations is exceeded) -
link_uuidsAn array of all UUIDS of linked stories (if the limit of resolvable links is exceeded)
Examples
Section titled “Examples”curl "https://api.storyblok.com/v2/cdn/stories/posts/my-third-post\?token=ask9soUkv02QqbZgmZdeDAtt"// storyblok-js-client@>=7, node@>=18import Storyblok from "storyblok-js-client";
const storyblok = new Storyblok({ accessToken: "krcV6QGxWORpYLUWt12xKQtt",});
try { const response = await storyblok.get('cdn/stories/posts/my-third-post', {}) console.log({ response })} catch (error) { console.log(error)}$client = new \Storyblok\Client('YOUR_STORYBLOK_SPACE_ACCESS_TOKEN');
$client->getStoryBySlug('posts/my-third-post')->getBody();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 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)require 'storyblok'client = Storyblok::Client.new(token: 'YOUR_TOKEN')
client.story('posts/my-third-post')let storyblok = URLSession(storyblok: .cdn(accessToken: "ask9soUkv02QqbZgmZdeDAtt"))let request = URLRequest(storyblok: storyblok, path: "stories/posts/my-third-post")let (data, _) = try await storyblok.data(for: request)print(try JSONSerialization.jsonObject(with: data))val client = HttpClient { install(Storyblok(CDN)) { accessToken = "ask9soUkv02QqbZgmZdeDAtt" }}
val response = client.get("stories/posts/my-third-post")
println(response.body<JsonElement>()){ "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": []}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