Retrieve Multiple Links
Returns the links object containing all links of one space including the draft
and published
links. To get only published
links, use the version=published
. This endpoint always includes folders, regardless of their draft or published status, as it only checks the version of stories, not folders.
https://api.storyblok.com/v2/cdn/links
This endpoint is paginated by default. To receive more than the default of 25 link entries, the per_page
parameter can be set to a maximum of 1000. Please refer to Pagination for further information.
For spaces created before May 9th, 2023, the links endpoint is not paginated by default. To enable pagination, set the paginated
parameter to 1
.
Query Parameters
-
token
required stringA preview or public access token configured in a space.
-
starts_with
stringFilter by
full_slug
. Can be used to retrieve all links from a specific folder. Examples:starts_with=de/beitraege
,starts_with=en/posts
-
version
stringDefault:
published
. Possible values:draft
,published
-
cv
numberUsed to access a particular cached version of a published story by providing a Unix timestamp. Further information is found under Cache Invalidation.
-
with_parent
numberFilters links by
parent_id
. Can be set to0
to return entries not located in a folder. In contrast, specifying a folder'sid
returns only entries located in this particular folder. -
include_dates
numberDefault:
0
. If set to1
, the following fields are included in the response:published_at
,created_at
,updated_at
. -
page
numberDefault:
1
. Learn more under Pagination. -
per_page
numberDefault:
25
. Max:1000
. Learn more under Pagination. -
paginated
numberFor spaces created before May 9th, 2023, the links endpoint is not paginated by default. Setting this parameter to
1
enables pagination. This parameter does not impact spaces created after May 9th, 2023, i.e., pagination cannot be disabled for these spaces.
Response Properties
-
links
The Link ObjectAn object of link objects, with each key constituting a link
uuid
.-
id
numberThe numeric ID
-
uuid
stringGenerated UUID string
-
slug
stringThe full slug of the story or folder
-
path
stringValue of the real path defined in the story's entry configuration
-
real_path
stringEither the full slug of the story or folder with a leading
/
, or, if existent, the value of the real path defined in the story's entry configuration with a leading/
-
name
stringThe complete name of the story or folder
-
published
booleantrue
if a story has been published at least once (even if it is currently in draft) -
parent_id
numberID of the parent folder
-
is_folder
booleantrue
if the instance constitutes a folder -
is_startpage
booleantrue
if the story is defined as root for the folder -
position
numberNumeric representation of the story's position in the folder
-
published_at
stringLatest publishing date (Format:
yyyy-MM-dd'T'HH:mm:ssZ
); only included ifinclude_dates=1
is specified -
created_at
stringCreation date (Format:
yyyy-MM-dd'T'HH:mm:ssZ
); only included ifinclude_dates=1
is specified -
updated_at
stringLatest update date (Format:
yyyy-MM-dd'T'HH:mm:ssZ
); only included ifinclude_dates=1
is specified -
alternates
objectAn array containing objects that provide basic data of the different language versions of a story using Storyblok's Field Level Translation. Important: not to be confused with actual story alternates.
-
path
stringTranslated slug of the story (if the app Translatable Slugs is installed; otherwise, it matches the slug of the parent object)
-
name
stringTranslated name of the story (if the app Translatable Slugs is installed)
-
lang
stringLanguage code of this story variant
-
published
booleantrue
if a story has been published at least once (even if it is currently in draft) -
translated_slug
stringTranslated slug of the story (if the app Translatable Slugs is installed; otherwise, it matches the slug of the parent object)
-
-
curl "https://api.storyblok.com/v2/cdn/links?token=krcV6QGxWORpYLUWt12xKQtt&version=published&starts_with=articles" \
-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/links', {
"version": "published",
"starts_with": "articles"
})
.then(response => {
console.log(response)
}).catch(error => {
console.log(error)
})
$client = new \Storyblok\Client('YOUR_STORYBLOK_SPACE_ACCESS_TOKEN');
$client->getLinks('/links', [
"version" => "published",
"starts_with" => "articles"
])->getBody();
require 'storyblok'
client = Storyblok::Client.new(oauth_token: 'YOUR_OAUTH_TOKEN')
client.links({:params => {
"version" => "published",
"starts_with" => "articles"
}})
HttpResponse<String> response = Unirest.get("https://api.storyblok.com/v2/cdn/links?token=krcV6QGxWORpYLUWt12xKQtt&version=published&starts_with=articles")
.asString();
var client = new RestClient("https://api.storyblok.com/v2/cdn/links?token=krcV6QGxWORpYLUWt12xKQtt&version=published&starts_with=articles");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "https://api.storyblok.com/v2/cdn/links?token=krcV6QGxWORpYLUWt12xKQtt&version=published&starts_with=articles")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0)
request.method = "GET"
let session = URLSession.shared
let 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()
import requests
url = "https://api.storyblok.com/v2/cdn/links"
querystring = {"token":"krcV6QGxWORpYLUWt12xKQtt","version":"published","starts_with":"articles"}
payload = ""
headers = {}
response = requests.request("GET", url, data=payload, headers=headers, params=querystring)
print(response.text)
{
"links": {
"47ba3d20-3962-4017-b158-b268a976b683": {
"id": 444991588,
"uuid": "47ba3d20-3962-4017-b158-b268a976b683",
"slug": "articles",
"path": null,
"parent_id": null,
"name": "Articles",
"is_folder": true,
"published": false,
"is_startpage": false,
"position": 0,
"real_path": "/articles"
},
"660452d2-1a68-4493-b5b6-2f03b6fa722b": {
"id": 444996765,
"uuid": "660452d2-1a68-4493-b5b6-2f03b6fa722b",
"slug": "articles/earths-symphony-navigating-wonders-challenges-blue-oasis",
"path": null,
"parent_id": 444991588,
"name": "Earth's Symphony: Navigating the Wonders and Challenges of Our Blue Oasis",
"is_folder": false,
"published": true,
"is_startpage": false,
"position": 0,
"real_path": "/articles/earths-symphony-navigating-wonders-challenges-blue-oasis"
},
"a2c57c06-2c5c-4819-acb7-0d9c047d16e9": {
"id": 445002665,
"uuid": "a2c57c06-2c5c-4819-acb7-0d9c047d16e9",
"slug": "articles/mars-unveiled-exploring-mysteries-marvels-red-frontier",
"path": null,
"parent_id": 444991588,
"name": "Mars Unveiled: Exploring the Mysteries and Marvels of the Red Frontier",
"is_folder": false,
"published": true,
"is_startpage": false,
"position": 0,
"real_path": "/articles/mars-unveiled-exploring-mysteries-marvels-red-frontier"
}
}
}