文档中心 > Developing documents(已废弃)

Get Category Attributes

更新时间:2018/05/23 访问次数:2490

There are two APIs to get category attributes: aliexpress.category.redefining.getchildattributesresultbypostcateidandpath and aliexpress.category.redefining.getallchildattributesresult.

Difference between those two APIs

They return almost the same result except that they returns different content for brands (There is an SKU attribute called “Brand Name”).

  • aliexpress.category.redefining.getchildattributesresultbypostcateidandpath only returns the brands which current seller owns (which means seller has right to post product of the brands)
  • aliexpress.category.redefining.getallchildattributesresult returns all brands, regardless of the brand right.

Attribute Levels

Each leaf category (which doesn’t have any child category) may have several levels of attributes.

Let’s take “Step Stools & Step Ladders” category (id is 200135143) as an example. It has a 1st level attribute “Material”. This attribute has below values.

image

Each value may have its own attributes. For example, value “Wood” (value id is 360898) has below attribute(s) (they are 2nd level attributes) & their values

image

For those values, they don’t have attributes. If they have attributes, those attributes are 3rd level attributes.

Attribute/value pair path

Each attribute/value pair can be represented by path. It’s a list of string, the 1st item defines the 1st level attribute/value pair, the 2nd item defines the 2nd level attribute/value pair and so on. The format of each item inside the list is “<attribute id>=<corresponding value id>”. Use comma(“,”) to separate the items in the list.

For example, for the 2nd level attribute “Wood Type” with value “ Mahogany” in above image, the path is “10=360898,100001002=360903”.

Get attributes

Here we use aliexpress.category.redefining.getchildattributesresultbypostcateidandpath for example. It’s almost the same for aliexpress.category.redefining.getallchildattributesresult.

  • To get 1st level attributes, set param1 to the category id.
  • To get 2nd or higher level attributes, set param1 to the category id, set param2 to the path of the parent attribute/value pair.
  • To get all attributes of a category, you need to walk through each attribute/value pair to see if it has sub attributes.

Get 1st level attributes


Service parameters

  • Category id: 200135143

Request

app_key=2****7
method=aliexpress.category.redefining.getchildattributesresultbypostcateidandpath
session=5****u
v=2.0
format=json
sign_method=hmac
sign=A632B152D583293F6F497AF951E4889B
simplify=false
param1=200135143
timestamp=2018-02-13 14:05:55

Response

{
    "aliexpress_category_redefining_getchildattributesresultbypostcateidandpath_response": {
        "result": {
            "attributes": {
                "aeop_attribute_dto": [
                    {
                        "attribute_show_type_value": "list_box", 
                        "customized_name": false, 
                        "customized_pic": false, 
                        "id": 2, 
                        "input_type": "STRING", 
                        "key_attribute": false, 
                        "names": "{\"zh\":\"品牌\",\"en\":\"Brand Name\"}", 
                        "required": true, 
                        "sku": false, 
                        "spec": 0, 
                        "values": {
                            "aeop_attr_value_dto": [
                                {
                                    "id": 203062806, 
                                    "names": "{\"zh\":\"ESNone\",\"en\":\"ESNone\"}"
                                }
                            ]
                        }, 
                        "visible": true
                    }, 
                    {
                        "attribute_show_type_value": "input", 
                        "customized_name": false, 
                        "customized_pic": false, 
                        "id": 3, 
                        "input_type": "STRING", 
                        "key_attribute": false, 
                        "names": "{\"zh\":\"型号\",\"en\":\"Model Number\"}", 
                        "required": false, 
                        "sku": false, 
                        "spec": 0, 
                        "visible": true
                    }, 
                    {
                        "attribute_show_type_value": "check_box", 
                        "customized_name": true, 
                        "customized_pic": true, 
                        "id": 14, 
                        "input_type": "STRING", 
                        "key_attribute": false, 
                        "names": "{\"zh\":\"颜色\",\"en\":\"Color\"}", 
                        "required": false, 
                        "sku": true, 
                        "spec": 1, 
                        "values": {
                            "aeop_attr_value_dto": [
                                {
                                    "id": 200844061, 
                                    "names": "{\"zh\":\"浅灰色\",\"en\":\"Light Gray\"}"
                                }, 
                                {
                                    "id": 200844062, 
                                    "names": "{\"zh\":\"酒红色\",\"en\":\"Red Wine\"}"
                                }, 
                                {
                                    "id": 200141872, 
                                    "names": "{\"zh\":\"深紫色\",\"en\":\"Deep Purple\"}"
                                }, 
                                {
                                    "id": 200006152, 
                                    "names": "{\"zh\":\"浅绿色\",\"en\":\"Light Green\"}"
                                }, 
                                {
                                    "id": 200006154, 
                                    "names": "{\"zh\":\"深卡其布色\",\"en\":\"Dark Khaki\"}"
                                }, 
                                {
                                    "id": 200006155, 
                                    "names": "{\"zh\":\"深灰色\",\"en\":\"Dark Gray\"}"
                                }, 
                                {
                                    "id": 200005536, 
                                    "names": "{\"zh\":\"桔色\",\"en\":\"Orange\"}"
                                }, 
                                {
                                    "id": 200004889, 
                                    "names": "{\"zh\":\"军绿色\",\"en\":\"Army Green\"}"
                                }, 
                                {
                                    "id": 200004890, 
                                    "names": "{\"zh\":\"深灰色\",\"en\":\"Dark Grey\"}"
                                }, 
                                {
                                    "id": 200004891, 
                                    "names": "{\"zh\":\"紫罗兰\",\"en\":\"Lavender\"}"
                                }, 
                                {
                                    "id": 200003699, 
                                    "names": "{\"zh\":\"多色\",\"en\":\"Multi\"}"
                                }, 
                                {
                                    "id": 200002130, 
                                    "names": "{\"zh\":\"象牙白\",\"en\":\"Ivory\"}"
                                }, 
                                {
                                    "id": 200000195, 
                                    "names": "{\"zh\":\"巧克力色\",\"en\":\"Chocolate\"}"
                                }, 
                                {
                                    "id": 100013777, 
                                    "names": "{\"zh\":\"粉红色\",\"en\":\"Pink\"}"
                                }, 
                                {
                                    "id": 365016, 
                                    "names": "{\"zh\":\"紫罗兰\",\"en\":\"Violet\"}"
                                }, 
                                {
                                    "id": 365458, 
                                    "names": "{\"zh\":\"褐色\",\"en\":\"Brown\"}"
                                }, 
                                {
                                    "id": 350850, 
                                    "names": "{\"zh\":\"金色\",\"en\":\"Gold\"}"
                                }, 
                                {
                                    "id": 350852, 
                                    "names": "{\"zh\":\"橙色\",\"en\":\"Orange\"}"
                                }, 
                                {
                                    "id": 350853, 
                                    "names": "{\"zh\":\"银色\",\"en\":\"Silver\"}"
                                }, 
                                {
                                    "id": 10, 
                                    "names": "{\"zh\":\"红色\",\"en\":\"Red\"}"
                                }, 
                                {
                                    "id": 29, 
                                    "names": "{\"zh\":\"白色\",\"en\":\"White\"}"
                                }, 
                                {
                                    "id": 173, 
                                    "names": "{\"zh\":\"蓝色\",\"en\":\"Blue\"}"
                                }, 
                                {
                                    "id": 175, 
                                    "names": "{\"zh\":\"绿色\",\"en\":\"Green\"}"
                                }, 
                                {
                                    "id": 193, 
                                    "names": "{\"zh\":\"黑色\",\"en\":\"Black\"}"
                                }, 
                                {
                                    "id": 366, 
                                    "names": "{\"zh\":\"黄色\",\"en\":\"Yellow\"}"
                                }, 
                                {
                                    "id": 496, 
                                    "names": "{\"zh\":\"紫色\",\"en\":\"Purple\"}"
                                }, 
                                {
                                    "id": 618, 
                                    "names": "{\"zh\":\"透明\",\"en\":\"Transparent\"}"
                                }, 
                                {
                                    "id": 691, 
                                    "names": "{\"zh\":\"灰色\",\"en\":\"Gray\"}"
                                }
                            ]
                        }, 
                        "visible": true
                    }, 
                    {
                        "attribute_show_type_value": "list_box", 
                        "customized_name": false, 
                        "customized_pic": false, 
                        "id": 200000631, 
                        "input_type": "STRING", 
                        "key_attribute": false, 
                        "names": "{\"zh\":\"是否可定制\",\"en\":\"is_customized\"}", 
                        "required": false, 
                        "sku": false, 
                        "spec": 0, 
                        "values": {
                            "aeop_attr_value_dto": [
                                {
                                    "id": 349907, 
                                    "names": "{\"zh\":\"是\",\"en\":\"Yes\"}"
                                }
                            ]
                        }, 
                        "visible": true
                    }, 
                    {
                        "attribute_show_type_value": "check_box", 
                        "customized_name": false, 
                        "customized_pic": false, 
                        "id": 200007763, 
                        "input_type": "STRING", 
                        "key_attribute": false, 
                        "names": "{\"zh\":\"发货地\",\"en\":\"Ships From\"}", 
                        "required": false, 
                        "sku": true, 
                        "spec": 2, 
                        "values": {
                            "aeop_attr_value_dto": [
                                {
                                    "id": 201336099, 
                                    "names": "{\"zh\":\"AU\",\"en\":\"Australia\"}"
                                }, 
                                {
                                    "id": 201336100, 
                                    "names": "{\"zh\":\"CN\",\"en\":\"China\"}"
                                }, 
                                {
                                    "id": 201336101, 
                                    "names": "{\"zh\":\"DE\",\"en\":\"Germany\"}"
                                }, 
                                {
                                    "id": 201336102, 
                                    "names": "{\"zh\":\"ID\",\"en\":\"Indonesia\"}"
                                }, 
                                {
                                    "id": 201336103, 
                                    "names": "{\"zh\":\"RU\",\"en\":\"Russian Federation\"}"
                                }, 
                                {
                                    "id": 201336104, 
                                    "names": "{\"zh\":\"ES\",\"en\":\"Spain\"}"
                                }, 
                                {
                                    "id": 201336105, 
                                    "names": "{\"zh\":\"UK\",\"en\":\"United Kingdom\"}"
                                }, 
                                {
                                    "id": 201336106, 
                                    "names": "{\"zh\":\"US\",\"en\":\"United States\"}"
                                }, 
                                {
                                    "id": 201336342, 
                                    "names": "{\"zh\":\"FR\",\"en\":\"France\"}"
                                }, 
                                {
                                    "id": 201336343, 
                                    "names": "{\"zh\":\"IT\",\"en\":\"Italy\"}"
                                }, 
                                {
                                    "id": 203054829, 
                                    "names": "{\"zh\":\"BR\",\"en\":\"Brazil\"}"
                                }, 
                                {
                                    "id": 203054830, 
                                    "names": "{\"zh\":\"CH\",\"en\":\"Chech\"}"
                                }, 
                                {
                                    "id": 203054831, 
                                    "names": "{\"zh\":\"TR\",\"en\":\"Turkey\"}"
                                }, 
                                {
                                    "id": 203124900, 
                                    "names": "{\"zh\":\"VN\",\"en\":\"Vietnam\"}"
                                }, 
                                {
                                    "id": 203124901, 
                                    "names": "{\"zh\":\"UA\",\"en\":\"Ukraine\"}"
                                }, 
                                {
                                    "id": 203124902, 
                                    "names": "{\"zh\":\"AE\",\"en\":\"United Arab Emirates\"}"
                                }, 
                                {
                                    "id": 203124903, 
                                    "names": "{\"zh\":\"IL\",\"en\":\"Israel\"}"
                                }, 
                                {
                                    "id": 203243831, 
                                    "names": "{\"zh\":\"HU\",\"en\":\"Hungary\"}"
                                }
                            ]
                        }, 
                        "visible": true
                    }, 
                    {
                        "attribute_show_type_value": "list_box", 
                        "customized_name": false, 
                        "customized_pic": false, 
                        "id": 10, 
                        "input_type": "STRING", 
                        "key_attribute": false, 
                        "names": "{\"zh\":\"材质\",\"en\":\"Material\"}", 
                        "required": false, 
                        "sku": false, 
                        "spec": 0, 
                        "values": {
                            "aeop_attr_value_dto": [
                                {
                                    "id": 360898, 
                                    "names": "{\"zh\":\"木制\",\"en\":\"Wood\"}"
                                }, 
                                {
                                    "id": 57, 
                                    "names": "{\"zh\":\"竹\",\"en\":\"Bamboo\"}"
                                }, 
                                {
                                    "id": 124, 
                                    "names": "{\"zh\":\"塑料\",\"en\":\"Plastic\"}"
                                }, 
                                {
                                    "id": 398, 
                                    "names": "{\"zh\":\"金属\",\"en\":\"Metal\"}"
                                }
                            ]
                        }, 
                        "visible": true
                    }, 
                    {
                        "attribute_show_type_value": "list_box", 
                        "customized_name": false, 
                        "customized_pic": false, 
                        "id": 100004626, 
                        "input_type": "STRING", 
                        "key_attribute": false, 
                        "names": "{\"zh\":\"层数\",\"en\":\"Number of Tiers\"}", 
                        "required": false, 
                        "sku": false, 
                        "spec": 0, 
                        "values": {
                            "aeop_attr_value_dto": [
                                {
                                    "id": 202431830, 
                                    "names": "{\"zh\":\"1层\",\"en\":\"1\"}"
                                }, 
                                {
                                    "id": 202431831, 
                                    "names": "{\"zh\":\"2层\",\"en\":\"2\"}"
                                }, 
                                {
                                    "id": 202431832, 
                                    "names": "{\"zh\":\"3层\",\"en\":\"3\"}"
                                }, 
                                {
                                    "id": 202431833, 
                                    "names": "{\"zh\":\"4层\",\"en\":\"4\"}"
                                }, 
                                {
                                    "id": 202431834, 
                                    "names": "{\"zh\":\"5层\",\"en\":\"5\"}"
                                }, 
                                {
                                    "id": 202431835, 
                                    "names": "{\"zh\":\"6层\",\"en\":\"6\"}"
                                }, 
                                {
                                    "id": 202497806, 
                                    "names": "{\"zh\":\"6层以上\",\"en\":\">6\"}"
                                }
                            ]
                        }, 
                        "visible": true
                    }
                ]
            }, 
            "success": true
        }, 
        "request_id": "filnv24gmvr8"
    }
}

Get 2nd level attributes


Service parameters

  • Category id: 200135143
  • 1st level attribute id: 10, you can find this attribute (Material) in above response
  • 1st level value id: 360898, you can find this value (Wood) in above attribute

Request:

app_key=2****7
method=aliexpress.category.redefining.getchildattributesresultbypostcateidandpath
session=5****u
v=2.0
format=json
sign_method=hmac
sign=79192806A222558894999AAAB20883EC
simplify=false
param1=200135143
param2=10=360898
timestamp=2018-02-13 13:55:58

Reponse:

{
    "aliexpress_category_redefining_getchildattributesresultbypostcateidandpath_response": {
        "result": {
            "attributes": {
                "aeop_attribute_dto": [
                    {
                        "attribute_show_type_value": "list_box", 
                        "customized_name": false, 
                        "customized_pic": false, 
                        "id": 100001002, 
                        "input_type": "STRING", 
                        "key_attribute": false, 
                        "names": "{\"zh\":\"实木种类\",\"en\":\"Wood Type\"}", 
                        "required": false, 
                        "sku": false, 
                        "spec": 0, 
                        "values": {
                            "aeop_attr_value_dto": [
                                {
                                    "id": 360903, 
                                    "names": "{\"zh\":\"桃花心木\",\"en\":\"Mahogany\"}"
                                }, 
                                {
                                    "id": 360904, 
                                    "names": "{\"zh\":\"芒果木\",\"en\":\"Mango\"}"
                                }, 
                                {
                                    "id": 360905, 
                                    "names": "{\"zh\":\"松木\",\"en\":\"Pine\"}"
                                }, 
                                {
                                    "id": 360906, 
                                    "names": "{\"zh\":\"红木\",\"en\":\"Rosewood\"}"
                                }, 
                                {
                                    "id": 759, 
                                    "names": "{\"zh\":\"橡木\",\"en\":\"Oak\"}"
                                }, 
                                {
                                    "id": 1607, 
                                    "names": "{\"zh\":\"桦木\",\"en\":\"Birch\"}"
                                }, 
                                {
                                    "id": 1630, 
                                    "names": "{\"zh\":\"柚木\",\"en\":\"Teak\"}"
                                }, 
                                {
                                    "id": 4, 
                                    "names": "{\"zh\":\"其它\",\"en\":\"Other\"}"
                                }
                            ]
                        }, 
                        "visible": true
                    }
                ]
            }, 
            "success": true
        }, 
        "request_id": "13ozdj3vvt56r"
    }
}

Get 3rd level attributes


Service parameters

  • Category id: 200135143
  • 1st level attribute id: 10, you can find this attribute (Material) in first response
  • 1st level value id: 360898, you can find this value (Wood) in above attribute
  • 2nd level attribute id: 100001002, you can find this attribute (Wood Type) in above response
  • 2nd level value id: 360903, you can find this value (Mahogany) in above attribute

Request

app_key=2****7
method=aliexpress.category.redefining.getchildattributesresultbypostcateidandpath
session=5****u
v=2.0
format=json
sign_method=hmac
sign=2262957F67F30B90B0D16897F2C2943A
simplify=false
param1=200135143
param2=10=360898,100001002=360903
timestamp=2018-02-13 14:26:42

Response

{
    "aliexpress_category_redefining_getchildattributesresultbypostcateidandpath_response": {
        "result": {
            "attributes": { }, 
            "success": true
        }, 
        "request_id": "16nt0yguqc333"
    }
}

FAQ

关于此文档暂时还没有FAQ
返回
顶部