younifyd
Menu

Get Category By Code

Get a category

GET/api/rest/v1/categories/{code}

Use it in a workflow

  1. Add a step and choose the Akeneo connector.
  2. Pick the Get Category By Code action (under Category).
  3. Fill in the fields below, then reference the result from later steps as {{getCategoryByCode.response.data}}.

Request

Path parameters

codestringrequired

This path parameter is used to specify the unique identifier of the entity you want to retrieve or manipulate. It is essential for identifying the specific entity in the API requests. Ensure that the code is correctly formatted and corresponds to an existing entity in the system.

Query parameters

with_positionboolean

Return information about the category's position within its category tree. When set to `true`, the response will include the position of the category in its level, which can be useful for understanding the hierarchy and order of categories. If set to `false`, the response will not include this information, which can improve performance.

Default false

with_enriched_attributesboolean

Return the attribute values of the category. When set to `true`, the response will include the values of all attributes associated with the category. This is useful for retrieving detailed information about the category's attributes, such as their values and configurations. If set to `false`, the response will not include attribute values, which can improve performance

Default false

Response

Returns 200 with an object. Read it in later steps with {{getCategoryByCode.response.data.<field>}}.

codestring

Category code

parentstring | null

Category code of the parent's category

updatedstring (date-time)

Date of the last update

positioninteger

Position of the category in its level, start from 1 (only available when query parameter `with_position` is set to `true`)

labelsobject

Default {}

channel_requirementsarray<string>

List of Channel codes on which the category is required for products completeness. Only category trees can be required, not child categories.

Default []

valuesobject

Attribute values

validationsobject

Category validations

Default {}

max_categories_per_productinteger

Maximum number of categories per product

only_leavesboolean

Categorization restricted to the lowest level

is_mandatoryboolean

Category is mandatory for every product

json
{
  "code": "winter_collection",
  "parent": "root_category",
  "updated": "2021-05-21T11:32:00+02:00",
  "position": 1,
  "labels": {
    "en_US": "Winter collection",
    "fr_FR": "Collection hiver",
    "de_DE": "Winter-Kollektion"
  },
  "channel_requirements": [
    "ecommerce",
    "mobile"
  ],
  "values": {
    "description|96b88bf4-c2b7-4b64-a1f9-5d4876c02c26|ecommerce|en_US": {
      "data": "<p>Winter collection description</p>",
      "type": "textarea",
      "channel": "ecommerce",
      "locale": "en_US",
      "attribute_code": "description|96b88bf4-c2b7-4b64-a1f9-5d4876c02c26"
    },
    "image_1|871b8686-79b5-415c-9c6f-a38f8732dfb7|ecommerce|en_US": {
      "data": {
        "size": 1401359,
        "extension": "jpg",
        "file_path": "2/d/c/7/2dc791671d726e7438219d5dc7fd51a53d6bf2bb_IMG_7860.jpg",
        "mime_type": "image/jpeg",
        "original_filename": "IMG_7860.jpg"
      },
      "type": "image",
      "channel": "ecommerce",
      "locale": "en_US",
      "attribute_code": "image_1|871b8686-79b5-415c-9c6f-a38f8732dfb7"
    }
  },
  "validations": {
    "max_categories_per_product": 5,
    "only_leaves": true,
    "is_mandatory": false
  }
}

Need more? See the Akeneo guide for connection setup and behaviour shared by every action.

Get Category By Code — Akeneo — Documentation