Retrieve Multiple Datasources
Returns an array of all datasources (as datasource objects).
GET
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')let (data, _) = try await URLSession.shared.data(from: URL(string: "https://api.storyblok.com/v2/cdn/datasources?token=ask9soUkv02QqbZgmZdeDAtt")!)print(try JSONSerialization.jsonObject(with: data))val client = HttpClient { install(ContentNegotiation) { json() } install(DefaultRequest) { url { takeFrom("https://api.storyblok.com/v2/cdn/") parameters.append("token", "ask9soUkv02QqbZgmZdeDAtt") } }}
val response = client.get("datasources")
println(response.body<JsonElement>()){ "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}
Thanks! We received your feedback.
An error occurred. Please try again.
Was this page helpful?
This site uses reCAPTCHA and Google's Privacy Policy. Terms of Service apply.
Get in touch with the Storyblok community