Retrieve a Single Data Source
Retrieve a single data source by id.
https://api.storyblok.com/v2/cdn/datasources/:idPath parameters
Section titled “Path parameters”:idrequired stringThe data source’s ID.
Query parameters
Section titled “Query parameters”versionstringThe content version to retrieve:
draftorpublished. Default ispublished. Retrievingdraftrequires a preview access token.cvintegerCached version Unix timestamp. Learn more in the Caching concept.
tokenrequired stringA preview or public access token configured in a space.
Response properties
Section titled “Response properties”datasourceDatasourceShow child properties
idintegerData source ID.
namestringData source name.
slugstringData source
slug.dimensionsarray<Dimension>An array listing the dimensions defined for the data source.
Show child properties
idintegerDimension ID.
namestringDimension name.
entry_valuestringDimension value.
datasource_idintegerID of the data source that contains this dimension.
created_atstringCreation timestamp. Supports ISO 8601.
updated_atstringLatest update timestamp. Supports ISO 8601.
created_atstringCreation timestamp. Supports ISO 8601.
updated_atstringLatest update timestamp. Supports ISO 8601.
cvinteger | nullCached version Unix timestamp. Learn more in the Caching concept.
Examples
Section titled “Examples”curl "https://api.storyblok.com/v2/cdn/datasources/:id\?token=YOUR_ACCESS_TOKEN"// 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/:id', {}) console.log({ response })} catch (error) { console.log(error)}$client = new \Storyblok\Client('YOUR_STORYBLOK_SPACE_ACCESS_TOKEN');
$client->get('datasources/:id')->getBody();HttpResponse<String> response = Unirest.get("https://api.storyblok.com/v2/cdn/datasources/:id?token=YOUR_ACCESS_TOKEN") .asString();var client = new RestClient("https://api.storyblok.com/v2/cdn/datasources/:id?token=YOUR_ACCESS_TOKEN");var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);import requests
url = "https://api.storyblok.com/v2/cdn/datasources/:id"
querystring = {"token":"YOUR_ACCESS_TOKEN"}
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/:id')let storyblok = URLSession(storyblok: .cdn(accessToken: "YOUR_ACCESS_TOKEN"))let request = URLRequest(storyblok: storyblok, path: "datasources/:id")let (data, _) = try await storyblok.data(for: request)print(try JSONSerialization.jsonObject(with: data))val client = HttpClient { install(Storyblok(CDN)) { accessToken = "YOUR_ACCESS_TOKEN" }}
val response = client.get("datasources/:id")
println(response.body<JsonElement>()){"datasource": { "id": 1123, "name": "Labels", "slug": "labels", "dimensions": [ { "id": 1, "name": "en", "entry_value": "en", "datasource_id": 1123 } ], "created_at": "2025-02-10T08:12:00.000Z", "updated_at": "2025-02-10T08:12:00.000Z"},"cv": 1541863983}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