Storyblok
Search Storyblok's Documentation
  1. Retrieve a Single Datasource

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 string

    A preview or public access token configured in a space.

Response Properties

  • datasource

    The Datasource Object
    • id

      number

      The numeric ID

    • name

      string

      The complete name provided for the datasource

    • slug

      string

      The 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

        number

        The numeric ID

      • name

        string

        The complete name provided for the datasource

      • entry_value

        string

        The value provided for the datasource dimension (e.g., a language code)

      • datasource_id

        number

        The numeric ID of the datasource that the dimension belongs to

      • created_at

        string

        Creation date (Format: yyyy-MM-dd'T'HH:mm:ssZ)

      • updated_at

        string

        Latest update date (Format: yyyy-MM-dd'T'HH:mm:ssZ)

  • cv

    number

    Used to access a particular cached version of a published story by providing a Unix timestamp. Further information is found under Cache Invalidation.

Request
curl "https://api.storyblok.com/v2/cdn/datasources/313699?token=ask9soUkv02QqbZgmZdeDAtt" \
  -X GET \
  -H "Accept: application/json" \
  -H "Content-Type: application/json"
Request
// 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)
  })
Request
$client = new \Storyblok\Client('YOUR_STORYBLOK_SPACE_ACCESS_TOKEN');

$client->get('/datasources/313699')->getBody();
Request
require 'storyblok'
client = Storyblok::Client.new(oauth_token: 'YOUR_OAUTH_TOKEN')

client.space()
Request
HttpResponse<String> response = Unirest.get("https://api.storyblok.com/v2/cdn/datasources/313699?token=ask9soUkv02QqbZgmZdeDAtt")
  .asString();
Request
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
Request
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)
Response
{
  "datasource": {
    "id": 313699,
    "name": "Background Color Options",
    "slug": "background-color-options",
    "dimensions": []
  },
  "cv": 1710350440
}