Skip to content

Get Category Attributes
Beta

Request

Every attribute of the Category definition, the tenant's own and the platform's, a page at a time and in the order the definition declares them, each summarised: what a screen listing the attributes shows. To read one attribute whole, follow it to Metadata/Categories/attributes('{identifier}').

The places are read from the category form. Categories have a single form: an attributeSetId, which chooses a Product's or a Variant's, is refused.

Response

200 OK — the page under value, each attribute in the members the get attribute route reports it in, less every list its type carries: what every attribute has, with its titleTranslations; a checklist's isSingleSelect (not its options); a related items attribute's targetEntityIdentifier, itemLimit and separator (not pickerDisplayAttributes nor labelAttributes); the linkingPattern of an image (not its sizeVariants nor fileNameAttributes) or a file; a table's hasStartingTable (not its templates). Then placement and editability, as the get attribute route reports them. @count is how many attributes Category declares — those the filter keeps, when there is one — and @nextLink addresses the next page while there is one.

409 Conflict — the form lays an attribute out more than once, so where it is drawn cannot be told and no page is answered. Laying it out once lets the attributes be read.

$filter

Keeps the attributes that match, in the same order; the pages and @count are those of the attributes kept. The properties, named as the response writes them:

PropertyCompared with
identifier, title (the declared title)eq, ne, in, contains, startswith, endswith and a text
attributeType, kindeq, ne, in and a value as the response writes it (checklist, custom)
isLocalized, isFormReadonly, isRequired, isFormRequired, isEditableeq, ne and true or false

Texts and values are compared ignoring case. Comparisons combine with and, or, not and parentheses.

$top and $skip

$top is the page size, from 1 to 100 (default 100). $skip is how many attributes come before the page, 0 or greater (default 0).

$orderby and $search

Not supported, and refused with a 400 rather than ignored: the attributes always come in the order the entity declares them, and $filter chooses which are listed.

Example

GET /Metadata/Categories/attributes?$filter=kind eq 'custom' and attributeType in ('checklist','table')&$top=20 HTTP/1.1
X-API-KEY: your-api-key-here
Query
$filterstring

OData $filter expression over the properties listed in the operation description

$topinteger, (int32), [ 1 .. 100 ]

OData $top page size, from 1 to 100 (default 100)

$skipinteger, (int32), >= 0

OData $skip offset, 0 or greater (default 0)

Headers
X-API-KEYstring

Tenant's API key (required)

curl -i -X GET \
  'https://api2.saleslayer.com/catalog/Metadata/Categories/attributes?%24filter=string&%24top=1&%24skip=0' \
  -H 'X-API-KEY: string'

Responses

OK

Bodyapplication/json
@contextstring or null
valueany or null
@countinteger or null, (int64)
Response
{ "value": [ { … }, { … } ], "@count": 12, "@readLink": "https://api2.saleslayer.com/catalog/Metadata/Categories/attributes", "@nextLink": "https://api2.saleslayer.com/catalog/Metadata/Categories/attributes?$top=2&$skip=2" }