Retrieve a Single Datasource
Returns a single datasource object for the specified id
.
https://api.storyblok.com/v2/cdn/datasources/:id
Query Parameters
-
token
required stringA preview or public access token configured in a space.
Response Properties
-
datasource
The Datasource ObjectA single datasource object.
-
id
numberThe numeric ID
-
name
stringThe complete name provided for the datasource
-
slug
stringThe unique slug of the datasource
-
dimensions
object[]An array listing the dimensions (e.g., per country, region, language, or other context) defined for the datasource
-
id
numberThe numeric ID
-
name
stringThe complete name provided for the datasource
-
entry_value
stringThe value provided for the datasource dimension (e.g., a language code)
-
datasource_id
numberThe numeric ID of the datasource that the dimension belongs to
-
created_at
stringCreation date (Format:
yyyy-MM-dd'T'HH:mm:ssZ
) -
updated_at
stringLatest update date (Format:
yyyy-MM-dd'T'HH:mm:ssZ
)
-
-
-
cv
numberUsed to access a particular cached version of a published story by providing a Unix timestamp. Further information is found under Cache Invalidation.
curl "https://api.storyblok.com/v2/cdn/datasources/313699?token=ask9soUkv02QqbZgmZdeDAtt" \
-X GET \
-H "Accept: application/json" \
-H "Content-Type: application/json"
// Using the Universal JavaScript Client:
// https://github.com/storyblok/storyblok-js-client
Storyblok.get('cdn/datasources/313699', {})
.then(response => {
console.log(response)
}).catch(error => {
console.log(error)
})
$client = new \Storyblok\Client('YOUR_STORYBLOK_SPACE_ACCESS_TOKEN');
$client->get('/datasources/313699')->getBody();
require 'storyblok'
client = Storyblok::Client.new(oauth_token: 'YOUR_OAUTH_TOKEN')
client.space()
HttpResponse<String> response = Unirest.get("https://api.storyblok.com/v2/cdn/datasources/313699?token=ask9soUkv02QqbZgmZdeDAtt")
.asString();
var client = new RestClient("https://api.storyblok.com/v2/cdn/datasources/313699?token=ask9soUkv02QqbZgmZdeDAtt");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
This is swift code
import requests
url = "https://api.storyblok.com/v2/cdn/datasources/313699"
querystring = {"token":"ask9soUkv02QqbZgmZdeDAtt"}
payload = ""
headers = {}
response = requests.request("GET", url, data=payload, headers=headers, params=querystring)
print(response.text)
{
"datasource": {
"id": 313699,
"name": "Background Color Options",
"slug": "background-color-options",
"dimensions": []
},
"cv": 1710350440
}