Retrieve a Single Datasource
Returns a single datasource object.
GET
https://api.storyblok.com/v2/cdn/datasources/:idPath parameters
Section titled “Path parameters”:idnumberThe datasource ID
Query parameters
Section titled “Query parameters”tokenrequired stringA preview or public access token
Response properties
Section titled “Response properties”datasourceA single datasource object
cvnumberCached version Unix timestamp (see Cache Invalidation)
Examples
Section titled “Examples”curl "https://api.storyblok.com/v2/cdn/datasources/product-labels\?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/datasources/product-labels', {}) console.log({ response })} catch (error) { console.log(error)}$client = new \Storyblok\Client('YOUR_STORYBLOK_SPACE_ACCESS_TOKEN');
$client->get('datasources/product-labels')->getBody();HttpResponse<String> response = Unirest.get("https://api.storyblok.com/v2/cdn/datasources/product-labels?token=ask9soUkv02QqbZgmZdeDAtt") .asString();var client = new RestClient("https://api.storyblok.com/v2/cdn/datasources/product-labels?token=ask9soUkv02QqbZgmZdeDAtt");var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);import requests
url = "https://api.storyblok.com/v2/cdn/datasources/product-labels"
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.get('datasources/product-labels')let storyblok = URLSession(storyblok: .cdn(accessToken: "ask9soUkv02QqbZgmZdeDAtt"))let request = URLRequest(storyblok: storyblok, path: "datasources/product-labels")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("datasources/product-labels")
println(response.body<JsonElement>()){ "datasource": { "id": 313699, "name": "Background Color Options", "slug": "background-color-options", "dimensions": [] }, "cv": 1710350440}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