.. _ISO 4217: http://en.wikipedia.org/wiki/ISO_4217 .. _ISO 8601: http://en.wikipedia.org/wiki/ISO_8601 .. index:: Category, Categories .. _categories: Categories ========== Categories for the basic taxonomy in which advertisements on Marktplaats are placed. They represent a context for the advertisements and allow for structure. The Categories resource makes the Marktplaats categories structure available to the API user. There are L1 and L2 categories. L1 categories group several L2 categories. Advertisements can only be placed in L2 categories. The category structure is read-only. .. _category-fields: Fields ------ Each category has a unique identifier by which it can be retrieved and a set of fields which are listed below: .. apifields:: .. apifield:: :name: categoryId :type: int :constraints: positive :required: true :description: Unique reference to a Marktplaats category. .. apifield:: :name: name :type: string :constraints: max. 70 characters :required: true :description: The descriptive name of the category. *Deprecated*: Use labels instead. .. apifield:: :name: labels :type: object :constraints: -- :required: true :description: The localized descriptive names of the category, keyed by locale. .. apifield:: :name: status :type: string :constraints: either ``open`` or ``closed``, where ``open`` is the normal state for a category. :required: true :description: When ``open``, it is possible to place new advertisements in this category. When status is ``closed``, it is not possible to place new advertisements in this category and an error will be returned when tried. Relations --------- .. relations:: .. relation:: :name: mp:category-attributes :availability: Category is a L2 category. .. relation:: :name: mp:category-fees :availability: Category is a L2 category. .. relation:: :name: up :availability: Category is a L1 category. .. relation:: :name: mp:category :embedded: yes :cardinality: 0..N :availability: If there are child categories Reference --------- .. endpoint:: GET /v1/categories This URL returns all categories. .. endpoint:: GET /v1/categories/{categoryId} This URL returns a L1 category, and embeds its children. No advertisements can be placed in this category. .. endpoint:: GET /v1/categories/{l1CategoryId}/{l2CategoryId} This URL returns a L2 category. You can place advertisements in this category. .. endpoint:: GET /v1/categories?categoryId={categoryId} This URL returns a L1 or L2 category, and embeds its children if present. Errors ------ .. errors:: .. error:: :http: 404 :code: category-not-found :description: The category does not exist. Example ------- .. include:: examples/get-category-example.rst