Open API v2 / CMS & Content / Categories

Categories

Every request needs a bearer token: Authorization: Bearer <token>. Base URL https://your-site.webinone.com. New to field types? See the type reference.

GET/api/v2/admin/categories#

Retrieves a list of categories by using a "where" filtering

Parameters
Wherestring · query
JSON filter expression. Combine operators ($eq, $contains, $gt, $in, …) with $and / $or.
Order_Bystring · query
Sort field. Prefix with - for descending; comma-separate for tie-breakers.
Semantic_Querystring · query
Natural-language search, ranked by relevance.
Min_Scorenumber · query
Lowest relevance score to include when using Semantic_Query.
Offsetinteger · query
Number of items to skip before returning results. Defaults to 0.
Limitinteger · query
Maximum number of items to return. Defaults to 100.
Response
Idinteger
Unique identifier. The technical ID of the category in the database. Used as ParentId for creating subcategories. Read-only.
Namestring · nullable
Public category name that is displayed in the menu.
FullNamestring · nullable
Full category name that may include the parent element name and subcategory. Read-only.
NestingLevelinteger
Nesting level. Defines the depth of the category in the tree. 1 — root category. 2 and above — subcategories of the corresponding level. Read-only.
Weightinteger
Weight (priority). Used for manual sorting. The higher or lower the number (depending on the logic), the higher the category is displayed in the list. For the default category — 246 for the default subcategory — 14.
Childrenarray of objects
Array of subcategories. Contains a list of objects of the same type that are children of this category. Allows building a tree-like structure in a single request.
curl "https://your-site.webinone.com/api/v2/admin/categories" \
  -H "Authorization: Bearer <token>"
Response · 200
{
  "Items": [
    {
      "Id": 1,
      "Name": "Example",
      "FullName": "Example",
      "NestingLevel": 0,
      "Weight": 10,
      "Children": []
    }
  ],
  "TotalItemsCount": 0
}
POST/api/v2/admin/categories#

Creates a new category

Body parameters
Namestringrequired
Category/subcategory name, understandable to a human, that is displayed to the user. Use a unique name for creation/editing.
ParentIdinteger
Parent element identifier. Use -1 to create a main (root) category. Use the ID of an existing category to create a subcategory.
Response
Idinteger
Unique identifier. The technical ID of the category in the database. Used as ParentId for creating subcategories. Read-only.
Namestring · nullable
Public category name that is displayed in the menu.
FullNamestring · nullable
Full category name that may include the parent element name and subcategory. Read-only.
NestingLevelinteger
Nesting level. Defines the depth of the category in the tree. 1 — root category. 2 and above — subcategories of the corresponding level. Read-only.
Weightinteger
Weight (priority). Used for manual sorting. The higher or lower the number (depending on the logic), the higher the category is displayed in the list. For the default category — 246 for the default subcategory — 14.
Childrenarray of objects
Array of subcategories. Contains a list of objects of the same type that are children of this category. Allows building a tree-like structure in a single request.
curl -X POST "https://your-site.webinone.com/api/v2/admin/categories" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"Name":"Example","ParentId":1}'
Response · 200
{
  "Id": 1,
  "Name": "Example",
  "FullName": "Example",
  "NestingLevel": 0,
  "Weight": 10,
  "Children": [
    {
      "Id": 1,
      "Name": "Example",
      "FullName": "Example",
      "NestingLevel": 0,
      "Weight": 10,
      "Children": []
    }
  ]
}
GET/api/v2/admin/categories/{id}#

Retrieves a single category

Parameters
idinteger · pathrequired
Category id.
Response
Idinteger
Unique identifier. The technical ID of the category in the database. Used as ParentId for creating subcategories. Read-only.
Namestring · nullable
Public category name that is displayed in the menu.
FullNamestring · nullable
Full category name that may include the parent element name and subcategory. Read-only.
NestingLevelinteger
Nesting level. Defines the depth of the category in the tree. 1 — root category. 2 and above — subcategories of the corresponding level. Read-only.
Weightinteger
Weight (priority). Used for manual sorting. The higher or lower the number (depending on the logic), the higher the category is displayed in the list. For the default category — 246 for the default subcategory — 14.
Childrenarray of objects
Array of subcategories. Contains a list of objects of the same type that are children of this category. Allows building a tree-like structure in a single request.
curl "https://your-site.webinone.com/api/v2/admin/categories/1" \
  -H "Authorization: Bearer <token>"
Response · 200
{
  "Id": 1,
  "Name": "Example",
  "FullName": "Example",
  "NestingLevel": 0,
  "Weight": 10,
  "Children": [
    {
      "Id": 1,
      "Name": "Example",
      "FullName": "Example",
      "NestingLevel": 0,
      "Weight": 10,
      "Children": []
    }
  ]
}
PUT/api/v2/admin/categories/{id}#

Updates an existing category

Parameters
idinteger · pathrequired
Category id.
Body parameters
Namestringrequired
Category/subcategory name, understandable to a human, that is displayed to the user. Use a unique name for creation/editing.
ParentIdinteger
Parent element identifier. Use -1 to create a main (root) category. Use the ID of an existing category to create a subcategory.
Response
Idinteger
Unique identifier. The technical ID of the category in the database. Used as ParentId for creating subcategories. Read-only.
Namestring · nullable
Public category name that is displayed in the menu.
FullNamestring · nullable
Full category name that may include the parent element name and subcategory. Read-only.
NestingLevelinteger
Nesting level. Defines the depth of the category in the tree. 1 — root category. 2 and above — subcategories of the corresponding level. Read-only.
Weightinteger
Weight (priority). Used for manual sorting. The higher or lower the number (depending on the logic), the higher the category is displayed in the list. For the default category — 246 for the default subcategory — 14.
Childrenarray of objects
Array of subcategories. Contains a list of objects of the same type that are children of this category. Allows building a tree-like structure in a single request.
curl -X PUT "https://your-site.webinone.com/api/v2/admin/categories/1" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"Name":"Example","ParentId":1}'
Response · 200
{
  "Id": 1,
  "Name": "Example",
  "FullName": "Example",
  "NestingLevel": 0,
  "Weight": 10,
  "Children": [
    {
      "Id": 1,
      "Name": "Example",
      "FullName": "Example",
      "NestingLevel": 0,
      "Weight": 10,
      "Children": []
    }
  ]
}
DELETE/api/v2/admin/categories/{id}#

Deletes an existing category

Parameters
idinteger · pathrequired
Category id.
curl -X DELETE "https://your-site.webinone.com/api/v2/admin/categories/1" \
  -H "Authorization: Bearer <token>"