获取营种分类
查询营种分类列表,支持按名称模糊搜索、按父级分类筛选,默认只返回已上架分类。
POST/api/getCourseTypeList
请求参数
| 名称 | 类型 | 描述 | 是否必填 | 默认值 | 备注 |
|---|---|---|---|---|---|
| token | String | 身份校验令牌 | 必填 | - | 由 获取访问令牌 获得 |
| name | String | 分类名称 | 非必填 | - | 模糊查询 |
| fid | Number | 父级分类 ID | 非必填 | - | 传入则只返回该父级下的子分类 |
| status | Number | 上下架状态 | 非必填 | 1 | 1 上架,2 下架 |
CURL
V1
curl --location --request POST 'https://open.xinduobang.cn/api/getCourseTypeList' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'token=YOUR_TOKEN' \
--data-urlencode 'name=' \
--data-urlencode 'fid=' \
--data-urlencode 'status=1'
V2(appid 为 V2 版本)
curl --location --request POST 'https://open.xinduobang.cn/api/getCourseTypeList' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'X-Timestamp: 1770000000' \
--header 'X-Nonce: 3f9c1a7b2e6d4058' \
--header 'X-Signature: <computed_hmac_sha256>' \
--data-urlencode 'token=YOUR_TOKEN' \
--data-urlencode 'name=' \
--data-urlencode 'fid=' \
--data-urlencode 'status=1'
信息
V2 签名算法及 X-Signature 计算方式见 V2 接入示例。下方接口 V2 示例均遵循相同规则,不再重复注释。
成功响应
{
"code": 0,
"msg": "success",
"data": [
{
"id": "1",
"name": "夏令营",
"fid": "0",
"status": "1"
},
{
"id": "5",
"name": "户外探索",
"fid": "1",
"status": "1"
}
]
}
| 字段 | 类型 | 说明 |
|---|---|---|
| id | String | 分类 ID |
| name | String | 分类名称 |
| fid | String | 父级分类 ID,0 表示顶级分类 |
| status | String | 1 上架,2 下架 |
失败响应
| HTTP状态码 | 错误码 | 描述 | 排查建议 |
|---|---|---|---|
| 200 | 非 0 | 业务错误 | 请检查 token 与筛选参数 |