Using the Category Tree API

This API required Authentication

Create a category tree

POST /category-trees

Query Parameters

NameTypeDescription

environment*

string

tenant*

string

fhrValidation

String

True/false. Enforces specific validation to comply with the Fredhopper data model

Headers

NameTypeDescription

Authorization*

string

Bearer token

Request Body

NameTypeDescription

categoryTree*

object

Category Tree

{
    "version": 1
}

The root name can't be "0"

Category tree request example

> POST /category-trees
{
    "name": "catalog01",
    "localizedNames": [
        {
            "locale": "en_GB",
            "value": "Home"
        },
        {
            "locale": "de_DE",
            "value": "Startseite"
        }
    ],
    "tenant": "demo",
    "environment": "fas:live1",
    "children": [
        {
            "name": "dresses21",
            "localizedNames": [
                {
                    "locale": "en_GB",
                    "name": "Dresses"
                },
                {
                    "locale": "de_DE",
                    "name": "Kleider"
                }
            ]
        }
    ]
}

Update a category tree

PUT https://items.attraqt.io/category-trees/{name}

Path Parameters

NameTypeDescription

name*

string

Category tree root name

Query Parameters

NameTypeDescription

tenant*

String

environment*

String

fhrValidation

String

True/false. Enforces specific validation to comply with the Fredhopper data model

Headers

NameTypeDescription

Authorization*

string

Bearer token containing the following permission:

Request Body

NameTypeDescription

categoryTree*

object

{
    "version": 2    
}

List category trees

GET https://items.attraqt.io/category-trees

Query Parameters

NameTypeDescription

nameSearchPattern

string

tenant*

string

environment*

string

Headers

NameTypeDescription

Authorization*

string

Bearer token

{
    "categoryTrees": [
      {
        "tenant": "foo",
        "environment": "main",
        "version": 1,
        "name": "root",
        "children": [
          {
            "name": "child-1",
            "localizedNames": [
              {
                "name": "feuille",
                "locale": "fr"
              }
            ],
            "children": []
          }
        ],
        "localizedNames": [
          {
            "name": "racine",
            "locale": "fr"
          }
        ]
      }
    ]
  }

Get a category tree

GET https://items.attraqt.io/category-trees/{name}/{version}

Path Parameters

NameTypeDescription

version*

number

Version of the category tree

name*

string

Category tree root name

Query Parameters

NameTypeDescription

tenant*

String

environment*

String

Headers

NameTypeDescription

Authorization*

string

Bearer token containing the following permission:

 {
  "tenant": "foo",
  "environment": "main",
  "version": 1,
  "name": "root",
  "children": [
    {
      "name": "child-1",
      "localizedNames": [
        {
          "name": "feuille",
          "locale": "fr"
        }
      ],
      "children": []
    }
  ],
  "localizedNames": [
    {
      "name": "racine",
      "locale": "fr"
    }
  ]
}

Delete a category tree

DELETE https://items.attraqt.io/category-trees/{name}/{version}

Path Parameters

NameTypeDescription

version*

number

Version of the category tree

name*

string

Category tree root name

Query Parameters

NameTypeDescription

tenant*

String

environment*

String

Headers

NameTypeDescription

Authorization*

string

Bearer token containing the following permission:

{}

Api errors

Error categoryDescription

CATEGORY_TREE_NAME

Name is invalid

CATEGORY_TREE_LOCALE

Category tree contain a invalid locale or localized name

CATEGORY_TREE_LEAF

Category tree contain a invalid leaf or leaf name

CATEGORY_TREE_DELETION_USE

CategoryTree is currently used in a Catalog

CATEGORY_TREE_ALREADY_EXISTS

The category tree already exists, use update method

CATEGORY_TREE_NOT_FOUND

Impossible to update the category tree: category tree not exists

Last updated