Authentication
API requests must be authenticated by providing a API access token as a query parameter. Learn more in the Access Tokens concept.
Examples
Section titled “Examples”Fetch published stories
Section titled “Fetch published stories”curl "https://api.storyblok.com/v2/cdn/stories\?token=wANpEQEsMYGOwLxwXQ76Ggtt\&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', { "version": "published"}) console.log({ response })} catch (error) { console.log(error)}$client = new \Storyblok\Client('YOUR_STORYBLOK_SPACE_ACCESS_TOKEN');
$client->getStories([ "version" => "published"])->getBody();HttpResponse<String> response = Unirest.get("https://api.storyblok.com/v2/cdn/stories?token=wANpEQEsMYGOwLxwXQ76Ggtt&version=published") .asString();var client = new RestClient("https://api.storyblok.com/v2/cdn/stories?token=wANpEQEsMYGOwLxwXQ76Ggtt&version=published");var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);import requests
url = "https://api.storyblok.com/v2/cdn/stories"
querystring = {"token":"wANpEQEsMYGOwLxwXQ76Ggtt","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.stories({:params => { "version" => "published"}})let storyblok = URLSession(storyblok: .cdn(accessToken: "wANpEQEsMYGOwLxwXQ76Ggtt"))var request = URLRequest(storyblok: storyblok, path: "stories")request.url!.append(queryItems: [ 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 = "wANpEQEsMYGOwLxwXQ76Ggtt" }}
val response = client.get("stories") { url { parameters.append("version", "published") }}
println(response.body<JsonElement>())
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