Retrieve Multiple Datasources
Returns an array of all datasources (as datasource objects).
https://api.storyblok.com/v2/cdn/datasourcesQuery parameters
Section titled “Query parameters”- token required string
A preview or public access token configured in a space.
- page number
Default:
1(See Pagination) - per_page number
Default:
25, Max:1000(See Pagination)
Response properties
Section titled “Response properties”- datasourcesAn array of datasource objects
- cv number
Cached version Unix timestamp (see Cache Invalidation)
Examples
Section titled “Examples”curl "https://api.storyblok.com/v2/cdn/datasources?token=ask9soUkv02QqbZgmZdeDAtt"// Using the Universal JavaScript Client:// https://github.com/storyblok/storyblok-js-clientStoryblok.get('cdn/datasources', {}) .then(response => { console.log(response) }).catch(error => { console.log(error) })$client = new \Storyblok\Client('YOUR_STORYBLOK_SPACE_ACCESS_TOKEN');
$client->get('datasources')->getBody();HttpResponse<String> response = Unirest.get("https://api.storyblok.com/v2/cdn/datasources?token=ask9soUkv02QqbZgmZdeDAtt") .asString();var client = new RestClient("https://api.storyblok.com/v2/cdn/datasources?token=ask9soUkv02QqbZgmZdeDAtt");var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);import requests
url = "https://api.storyblok.com/v2/cdn/datasources"
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')import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "https://api.storyblok.com/v2/cdn/datasources?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(){ "datasources": [ { "id": 313699, "name": "Background Color Options", "slug": "background-color-options", "dimensions": [] }, { "id": 313701, "name": "Button Color Options", "slug": "button-color-options", "dimensions": [] }, { "id": 313702, "name": "Product Labels", "slug": "product-labels", "dimensions": [ { "id": 68105, "name": "German", "entry_value": "de", "datasource_id": 313702, "created_at": "2024-03-15T12:17:10.279Z", "updated_at": "2024-03-15T12:17:10.279Z" } ] } ], "cv": 1710350440}Get in touch with the Storyblok community