Retrieve Multiple Tags
Returns an array of tag objects defined in a space.
https://api.storyblok.com/v2/cdn/tags/
Query Parameters
-
token
required stringA preview or public access token configured in a space.
-
starts_with
stringFilter by
full_slug
. It can be used to retrieve all tags used in a specific folder. For example:starts_with=article
-
version
stringDefault:
published
. Possible values:draft
,published
Response Properties
-
tags
The Tag Object[]An array of tag objects
-
name
stringThe complete name provided for the tag
-
taggings_count
numberHow many times this tag has been assigned to a story
-
Request
curl "https://api.storyblok.com/v2/cdn/tags?starts_with=articles/&token=ask9soUkv02QqbZgmZdeDAtt" \
-X GET \
-H "Accept: application/json" \
-H "Content-Type: application/json"
Request
// Using the Universal JavaScript Client:
// https://github.com/storyblok/storyblok-js-client
Storyblok.get('cdn/tags', {
"starts_with": "articles/"
})
.then(response => {
console.log(response)
}).catch(error => {
console.log(error)
})
Request
$client = new \Storyblok\Client('YOUR_STORYBLOK_SPACE_ACCESS_TOKEN');
$client->getTags('/tags', [
"starts_with" => "articles/"
])->getBody();
Request
require 'storyblok'
client = Storyblok::Client.new(oauth_token: 'YOUR_OAUTH_TOKEN')
client.tags({:params => {
"starts_with" => "articles/"
}})
Request
HttpResponse<String> response = Unirest.get("https://api.storyblok.com/v2/cdn/tags?starts_with=articles/&token=ask9soUkv02QqbZgmZdeDAtt")
.asString();
Request
var client = new RestClient("https://api.storyblok.com/v2/cdn/tags?starts_with=articles/&token=ask9soUkv02QqbZgmZdeDAtt");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
Request
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "https://api.storyblok.com/v2/cdn/tags?starts_with=articles/&token=ask9soUkv02QqbZgmZdeDAtt")! 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()
Request
import requests
url = "https://api.storyblok.com/v2/cdn/tags"
querystring = {"starts_with":"articles/","token":"ask9soUkv02QqbZgmZdeDAtt"}
payload = ""
headers = {}
response = requests.request("GET", url, data=payload, headers=headers, params=querystring)
print(response.text)
Response
{
"tags": [
{
"name": "Editor's Choice",
"taggings_count": 11
},
{
"name": "Featured",
"taggings_count": 7
}
]
}