Category Tree Resources
Read Category Trees
Your Emporix tenant's name.
Note: The tenant should always be written in lowercase.
^[a-z][a-z0-9]{2,15}$
GET /category/{tenant}/categories/categoryTree HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{
"id": "38118",
"name": "ProductRoot",
"code": "productroot",
"description": "{\"type\":\"ProductRoot\"}",
"position": 55555,
"published": true,
"subcategories": [
{
"id": "38119",
"parentId": "38118",
"name": "Fruits & Vegetables",
"code": "fruits-&-vegetables",
"description": "Fresh and tasty fruits and vegetables.",
"position": 0,
"published": true,
"subcategories": [
{
"id": "38120",
"parentId": "38119",
"name": "Fruit",
"code": "fruit",
"position": 0,
"published": true
}
]
}
]
}
Your Emporix tenant's name.
Note: The tenant should always be written in lowercase.
saasdev2
If set to true
, not published categories are retrieved as well.
Possible values:
true
false
Note: To get unpublished categories you need to havecategory.category_read_unpublished
scope.
false
Example: true
To use this endpoint you have to add X-Version
header with proper value to your request.
Note: The header value has to match following regular expression: ^v[1-9][0-9]?$
v2
Pattern: ^v[1-9][0-9]?$
GET /category/{tenant}/category-trees HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
X-Version: v2
Accept: */*
[
{
"id": "46124ba108-e6fd-4139-b831-5ac5fded6d52",
"localizedName": {
"en": "ProductRoot"
},
"code": "productroot",
"localizedSlug": {
"en": "productroot"
},
"localizedDescription": {
"en": "ProductRoot"
},
"position": 55555,
"published": true,
"subcategories": [
{
"id": "12a24ba108-e6fd-4139-b831-5ac5fded6d34",
"parentId": "46124ba108-e6fd-4139-b831-5ac5fded6d52",
"localizedName": {
"en": "Fruits & Vegetables"
},
"code": "fruits-&-vegetables",
"localizedSlug": {
"en": "fruits-&-vegetables"
},
"localizedDescription": {
"en": "Fresh and tasty fruits and vegetables."
},
"position": 0,
"published": true,
"subcategories": [
{
"id": "12a24ba108-e6fd-4139-b831-5ac5fded6d34",
"parentId": "34a24ba108-e6fd-4139-b831-5ac5fded6dae",
"localizedName": {
"en": "Fruit"
},
"code": "fruit",
"localizedSlug": {
"en": "fruit"
},
"position": 0,
"published": true
}
]
}
]
}
]
Retrieves a category tree for a root category with a given id.
Note: You can retrieve a category tree only for a root category. It is not possible to get a category tree for a category that lies lower in the hierarchy.
Required scopes
category.category_read_unpublished
Note: Only required if the response should contain unpublished categories.
Your Emporix tenant's name.
Note: The tenant should always be written in lowercase.
saasdev2
A unique identifier of a root category, generated when the category is created.
12a24ba108-e6fd-4139-b831-5ac5fded6d34
If set to true
, not published categories are retrieved as well.
Possible values:
true
false
Note: To get unpublished categories you need to havecategory.category_read_unpublished
scope.
false
Example: true
To use this endpoint you have to add X-Version
header with proper value to your request.
Note: The header value has to match following regular expression: ^v[1-9][0-9]?$
v2
Pattern: ^v[1-9][0-9]?$
GET /category/{tenant}/category-trees/{categoryId} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
X-Version: v2
Accept: */*
{
"id": "46124ba108-e6fd-4139-b831-5ac5fded6d52",
"localizedName": {
"en": "ProductRoot"
},
"code": "productroot",
"localizedSlug": {
"en": "productroot"
},
"localizedDescription": {
"en": "ProductRoot"
},
"position": 55555,
"published": true,
"subcategories": [
{
"id": "12a24ba108-e6fd-4139-b831-5ac5fded6d34",
"parentId": "46124ba108-e6fd-4139-b831-5ac5fded6d52",
"localizedName": {
"en": "Fruits & Vegetables"
},
"code": "fruits-&-vegetables",
"localizedSlug": {
"en": "fruits-&-vegetables"
},
"localizedDescription": {
"en": "Fresh and tasty fruits and vegetables."
},
"position": 0,
"published": true,
"subcategories": [
{
"id": "12a24ba108-e6fd-4139-b831-5ac5fded6d34",
"parentId": "34a24ba108-e6fd-4139-b831-5ac5fded6dae",
"localizedName": {
"en": "Fruit"
},
"code": "fruit",
"localizedSlug": {
"en": "fruit"
},
"position": 0,
"published": true
}
]
}
]
}
Was this helpful?