Retrieve Multiple Tags
Returns an array of tag objects used in a space. Only tags assigned to at least one story are included.
https://api.storyblok.com/v2/cdn/tags
Query parameters
Section titled “Query parameters”- token required string
A preview or public access token
- starts_with string
Filter by story
full_slug
to only return tags assigned to stories with afull_slug
starting with the given value - version draft | published
Default:
published
Response properties
Section titled “Response properties”- tags array
An array of tag objects
Examples
Section titled “Examples”curl "https://api.storyblok.com/v2/cdn/tags?starts_with=articles%2F&token=ask9soUkv02QqbZgmZdeDAtt"
// Using the Universal JavaScript Client:// https://github.com/storyblok/storyblok-js-clientStoryblok.get('cdn/tags', { "starts_with": "articles/"}) .then(response => { console.log(response) }).catch(error => { console.log(error) })
$client = new \Storyblok\Client('YOUR_STORYBLOK_SPACE_ACCESS_TOKEN');
$client->getTags([ "starts_with" => "articles/"])->getBody();
HttpResponse<String> response = Unirest.get("https://api.storyblok.com/v2/cdn/tags?starts_with=articles%2F&token=ask9soUkv02QqbZgmZdeDAtt") .asString();
var client = new RestClient("https://api.storyblok.com/v2/cdn/tags?starts_with=articles%2F&token=ask9soUkv02QqbZgmZdeDAtt");var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(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)
require 'storyblok'client = Storyblok::Client.new(token: 'YOUR_TOKEN')
client.tags({:params => { "starts_with" => "articles/"}})
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "https://api.storyblok.com/v2/cdn/tags?starts_with=articles%2F&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()
{ "tags": [ { "name": "Editor's Choice", "taggings_count": 11 }, { "name": "Featured", "taggings_count": 7 } ]}
Get in touch with the Storyblok community