Retrieving a list of categories

GET {{api-url}}/category/{{tenant}}/categories?showRoots=false&showUnpublished=false&pageNumber=1&pageSize=60&sort=localizedName:DESC

Retrieves a list of categories for a given tenant.


Required scopes

  • category.category_read_unpublished Note: Only required if the response should contain unpublished categories.

Request Params

KeyDatatypeRequiredDescription
showRootsbooleanIf set to true, only root categories (categories without parents) are retrieved.
Possible values:
  • true
  • false | | showUnpublished | boolean | | If set to true, not published categories are retrieved as well. Possible values:
  • true
  • false Note: To get unpublished categories you need to have category.category_read_unpublished scope. | | pageNumber | number | | Page number to be retrieved. The number of the first page is 1. Note: If the pageNumber parameter is passed, size of the pages must be specified in the pageSize parameter. | | pageSize | number | | Number of export files to be retrieved per page. | | sort | string | | List of properties used to sort the results, separated by commas. This list is validated against available fields. Sorting by deprecated field is forbidden. Possible values:
  • {fieldName}:ASC
  • {fieldName}:DESC
  • {fieldName}:ASC,{fieldName2}:DESC
  • {internationalizedFieldName.en}:ASC - contains localized field name and extension. Valid only if Accepted-language header contains this extension and it is supported by configuration of the tenant. If all language are accepted (Accept-language='*') then extension must exist in tenant configuration. No other sorting are allowed for this specific internationalized field.
  • {internationalizedFieldName}:ASC - contains only localized field name. Extension will be deducted based on Accept-language header. If all language are accepted (Accept-language='*') then extension is taken from tenant configuration and is equal to default language. In other case the language with highest priority is taken. No other sorting are allowed for this specific localized field. |

HEADERS

KeyDatatypeRequiredDescription
Accept-LanguagestringList of properties used to project and sort the results, separated by commas.
Possible values:
  • * - each internationalized field is returned as a map containing all available (specified in tenant configuration) translations.
  • en, en,de - each internationalized field is returned as a map containing translation specified by a header value. If translation is not supported by tenant configuration then exception is thrown. First language is the one with highest priority.
  • fr-CH, fr;q=0.9, en;q=0.8, de;q=0.7, *;q=0.5 - each internationalized field is returned as a map containing translation specified by a header value. If translation is not supported by tenant configuration then exception is thrown. | | X-Version | string | | (Required) 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]?$ | | Accept | string | | |

RESPONSES

status: OK

[{"id":"61234723","parentId":"44170435","localizedName":{"en":"Floor Care","de":"Bodenpflege"},"description":"Floor Care","localizedDescription":{"en":"Floor Care","de":"Bodenpflege"},"code":"Floor-Care","localizedSlug":{"en":"Floor-Care","de":"Bodenpflege"},"ecn":["AX6784","123078","SJUIOKM"],"validity":{"from":"2022-01-05 12:44:51.871Z","to":"2022-12-05 23:59:59.000Z"},"position":5,"published":true,"metadata":{"version":1,"createdAt":"2022-01-04 10:44:51.871Z","modifiedAt":"2022-01-05 12:44:51.456Z"},"mixins":{}},{"id":"917264581","parentId":"51170435","name":"Milk \u0026 Cheese","localizedName":{"de":"Milch \u0026 Käse","en":"Milk \u0026 Cheese"},"description":"Milk and Cheese products","localizedDescription":{"de":"Milch und Käse produkte","en":"Milk and Cheese products"},"code":"Milk-and-Cheese","localizedSlug":{"de":"Milch-und-Kase","en":"Milk-and-Cheese"},"ecn":["AX6784","123078","SJUIOKM"],"validity":{"from":"2022-01-05 12:44:51.871Z","to":"2022-12-05 23:59:59.000Z"},"position":5,"published":true,"metadata":{"version":1,"createdAt":"2022-01-04 10:44:51.871Z","modifiedAt":"2022-01-05 12:44:51.456Z"},"mixins":{}}]