简要描述:

  • 获取平台商品分类接口。

请求URL:

  • /api/shop/category/index

请求方式:

  • GET
  • POST

请求参数:

参数名称 类型 必选 长度 介绍
token String Y 32 授权时获取的token
parentid Numeric Y 获取parentid下面的子目录

返回示例:

正确时返回:

{
    "status": true,
    "code": "200",
    "msg": "获取成功",
    "result": [
        {
          "id": 730,
          "name": "硒鼓/墨粉",
          "thumb": "images/16/2018/02/xfm4cFKfJ2Hcmidx8k6imMq240R2FD.jpg",
          "parentid": 729,
          "description": "硒鼓/墨粉",
          "level": 3
        },
        ...
    ]

}

错误时返回:

{
    "status": false,
    "code": "3003",
    "msg": "非法请求",
    "result": []
}

返回参数说明:

参数名称 类型 必选 长度 介绍
id String Y 32 分类编号
level Integer Y 1 分类层级
name String Y 64 分类名称
thumb String 图片
parentid Integer Y 父ID
description String 接口介绍

备注:

  • 更多返回错误代码请看首页的错误代码描述

接口介绍:

  • 获取平台商品分类接口。

请求地址:

  • /api/shop/category/index

请求参数:

参数名称 类型 必选 长度 接口介绍
token String Y 32 授权时获取的token
parentid Numeric Y 获取parentid下面的子目录

响应数据:

参数名称 数据格式
status 返回值:true/false
code 成功为200
msg 提示信息
result [ {“id”: 730, “name”: “硒鼓/墨粉”, “thumb”: “images/16/2018/02/xfm4cFKfJ2Hcmidx8k6imMq240R2FD.jpg”, “parentid”: 729, “description”: “硒鼓/墨粉”, “level”: 3 }, …]

相关字段说明

参数名称 类型 必选 长度 接口介绍
id String Y 32 分类编号
level Integer Y 1 分类层级
name String Y 64 分类名称
thumb String 图片
parentid Integer Y 父ID
description String 接口介绍
文档更新时间: 2023-04-11 15:53   作者:qiushiyong