Search asset categories
Filter on available file categories by multiple criteria
Filter structure and format is described under Resources section in this guide
Current version of the API supports the following set of fields
| Field | Description |
|---|---|
| id | Category id is always returned by default |
| name | Category friendly name |
| path | Category full path |
| parents_ids | Array of ordered parent categories |
| n_children | Number of subcategories in the current category |
| order | Position of current category in parent category |
Restrictions
- Search requests
-
Search filters MUST include all necessary columns (except ID which is returned by default). If an attribute is not explicitly requested it won’t be returned by the API. Available attributes can be obtained by means of the available https://pim.plytix.com/api/v1/filters/ endpoint. “key” value is what MUST be used in requests. Requesting non-existing attributes will return a 422 error code You are allowed to sort by columns not included in “attributes” field, however this attribute won’t be returned
-
Search filters will return a 422 error code if any of the following conditions is met: a) Field does not exist b) Operator is not allowed for the given field (available operators and fields can be obtained using /filters/{item} endpoint) c) Value has no meaning for the given operator. The arity of available operators can be found in API documentation
-
Pagination: the number of items that can be requested (pagination.page_size) is limited to a maximum 100 items. A 422 code will be returned from API if this limit is exceeded. If pagination is omitted 25 items of the first page will be returned
-
Authorization
bearerAuth Obtain a token via POST /auth/api/get-token (15 minute lifetime), then send it as Authorization: Bearer <token>.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST 'https://example.com/api/v1/categories/file/search' \ -H 'Content-Type: application/json' \ --data-raw '{ "attributes": [ "name", "n_children" ], "filters": [ [ { "field": "parent_id", "operator": "!exists" } ] ], "pagination": { "page_size": 25, "page": 1, "order": "order" }}'{ "data": [ { "id": "5ceea1df264792045ec5e8ef", "n_children": 1, "name": "Packshots" }, { "id": "5ceea1eb264792045cd5a88d", "n_children": 0, "name": "Specificationss" }, { "id": "5ceea1f7264792045d16e986", "n_children": 0, "name": "Marketing Material" } ], "pagination": { "count": 3, "order": "order", "page": 1, "page_size": 25, "total_count": 4 }}