Retrieve Current Space
Returns the space object for the space associated with the access token provided as a query parameter.
https://api.storyblok.com/v2/cdn/spaces/me
Query Parameters
-
token
required stringA preview or public access token configured in a space.
Response Properties
-
space
The Space ObjectThe complete space object
-
id
numberThe space ID
-
name
stringThe space name
-
domain
stringThe domain associated with the space (configured as the default environment for the Visual Editor).
-
version
stringThe timestamp of the latest changes in the space. This is useful for filling the
cv
parameter, for example, calling the story API endpoint. -
language_codes
string[]An array of language i18n codes, representing all languages that are configured in the space.
-
curl "https://api.storyblok.com/v2/cdn/spaces/me?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/spaces/me', {})
.then(response => {
console.log(response)
}).catch(error => {
console.log(error)
})
$client = new \Storyblok\Client('YOUR_STORYBLOK_SPACE_ACCESS_TOKEN');
$client->get('/v1/spaces/me')->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/spaces/me?token=ask9soUkv02QqbZgmZdeDAtt")
.asString();
var client = new RestClient("https://api.storyblok.com/v2/cdn/spaces/me?token=ask9soUkv02QqbZgmZdeDAtt");
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/spaces/me?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()
import requests
url = "https://api.storyblok.com/v2/cdn/spaces/me"
querystring = {"token":"ask9soUkv02QqbZgmZdeDAtt"}
payload = ""
headers = {}
response = requests.request("GET", url, data=payload, headers=headers, params=querystring)
print(response.text)
{
"space": {
"id": 123456,
"name": "Storyblok",
"domain": "https://www.storyblok.com/",
"version": 1544117388,
"language_codes": ["de", "es"]
}
}