Getting supplemental data

Getting supplemental data is the same as getting data from datasets.

Prerequisites

You should have

  • an user-account enabled for api access & PIM access
  • an api-client
  • at least one product-record stored in your Hublify PIM
  • at least one supplemental data-table created with one record stored and referenced by the product.
    The following examples use the "brand" supplemental data.

 

Getting a supplemental data list

In this example a list of "brand" records is retrieved.

 

Request URL

https://{your hublify url}/api/eos_10/data_getList

Request parameter

Params: {
    "dataset": "brand",      // Specify the supplemental dataset you want to access
    "fields": [
        "label",
        "name",
        "description"
    ]
}

Response

{
    "status": true,
    "data": [
        {
            "xc__id": "2890",
            "label": "flos",
            "name": "Flos",
            "description": "Flos vereint mit seiner gro\u00dfen Vielfalt die ber\u00fchmten Designikonen der letzten 40 Jahre. Im Vordergrund steht seit jeher die Verbindung aus Modernit\u00e4t und Tradition, Funktionalit\u00e4t und Formsch\u00f6nheit.
\r\n\tDas Unternehmen beweist mit seinen Leuchten, dass fest geglaubte Gestaltungsgrenzen aufgebrochen werden k\u00f6nnen und daraus neue Kreationen entstehen.<\/p>\r\n",
            "model": "brand",
            "primaryValue": "2890",
            "primaryKey": "xc__id",
            "displayValue": "Flos",
            "displayKey": "name"
        },
        {
            "xc__id": "2891",
            "label": "graypants",
            "name": "Graypants",
            "description": "Vielf\u00e4ltige Lampenkunst aus Holz, Papier und Pappe pr\u00e4gt Graypants in hohem Ma\u00dfe. In unserem Graypants Markenshop k\u00f6nnen Sie Graypants H\u00e4ngelampen erwerben und sich die w\u00e4rmende Atmosph\u00e4re der beeindruckenden Leuchten in Ihr Wohnzimmer holen.<\/p>\r\n",
            "model": "brand",
            "primaryValue": "2891",
            "primaryKey": "xc__id",
            "displayValue": "Graypants",
            "displayKey": "name"
        },
        {
            "xc__id": "2892",
            "label": "john_green",
            "name": "John Green",
            "description": "John Green is an award winning designer, designing furniture and lifestyle products for manufacture. John’s approach is simple – to create innovative and functional designs that people can’t resist. On top of developing products for his own brand John works as a freelance designer, collaborating with other designers and manufacturers. [copyright by johngreendesigns.com\/about]<\/p>\r\n",
            "model": "brand",
            "primaryValue": "2892",
            "primaryKey": "xc__id",
            "displayValue": "John Green",
            "displayKey": "name"
        }
    ]
}

 

Getting combined product & supplemental data

For better performance and efficiency it can be helpful to get all product data including referenced supplemental data in one api-call.

In the following example one product with supplemental data "brand" is retrieved.
Hublify knows automatically that the "brand" field in the product record refers to supplemental data-table and returns therefore a brand-field-string and the brand's record as a sub-data-record in the field "drvd_brand_record".

The brand's default fields returned in the sub-data in "drvd_brand_record" can be configured for each (sub) data-type indvidually.
If you want to specify the sub-data fields returned, see the other example for that.

 

Request URL

https://{your hublify url}/api/eos_10/data_get

Request parameter

Params: {
    "dataset": "product",
    "fields": [
        "pcode",
        "name",
        "drvd_categories",
        "price",
        "brand"    // (!) Will return "brand" and "drvd_brand_record"
    ],
    "filter": {
        "pcode": "FL00024"
    }
}

Response

{
    "data": {
        "pcode": "FL00024",
        "name": "KTribe T2 Tischleuchte",
        "drvd_categories": {
            "model": "productgroup",
            "primaryKey": "node_id",
            "displayKey": "node_name",
            "data": [
                {
                    "node_id": 5,
                    "node_code": "lightning_table",
                    "node_name": "Tischleuchten",
                    "node_path": "|Wohninterieur|Lampen|Tischleuchten"
                }
            ]
        },
        "price": "774.0000",
        "brand": "Flos",
        "drvd_brand_record": {
            "model": "brand",
            "primaryValue": null,
            "primaryKey": "xc__id",
            "displayValue": "Flos",
            "displayKey": "name",
            "label": "flos",
            "name": "Flos",
            "logo": {
                "model": "mam_asset",
                "data": [
                    {
                        "mb_id": "3524",
                        "mb_label": "ecs_plugin_shop_demodata_flos_logo",
                        "mb_title": "flos_logo",
                        "url": "\/files\/\/ecs_plugin_shop_demodata\/flos_logo.jpg",
                    }
                ]
            },
            "short_description": null,
            "description": "
\r\n\tFlos vereint mit seiner gro\u00dfen Vielfalt die ber\u00fchmten Designikonen der letzten 40 Jahre. Im Vordergrund steht seit jeher die Verbindung aus Modernit\u00e4t und Tradition, Funktionalit\u00e4t und Formsch\u00f6nheit.
\r\n\tDas Unternehmen beweist mit seinen Leuchten, dass fest geglaubte Gestaltungsgrenzen aufgebrochen werden k\u00f6nnen und daraus neue Kreationen entstehen.<\/p>\r\n",
        }
    },
    "status": true
}

 

Getting combined product & supplemental data

For better performance and efficiency it can be helpful to get all product data including referenced supplemental data in one api-call.

In the following example one product with supplemental data "brand" is retrieved.
 

 

Request URL

https://{your hublify url}/api/eos_10/data_get

Request parameter

Params: {
    "dataset": "product",
    "fields": [
        "pcode",
        "name",
        "drvd_categories",
        "price",
        "brand"    // (!) Will return "brand" and "drvd_brand_record"
    ],
    "subData": {             // (optional) Specify here what fields to be returned for that sub-data.    
        "brand": {
            "fields": [
                "name",
                "description"
            ],
            "resultKey": "my_brand_data"     // (optional)
        }
    },
    "filter": {
        "pcode": "FL00024"
    }
}

Response

{
    "data": {
        "pcode": "FL00024",
        "name": "KTribe T2 Tischleuchte",
        "drvd_categories": {
            "model": "productgroup",
            "primaryKey": "node_id",
            "displayKey": "node_name",
            "data": [
                {
                    "node_id": 5,
                    "node_code": "lightning_table",
                    "node_name": "Tischleuchten",
                    "node_path": "|Wohninterieur|Lampen|Tischleuchten"
                }
            ]
        },
        "price": "774.0000",
        "brand": "Flos",
        "my_brand_data": {
            "name": "Flos",
            "description": "
\r\n\tFlos vereint mit seiner gro\u00dfen Vielfalt die ber\u00fchmten Designikonen der letzten 40 Jahre. Im Vordergrund steht seit jeher die Verbindung aus Modernit\u00e4t und Tradition, Funktionalit\u00e4t und Formsch\u00f6nheit.
\r\n\tDas Unternehmen beweist mit seinen Leuchten, dass fest geglaubte Gestaltungsgrenzen aufgebrochen werden k\u00f6nnen und daraus neue Kreationen entstehen.<\/p>\r\n",
        }
    },
    "status": true
}