Get Categories
getapi.bunnystudio.com/categories
This endpoint returns all the available categories on the API.
Requirements
Authentication
Scope
Request example
- Console
- JavaScript
- Python
- PHP - CURL
curl --request GET \
--url https://api.bunnystudio.com/categories \
--header "x-access-token: YOUR_TOKEN" \
const url = 'https://api.bunnystudio.com/categories';
const options = {
method: 'GET',
headers: {
'x-access-token': 'YOUR_TOKEN',
}
};
fetch(url, options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import requests
import json
api_url = "https://api.bunnystudio.com/categories"
headers = {
'x-access-token': 'YOUR_TOKEN',
}
response = requests.get(api_url, headers=headers)
print(response.text)
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.bunnystudio.com/categories',
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'x-access-token': 'YOUR_TOKEN',
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Response format
id
string
Category ID
Category ID
name
string
Name of the category
Name of the category
subCategories
array
Subcategories that component the category
Subcategories that component the category
Response example
[
{
"id": "voice_over",
"name": "voice",
"subCategories": [
{
"id": "voice_over",
"brandName": "Voice over",
"formats": ["mp3", "wav"],
}
]
}
]
Error responses
500 Not categories info
{
status: 500,
type: 'NOT_CATEGORIES_INFO',
message: 'There was an error getting all the categories available, please talk with our support team',
}
403 Forbidden
{
status: 403,
type: 'FORBIDDEN',
message: 'You do not have permission to do this action',
}