Retrieve Multiple Datasources
Returns an array of all datasources (as datasource objects) contained in a Storyblok space.
https://api.storyblok.com/v2/cdn/datasources
This endpoint is paginated by default, including a maximum of 1000 datasources in the response. Learn more under Pagination.
Query Parameters
-
token
required stringA preview or public access token configured in a space.
-
page
numberNumeric. default: 1. Read more at Pagination
-
per_page
numberDefault:
25
. Max:1000
. Learn more under Pagination.
Response Properties
-
datasources
The Datasource Object[]An array of datasource objects.
-
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
)
-
-
curl "https://api.storyblok.com/v2/cdn/datasources?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', {})
.then(response => {
console.log(response)
}).catch(error => {
console.log(error)
})
$client = new \Storyblok\Client('YOUR_STORYBLOK_SPACE_ACCESS_TOKEN');
$client->get('/datasources')->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?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);
This is swift code
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)
{
"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"
}
]
}
]
}