Glue API: Retrieve product attributes

Edit on GitHub

The Product Management Attributes API allows you to retrieve all predefined product attributes available in your shop system.

Only preset attributes are retrieved. So if an attribute allows custom input ( "allowInput":true), and the custom value is provided, the custom value is not retrieved.

Installation

For detailed information on the modules that provide the API functionality and related installation instructions, see Install the Product Glue API.

Retrieve all product attributes

To retrieve all product attributes, send the request:


GET /product-management-attributes


Request

Request sample: retrieve all product attributes

https://glue.mysprykershop.com/product-management-attributes

Response

Response sample: retrieve all product attributes
{
    "data": [
        {
            "type": "product-management-attributes",
            "id": "storage_capacity",
            "attributes": {
                "key": "storage_capacity",
                "inputType": "text",
                "allowInput": false,
                "isSuper": true,
                "localizedKeys": [
                    {
                        "localeName": "en_US",
                        "translation": "Storage Capacity"
                    },
                    {
                        "localeName": "de_DE",
                        "translation": "Speichergröße"
                    }
                ],
                "values": [
                    {
                        "value": "128 GB",
                        "localizedValues": []
                    },
                    {
                        "value": "64 GB",
                        "localizedValues": []
                    },
                    {
                        "value": "32 GB",
                        "localizedValues": []
                    },
                    {
                        "value": "16 GB",
                        "localizedValues": []
                    }
                ]
            },
            "links": {
                "self": "https://glue.mysprykershop.com/product-management-attributes/storage_capacity"
            }
        },
        {
            "type": "product-management-attributes",
            "id": "white_balance",
            "attributes": {
                "key": "white_balance",
                "inputType": "text",
                "allowInput": false,
                "isSuper": false,
                "localizedKeys": [
                    {
                        "localeName": "en_US",
                        "translation": "White balance"
                    },
                    {
                        "localeName": "de_DE",
                        "translation": "Weißabgleich"
                    }
                ],
                "values": [
                    {
                        "value": "manual",
                        "localizedValues": [
                            {
                                "localeName": "en_US",
                                "translation": "Manual"
                            },
                            {
                                "localeName": "de_DE",
                                "translation": "Manuell"
                            }
                        ]
                    },
                    {
                        "value": "auto",
                        "localizedValues": [
                            {
                                "localeName": "en_US",
                                "translation": "Auto"
                            },
                            {
                                "localeName": "de_DE",
                                "translation": "Auto"
                            }
                        ]
                    }
                ]
            },
            "links": {
                "self": "https://glue.mysprykershop.com/product-management-attributes/white_balance"
            }
        }
    ],
    "links": {
        "self": "glue.mysprykershop.com/product-management-attributes"
    }
}
RESOURCE ATTRIBUTE TYPE DESCRIPTION
product-management-attributes allowInput Boolean Indicates if custom values can be entered for this product attribute.
product-management-attributes isSuper Boolean Indicates if it is a super attribute or not.
product-management-attributes inputType String Input type of the product attribute, for example, text, number, select, etc.
product-management-attributes localeName String Name of the locale.
product-management-attributes values Array Possible values of the attribute.
product-management-attributes id String Product attribute key.
product-management-attributes key String Product attribute key.
product-management-attributes translation String Translation for the locale.

Retrieve a product attribute

To retrieve a product attribute, send the request:


GET /product-management-attributes/{{attribute_id}}


PATH PARAMETER DESCRIPTION
{{attribute_id}} A unique identifier of an attribute. Retrieve product attributes to get it.

Request

Request sample: retrieve a product attribute

https://glue.mysprykershop.com/product-management-attributes/storage_capacity

Response

Response sample: retrieve a product attribute
{
    "data": {
        "type": "product-management-attributes",
        "id": "storage_capacity",
        "attributes": {
            "key": "storage_capacity",
            "inputType": "text",
            "allowInput": false,
            "isSuper": true,
            "localizedKeys": [
                {
                    "localeName": "en_US",
                    "translation": "Storage Capacity"
                },
                {
                    "localeName": "de_DE",
                    "translation": "Speichergröße"
                }
            ],
            "values": [
                {
                    "value": "32 GB",
                    "localizedValues": []
                },
                {
                    "value": "128 GB",
                    "localizedValues": []
                },
                {
                    "value": "16 GB",
                    "localizedValues": []
                },
                {
                    "value": "64 GB",
                    "localizedValues": []
                }
            ]
        },
        "links": {
            "self": "https://glue.mysprykershop.com/product-management-attributes/storage_capacity"
        }
    }
}
RESOURCE ATTRIBUTE TYPE DESCRIPTION
product-management-attributes allowInput Boolean Indicates if custom values can be entered for this product attribute.
product-management-attributes isSuper Boolean Indicates if it is a super attribute or not.
product-management-attributes inputType String Input type of the product attribute, for example, text, number, select, etc.
product-management-attributes localeName String Name of the locale.
product-management-attributes values Array Possible values of the attribute.
product-management-attributes id String Product attribute key.
product-management-attributes key String Product attribute key.
product-management-attributes translation String Translation for the locale.

Possible errors

CODE REASON
4201 Attribute not found.

For generic Glue Application errors that can also occur, see Reference information: GlueApplication errors.