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.
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.
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>"
await fetch("https://your-site.webinone.com/api/v2/admin/categories", { method: "GET", headers: { "Authorization": "Bearer <token>" } });
import requests requests.get( "https://your-site.webinone.com/api/v2/admin/categories", headers={"Authorization": "Bearer <token>"} )
$client = new GuzzleHttp\Client(); $response = $client->request('GET', 'https://your-site.webinone.com/api/v2/admin/categories', [ 'headers' => [ 'Authorization' => 'Bearer <token>' ] ]);
using var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://your-site.webinone.com/api/v2/admin/categories"); request.Headers.Add("Authorization", "Bearer <token>"); var response = await client.SendAsync(request);
Response · 200
{
"Items": [
{
"Id": 1,
"Name": "Example",
"FullName": "Example",
"NestingLevel": 0,
"Weight": 10,
"Children": []
}
],
"TotalItemsCount": 0
}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.
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}'
await fetch("https://your-site.webinone.com/api/v2/admin/categories", { method: "POST", headers: { "Authorization": "Bearer <token>", "Content-Type": "application/json" }, body: JSON.stringify({ "Name": "Example", "ParentId": 1 }) });
import requests requests.post( "https://your-site.webinone.com/api/v2/admin/categories", headers={"Authorization": "Bearer <token>"}, json={ "Name": "Example", "ParentId": 1 } )
$client = new GuzzleHttp\Client(); $response = $client->request('POST', 'https://your-site.webinone.com/api/v2/admin/categories', [ 'headers' => [ 'Authorization' => 'Bearer <token>', 'Content-Type' => 'application/json' ], 'json' => [ 'Name' => 'Example', 'ParentId' => 1 ] ]);
using var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "https://your-site.webinone.com/api/v2/admin/categories"); request.Headers.Add("Authorization", "Bearer <token>"); request.Content = new StringContent( "{\"Name\":\"Example\",\"ParentId\":1}", Encoding.UTF8, "application/json"); var response = await client.SendAsync(request);
Response · 200
{
"Id": 1,
"Name": "Example",
"FullName": "Example",
"NestingLevel": 0,
"Weight": 10,
"Children": [
{
"Id": 1,
"Name": "Example",
"FullName": "Example",
"NestingLevel": 0,
"Weight": 10,
"Children": []
}
]
}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.
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>"
await fetch("https://your-site.webinone.com/api/v2/admin/categories/1", { method: "GET", headers: { "Authorization": "Bearer <token>" } });
import requests requests.get( "https://your-site.webinone.com/api/v2/admin/categories/1", headers={"Authorization": "Bearer <token>"} )
$client = new GuzzleHttp\Client(); $response = $client->request('GET', 'https://your-site.webinone.com/api/v2/admin/categories/1', [ 'headers' => [ 'Authorization' => 'Bearer <token>' ] ]);
using var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://your-site.webinone.com/api/v2/admin/categories/1"); request.Headers.Add("Authorization", "Bearer <token>"); var response = await client.SendAsync(request);
Response · 200
{
"Id": 1,
"Name": "Example",
"FullName": "Example",
"NestingLevel": 0,
"Weight": 10,
"Children": [
{
"Id": 1,
"Name": "Example",
"FullName": "Example",
"NestingLevel": 0,
"Weight": 10,
"Children": []
}
]
}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.
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}'
await fetch("https://your-site.webinone.com/api/v2/admin/categories/1", { method: "PUT", headers: { "Authorization": "Bearer <token>", "Content-Type": "application/json" }, body: JSON.stringify({ "Name": "Example", "ParentId": 1 }) });
import requests requests.put( "https://your-site.webinone.com/api/v2/admin/categories/1", headers={"Authorization": "Bearer <token>"}, json={ "Name": "Example", "ParentId": 1 } )
$client = new GuzzleHttp\Client(); $response = $client->request('PUT', 'https://your-site.webinone.com/api/v2/admin/categories/1', [ 'headers' => [ 'Authorization' => 'Bearer <token>', 'Content-Type' => 'application/json' ], 'json' => [ 'Name' => 'Example', 'ParentId' => 1 ] ]);
using var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Put, "https://your-site.webinone.com/api/v2/admin/categories/1"); request.Headers.Add("Authorization", "Bearer <token>"); request.Content = new StringContent( "{\"Name\":\"Example\",\"ParentId\":1}", Encoding.UTF8, "application/json"); var response = await client.SendAsync(request);
Response · 200
{
"Id": 1,
"Name": "Example",
"FullName": "Example",
"NestingLevel": 0,
"Weight": 10,
"Children": [
{
"Id": 1,
"Name": "Example",
"FullName": "Example",
"NestingLevel": 0,
"Weight": 10,
"Children": []
}
]
}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>"
await fetch("https://your-site.webinone.com/api/v2/admin/categories/1", { method: "DELETE", headers: { "Authorization": "Bearer <token>" } });
import requests requests.delete( "https://your-site.webinone.com/api/v2/admin/categories/1", headers={"Authorization": "Bearer <token>"} )
$client = new GuzzleHttp\Client(); $response = $client->request('DELETE', 'https://your-site.webinone.com/api/v2/admin/categories/1', [ 'headers' => [ 'Authorization' => 'Bearer <token>' ] ]);
using var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Delete, "https://your-site.webinone.com/api/v2/admin/categories/1"); request.Headers.Add("Authorization", "Bearer <token>"); var response = await client.SendAsync(request);