Retrieving resources assigned to a category
GET {{api-url}}/category/{{tenant}}/categories/{{categoryId}}/assignments?assignmentType=PRODUCT&showUnpublished=false&withSubcategories=false&pageNumber=1&pageSize=60&sort=name:desc
Retrieves resources (such as products) assigned to a specified category.
Required scopes
category.category_read_unpublished
Note: Only required if the category has not been published.
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
assignmentType | string | Resource type assigned to the category. | |
Possible values: |
PRODUCT
| |showUnpublished
| boolean | | If set totrue
, resources assigned to not published categories are retrieved as well. Possible values:true
false
Note: To get unpublished categories you need to havecategory.category_read_unpublished
scope. | |withSubcategories
| boolean | | If set totrue
, all descendants of the specified category will be deleted as well. If set tofalse
, direct subcategories of the specified category will become top-level categories. Relations between the subcategories and their descendants will be preserved. Possible values:true
false
Note: To delete a category you need to havecategory.category_delete
scope. | |pageNumber
| number | | Page number to be retrieved. The number of the first page is 1. Note: If thepageNumber
parameter is passed, size of the pages must be specified in thepageSize
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
Key | Datatype | Required | Description |
---|---|---|---|
Accept-Language | string | List 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 addX-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":"647b1108-e6fd-4139-b831-5ac5fded6d52","categoryId":"32225004","ref":{"id":"123439302","type":"product","localizedName":{"en":"Bread"}}},{"id":"46124ba108-e6fd-4139-b831-5ac5fded6d52","categoryId":"21825012","ref":{"id":"333172602","type":"product","localizedName":{"en":"Tea"}}}]