# Get Product Attributes

Every attribute of the Product 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/Products/attributes('{identifier}')`.
`attributeSetId` chooses the form the places are read from: that attribute set's (left out,
the form of the products that have none). It decides nothing else.
## 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 Product 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:
| Property | Compared with |
|  --- | --- |
| `identifier`, `title` (the declared title) | `eq`, `ne`, `in`, `contains`, `startswith`, `endswith` and a text |
| `attributeType`, `kind` | `eq`, `ne`, `in` and a value as the response writes it (`checklist`, `custom`) |
| `isLocalized`, `isFormReadonly`, `isRequired`, `isFormRequired`, `isEditable` | `eq`, `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).
## Example

```http
GET /Metadata/Products/attributes?attributeSetId=7&$filter=kind eq 'custom'&$top=20 HTTP/1.1
X-API-KEY: your-api-key-here
```

Endpoint: GET /Metadata/Products/attributes
Version: 2.0.0

## Description:

  - `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 Product 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: | Property | Compared with |
|  --- | --- |
| `identifier`, `title` (the declared title) | `eq`, `ne`, `in`, `contains`, `startswith`, `endswith` and a text |
| `attributeType`, `kind` | `eq`, `ne`, `in` and a value as the response writes it (`checklist`, `custom`) |
| `isLocalized`, `isFormReadonly`, `isRequired`, `isFormRequired`, `isEditable` | `eq`, `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).

  - `Example` ()
    ```http
GET /Metadata/Products/attributes?attributeSetId=7&$filter=kind eq 'custom'&$top=20 HTTP/1.1
X-API-KEY: your-api-key-here
```

## Query parameters:

  - `attributeSetId` (integer)
    The attribute set whose form the places are read from; left out, the form of the products that have none

  - `$filter` (string)
    OData `$filter` expression over the properties listed in the operation description

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

  - `$skip` (integer)
    OData `$skip` offset, 0 or greater (default 0)

## Header parameters:

  - `X-API-KEY` (string)
    Tenant's API key (required)

## Response 200:

  - `200` (unknown)
    OK

## Response 200 fields (application/json):

  - `@readLink` (string)

  - `@nextLink` (string)

  - `@deltaLink` (string)

  - `@context` (string)

  - `value` (any)

  - `@count` (integer)

## Response 400:

  - `400` (unknown)
    Bad Request

## Response 400 fields (application/json):

  - `validationFailures` (object)

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 401 fields (application/json):

  - `message` (string)

  - `request_id` (string)

## Response 403:

  - `403` (unknown)
    Forbidden

## Response 403 fields (application/json):

  - `message` (string)

  - `request_id` (string)

## Response 409:

  - `409` (unknown)
    Conflict

## Response 409 fields (application/json):

  - `error` (string)

## Response 500:

  - `500` (unknown)
    Internal Server Error

## Response 500 fields (application/json):

  - `error` (string)

  - `details` (any)

## Response 200 examples:

  - `Two attributes, placed as the form of attribute set 7 draws them ($filter=identifier in ('prod_ref','prod_material')&attributeSetId=7)` (unknown)

## Response 400 examples:

  - `A $filter that cannot be read` (unknown)

  - `A $filter on a property that cannot be filtered on` (unknown)

  - `A page larger than 100 attributes` (unknown)

  - `An attribute set the tenant does not have` (unknown)

  - `An attributeSetId that is not a number` (unknown)

## Response 409 examples:

  - `The form lays an attribute out more than once` (unknown)

