3.1 品类数据接口 - getCategories
优质
小牛编辑
158浏览
2023-12-01
品类数据接口 - GetCategories
获取品类数据 可根据名称模糊查询返回品类列表
Request Parameters
Parameter name | Type | Description | Required |
---|---|---|---|
search_word | string | 名称模糊查询,如果不传,返回所有品类 | No |
type | string | 结果类型,如果不传,返回类型为1的,具体参照下面结果示例 | No |
Response Elements
Parameter name | Type | Description |
---|---|---|
action | string | 响应动作 |
categories | array | 品类列表,每项参数可见下面 Response Item |
total_count | int | 根据过滤条件得到的品类数 |
Response Item
Parameter name | Type | Description |
---|---|---|
category_id | string | 品类id |
category_name | string | 品类名称 |
sub_categories | array | 子品类 |
示例
请求示例
http://open.syntun.cn/api/dq/GetCategories
&COMMON_PARAMS
&search_word="家用电器"
响应示例 [type:1或不传]
{
"code": 1000,
"msg": "OK",
"data": {
"action": "getCategories",
"categories": [
{
"category_id": "450",
"category_name": "电烤箱",
"high_category_id": "67",
"super_category_id": "9"
}
],
"total_count": 1
}
}
[type:3]
{
"code": 1000,
"msg": "OK",
"data": {
"action": "getCategories",
"categories": [
{
"super_category_id": "9",
"super_category_name": "家用电器",
"children": [
{
"high_category_id": "67",
"high_category_name": "厨房电器",
"children": [
{
"category_id": "450",
"category_name": "电烤箱"
}
]
}
]
}
],
"total_count": 1
}
}
[type:其他值]
{
"code": 1000,
"msg": "OK",
"data": {
"action": "getCategories",
"categories": [
{
"high_category_id": "67",
"high_category_name": "厨房电器",
"super_category_id": "9",
"children": [
{
"category_id": "450",
"category_name": "电烤箱"
}
]
}
],
"total_count": 1
}
}