3.5 品牌 - 品类对应关系接口 - getBrandCategory
优质
小牛编辑
136浏览
2023-12-01
品牌&品类互相对应关系接口 - getBrandCategory
基于品类与品牌之间的多对多关系,互相查询 可根据品牌查询对应品类或者根据品类查询品牌
Request Parameters
Parameter name | Type | Description | Required |
---|---|---|---|
type | string | 要获取的结果,默认为 brands,只能为brands,categories之一 | No |
brand_id | int | 要筛选的品牌编号 | No |
category_id | int | 要筛选的品类编号,和上面的brand_id两者都有则取最大值 | No |
Response Elements
Parameter name | Type | Description |
---|---|---|
action | string | 响应动作 |
brands或categories | array | 品牌或品类列表,每项参数可见下面 Response Item |
total_count | int | 根据过滤条件得到的平台数 |
Response Item
Parameter name | Type | Description |
---|---|---|
brand_id或category_id | int | 品牌或品类id |
brand_name或category_name | string | 品牌或品类名称 |
示例
请求示例
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"
}
}
}