Getting products

Prerequisites

You should have

  • an user-account enabled for api access & PIM access
  • an api-client
  • at least on product-record stored in your Hublify PIM

 

Getting a product list

Simply provide the fields you want to have returned.
Info: In the following example an optional limit-parameter is given too, to avoid too big results returned.

Request URL

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

Request parameter

{
    "dataset": "product",
    "fields": [
        "pcode",
        "name",
        "drvd_categories",
        "price"
    ],
    "sql": {
        "limit": {
            "max": 3
        }
    }
}

Response

{
    "data": [
        {
            "pcode": "BP00001",
            "name": "Das Bundle \"BP00001\" !",
            "drvd_categories": {
                "model": "productgroup",
                "primaryKey": "node_id",
                "displayKey": "node_name",
                "data": [
                    {
                        "node_id": 3,
                        "node_code": "lightning_pendant",
                        "node_name": "H\u00e4ngeleuchten",
                        "node_path": "|Wohninterieur|Lampen|H\u00e4ngeleuchten"
                    }
                ]
            },
            "price": "799.9000"
        },
        {
            "pcode": "CRI00001",
            "name": "Duomo XXXL dekorative Sch\u00fcssel",
            "drvd_categories": {
                "model": "productgroup",
                "primaryKey": "node_id",
                "displayKey": "node_name",
                "data": [
                    {
                        "node_id": 12,
                        "node_code": "bowles",
                        "node_name": "Sch\u00fcsseln",
                        "node_path": "|K\u00fcchenutensilien|Sch\u00fcsseln"
                    }
                ]
            },
            "price": "106.0000"
        },
        {
            "pcode": "EK00001",
            "name": "Duomo XXL dekorative Sch\u00fcssel",
            "drvd_categories": {
                "model": "productgroup",
                "primaryKey": "node_id",
                "displayKey": "node_name",
                "data": [
                    {
                        "node_id": 12,
                        "node_code": "bowles",
                        "node_name": "Sch\u00fcsseln",
                        "node_path": "|K\u00fcchenutensilien|Sch\u00fcsseln"
                    }
                ]
            },
            "price": "109.0000"
        }
    ],
    "status": true
}

 

Paging (Limit)

Easily add paging parameters (limit max & start) to your requests.

Request URL

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

Request parameter

{
    "dataset": "product",
    "fields": [
        "pcode",
        "name",
        "drvd_categories",
        "price"
    ],
    "sql": {
        "limit": {
            "start": 100,    // (optional, default: 0) Starting record number.
            "max": 25,       // (optional, default: NULL) Maximum number of records returned.
        }
    }
}

Response

{
    "data": [
        {
            "pcode": "BP00001",
            "name": "Das Bundle \"BP00001\" !",
            "drvd_categories": {
                "model": "productgroup",
                "primaryKey": "node_id",
                "displayKey": "node_name",
                "data": [
                    {
                        "node_id": 3,
                        "node_code": "lightning_pendant",
                        "node_name": "H\u00e4ngeleuchten",
                        "node_path": "|Wohninterieur|Lampen|H\u00e4ngeleuchten"
                    }
                ]
            },
            "price": "799.9000"
        },
        ...           // EXAMPLE SHORTENED
    ],
    "status": true
}
 

 

Filter & segments

Simply add filtering parameters to your api-calls

 

Category filter

To get only products of a certain category, simply add a category filter to your api call.
Best practise is to filter for the "drvd_category_code"-field.

 

Request URL

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

Request parameter

{
    "dataset": "product",
    "fields": [
        "pcode",
        "name"
    ],
    "filter": {
        "drvd_category_code": "lightning_floor"
    }
}

Response

{
    "data": [
        {
            "pcode": "FL00001",
            "name": "KTribe F3 Standleuchte"
        },
        {
            "pcode": "FL00002",
            "name": "KTribe F3 Standleuchte"
        },
        {
            "pcode": "FL00003",
            "name": "KTribe F3 Standleuchte"
        },
        {
            "pcode": "FL00011",
            "name": "Brera F2 Standleuchte"
        },
        {
            "pcode": "FL00018",
            "name": "Spun Light Standleuchte"
        },
        {
            "pcode": "FL00019",
            "name": "Spun Light Standleuchte"
        },
        {
            "pcode": "FL00020",
            "name": "Ray F2 Standleuchte"
        },
        {
            "pcode": "FL00021",
            "name": "Ray F1 Standleuchte"
        }
    ],
    "status": true
}

Sorting

You can sort by actually any field.

It is also possible to sort by multiple fields. The fields you sort by do not have to be part of your field-parameters.

 

Request URL

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

Request parameter

{
    "dataset": "product",
    "fields": [
        "pcode",
        "name",
        "drvd_categories",
        "price"
    ],
    "sql": {
        "order": "name ASC, price DESC"    // (optional) Add one or more sorting parameter.
    }
}

Response

{
    "data": [
        {
            "pcode": "BP00001",
            "name": "Das Bundle \"BP00001\" !",
            "drvd_categories": {
                "model": "productgroup",
                "primaryKey": "node_id",
                "displayKey": "node_name",
                "data": [
                    {
                        "node_id": 3,
                        "node_code": "lightning_pendant",
                        "node_name": "H\u00e4ngeleuchten",
                        "node_path": "|Wohninterieur|Lampen|H\u00e4ngeleuchten"
                    }
                ]
            },
            "price": "799.9000"
        },
        ...           // EXAMPLE SHORTENED
    ],
    "status": true
}

 

Aggregated Data

You can request aggregated data.
Multiple measurements for the same group can be requested together.

Request URL

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

Request parameter

{
    "dataset": "product",
    "fieldMeasure": [
        {
            "field": "price",   
            "aggregation": "MIN",
            "alias": "priceFrom"
        },
        {
            "field": "price",
            "aggregation": "MAX", 
            "alias": "priceTo"
        }
    ]
} 

Response

{
    "data": [
        {
            "price": "598.0000",
            "priceFrom": "10.0000",
            "priceTo": "6115.0000"
        }
    ],
    "status": true
}

 

You can specify an additonal grouping field.

Request URL

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

Request parameter

{
    "dataset": "product",
    "fieldMeasure": [
        {
            "field": "price",
            "aggregation": "MIN",
            "alias": "priceFrom"
        },
        {
            "field": "price",
            "aggregation": "MAX",
            "alias": "priceTo"
        }
    ],
    "fieldGroupBy": [
        {
            "field": "drvd_category_path"
        }
    ]
} 

Response

{
    "data": [
        {
            "price": "39.0000",
            "drvd_category_path": "|K\u00fcchenutensilien|Glasware",
            "priceFrom": "39.0000",
            "priceTo": "64.0000"
        },
        {
            "price": "106.0000",
            "drvd_category_path": "|K\u00fcchenutensilien|Sch\u00fcsseln",
            "priceFrom": "10.0000",
            "priceTo": "320.0000"
        },
         ...           // EXAMPLE SHORTENED
    ],
    "status": true
}

 

 

 

Searching

Hublify has a powerful built-in multi-field-search.

See the details here: Searching products

 

Getting a single product

To get data for a single product, simply filter for a unique field. Usually this is the field: pcode.

Request URL

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

Request parameter


{
    "dataset": "product",
    "fields": [
        "pcode",
        "name",
        "drvd_categories",
        "price",
        "files_img"
    ],
    "filter": {
        "pcode": "FL00003"
    }
}

Response

{
    "data": {
        "pcode": "FL00003",
        "name": "KTribe F3 Standleuchte",
        "drvd_categories": {
            "model": "productgroup",
            "primaryKey": "node_id",
            "displayKey": "node_name",
            "data": [
                {
                    "node_id": 4,
                    "node_code": "lightning_floor",
                    "node_name": "Standleuchten",
                    "node_path": "|Wohninterieur|Lampen|Standleuchten"
                }
            ]
        },
        "price": "1548.0000",
        "files_img": {
            "model": "mam_asset",
            "data": [
                {
                    "mb_id": "3492",
                    "mb_label": "ecs_plugin_shop_demodata_flos_fl00003",
                    "mb_preview": "\/ecs_plugin_shop_demodata\/.preview.ecms\/flos_FL00003.jpg___thumb.jpg",
                    "mb_title": "flos_FL00003",
                    "mb_caption": "",
                    "mb_meta": {
                        "MimeType": "image\/jpeg",
                        "ImageSize": {
                            "height": 1000,
                            "width": 1000
                        }
                    },
                    "mb_insert_time": "2019-01-21 17:36:50",
                    "mb_update_time": "2020-05-25 18:08:28",
                    "url": "\/files\/\/ecs_plugin_shop_demodata\/flos_FL00003.jpg",
                }
            ]
        }
    },
    "status": true
}