3.5 品牌 - 品类对应关系接口 - getBrandCategory

优质
小牛编辑
136浏览
2023-12-01

品牌&品类互相对应关系接口 - getBrandCategory

基于品类与品牌之间的多对多关系,互相查询 可根据品牌查询对应品类或者根据品类查询品牌

Request Parameters

Parameter nameTypeDescriptionRequired
typestring要获取的结果,默认为 brands,只能为brands,categories之一No
brand_idint要筛选的品牌编号No
category_idint要筛选的品类编号,和上面的brand_id两者都有则取最大值No

Response Elements

Parameter nameTypeDescription
actionstring响应动作
brands或categoriesarray品牌或品类列表,每项参数可见下面 Response Item
total_countint根据过滤条件得到的平台数

Response Item

Parameter nameTypeDescription
brand_id或category_idint品牌或品类id
brand_name或category_namestring品牌或品类名称

示例

请求示例

http://open.syntun.cn/api/dq/getBrandCategory
&category_id=315
&COMMON_PARAMS

响应示例 type=brands

{
    "code": 1000,
    "msg": "OK",
    "data": {
        "action": "getBrandCategory",
        "brands": [
            {
                "brand_id": "1805",
                "brand_name": "三洋"
            },
            {
                "brand_id": "4096",
                "brand_name": "华凌"
            },
            {
                "brand_id": "2296",
                "brand_name": "欧菱宝"
            },
            ...
        ],
        "total_count": 10,
        "page_urls": {
            "first": "COMMAN_PARAMS&category_id=315&page=1",
            "previous": null,
            "current": "COMMAN_PARAMS&category_id=315&page=1",
            "next": "COMMAN_PARAMS&category_id=315&page=2",
            "last": "COMMAN_PARAMS&category_id=315&page=10"
        }
    }
}

type=categories

{
    "code": 1000,
    "msg": "OK",
    "data": {
        "action": "getBrandCategory",
        "categories": [
            {
                "category_id": "180",
                "category_name": "手机"
            }
        ],
        "total_count": 1,
        "page_urls": {
            "first": "COMMAN_PARAMS&category_id=315&type=categories&page=1",
            "previous": null,
            "current": "COMMAN_PARAMS&category_id=315&type=categories&page=1",
            "next": null,
            "last": "COMMAN_PARAMS&category_id=315&type=categories&page=1"
        }
    }
}