Retrieve a Single Datasource
Returns a single datasource object.
https://api.storyblok.com/v2/cdn/datasources/:id
Path parameters
Section titled “Path parameters”- :id number
The datasource ID
Query parameters
Section titled “Query parameters”- token required string
A preview or public access token
Response properties
Section titled “Response properties”- datasource
A single datasource object
- cv number
Cached version Unix timestamp (see Cache Invalidation)
Examples
Section titled “Examples”curl "https://api.storyblok.com/v2/cdn/datasources/313699?token=ask9soUkv02QqbZgmZdeDAtt"
// Using the Universal JavaScript Client:// https://github.com/storyblok/storyblok-js-clientStoryblok.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();
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);
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)
require 'storyblok'client = Storyblok::Client.new(token: 'YOUR_TOKEN')
client.get('datasources/313699')
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "https://api.storyblok.com/v2/cdn/datasources/313699?token=ask9soUkv02QqbZgmZdeDAtt")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0)request.method = "GET"
let session = URLSession.sharedlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) }})
dataTask.resume()
{ "datasource": { "id": 313699, "name": "Background Color Options", "slug": "background-color-options", "dimensions": [] }, "cv": 1710350440}
Get in touch with the Storyblok community