Retrieving Localized Stories by UUID
Utilizing the query parameter language in conjunction with find_by=uuid facilitates the retrieval of localized versions of entries without requiring knowledge of their slugs.
Example Request and Response
Section titled “Example Request and Response”The following example demonstrates how to receive the German version of a single story without knowing its slug.
curl "https://api.storyblok.com/v2/cdn/stories/660452d2-1a68-4493-b5b6-2f03b6fa722b\?find_by=uuid\&language=de\&token=krcV6QGxWORpYLUWt12xKQtt\&version=published"// 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/660452d2-1a68-4493-b5b6-2f03b6fa722b', { "find_by": "uuid", "language": "de", "version": "published"}) console.log({ response })} catch (error) { console.log(error)}$client = new \Storyblok\Client('YOUR_STORYBLOK_SPACE_ACCESS_TOKEN');
$client->getStoryByUuid('660452d2-1a68-4493-b5b6-2f03b6fa722b', [ "find_by" => "uuid", "language" => "de", "version" => "published"])->getBody();HttpResponse<String> response = Unirest.get("https://api.storyblok.com/v2/cdn/stories/660452d2-1a68-4493-b5b6-2f03b6fa722b?find_by=uuid&language=de&token=krcV6QGxWORpYLUWt12xKQtt&version=published") .asString();var client = new RestClient("https://api.storyblok.com/v2/cdn/stories/660452d2-1a68-4493-b5b6-2f03b6fa722b?find_by=uuid&language=de&token=krcV6QGxWORpYLUWt12xKQtt&version=published");var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);import requests
url = "https://api.storyblok.com/v2/cdn/stories/660452d2-1a68-4493-b5b6-2f03b6fa722b"
querystring = {"find_by":"uuid","language":"de","token":"krcV6QGxWORpYLUWt12xKQtt","version":"published"}
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('660452d2-1a68-4493-b5b6-2f03b6fa722b', {:params => { "find_by" => "uuid", "language" => "de", "version" => "published"}})let storyblok = URLSession(storyblok: .cdn(accessToken: "krcV6QGxWORpYLUWt12xKQtt"))var request = URLRequest(storyblok: storyblok, path: "stories/660452d2-1a68-4493-b5b6-2f03b6fa722b")request.url!.append(queryItems: [ URLQueryItem(name: "find_by", value: "uuid"), URLQueryItem(name: "language", value: "de"), URLQueryItem(name: "version", value: "published")])let (data, _) = try await storyblok.data(for: request)print(try JSONSerialization.jsonObject(with: data))val client = HttpClient { install(Storyblok(CDN)) { accessToken = "krcV6QGxWORpYLUWt12xKQtt" }}
val response = client.get("stories/660452d2-1a68-4493-b5b6-2f03b6fa722b") { url { parameters.append("find_by", "uuid") parameters.append("language", "de") parameters.append("version", "published") }}
println(response.body<JsonElement>()){ "story": { "name": "Earth's Symphony: Navigating the Wonders and Challenges of Our Blue Oasis", "created_at": "2024-02-16T14:22:09.108Z", "published_at": "2024-03-21T16:48:09.206Z", "id": 444996765, "uuid": "660452d2-1a68-4493-b5b6-2f03b6fa722b", "content": { "_uid": "6bdf037c-f713-415c-a26a-8a9cfc926c85", "image": { "id": 14114772, "alt": "", "name": "", "focus": "", "title": "", "source": "", "filename": "https://a.storyblok.com/f/276232/2560x1946/ee938cf736/earth.jpg", "copyright": "", "fieldtype": "asset", "meta_data": {}, "is_private": "", "is_external_url": false }, "author": "51eed33d-855f-415c-ac0d-4404e03b89e1", "topics": ["solar-system"], "content": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", "headline": "Die Symphonie der Erde: Die Wunder und Herausforderungen unserer blauen Oase", "component": "article", "scheduled": "2023-10-01 15:00", "categories": ["45d968b6-5790-4fbb-aa41-5781b8edde51", "d8e48716-0ecf-4059-b568-343bf54e4128"], "highlighted": false }, "slug": "earths-symphony-navigating-wonders-challenges-blue-oasis", "full_slug": "de/articles/earths-symphony-navigating-wonders-challenges-blue-oasis", "sort_by_date": null, "position": 0, "tag_list": ["Editor's Choice", "Featured"], "is_startpage": false, "parent_id": 444991588, "meta_data": null, "group_id": "8d99d18d-5c97-42cd-a646-51e0c553f26a", "first_published_at": "2024-02-16T14:30:11.990Z", "release_id": null, "lang": "de", "path": null, "alternates": [], "default_full_slug": null, "translated_slugs": null }, "cv": 1711108220, "rels": [], "links": []}
Thanks! We received your feedback.
An error occurred. Please try again.
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