Get Category Attributes
getapi.bunnystudio.com/categories/{id}/attributes
This endpoint returns all the attributes of a category.
Requirements
Authentication
Scope
Path parameters
id
string
Bunny Studio ID of the category you want to get the attributes
Bunny Studio ID of the category you want to get the attributes
Request example
- Console
- JavaScript
- Python
- PHP - CURL
curl --request GET \
--url https://api.bunnystudio.com/categories/CATEGORY_ID \
--header "x-access-token: YOUR_TOKEN" \
const url = 'https://api.bunnystudio.com/categories/CATEGORY_ID';
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/CATEGORY_ID"
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/CATEGORY_ID',
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
ID of the attribute
ID of the attribute
name
string
Name of the attribute
Name of the attribute
defaultValue
string or number
Default value of the attribute
Default value of the attribute
Response example
[
{
"id": "language",
"name": "Language",
"defaultValue": "eng-us",
}
...
]
Error responses
500 Not categories attributes
{
status: 500,
type: 'NOT_CATEGORIES_ATTRIBUTES',
message: 'There was an error getting all the attributes of the category, please talk with our support team',
}
422 Category not authorized
{
status: 422,
type: 'CATEGORY_NOT_AUTHORIZED',
message: 'The category selected is not Authorized for API projects,
}
422 Id required
{
status: 422,
type: 'ID_REQUIRED',
message: 'The field "\id\" is required',
}
403 Forbidden
{
status: 403,
type: 'FORBIDDEN',
message: 'You do not have permission to do this action',
}