文件分类操作
接口
POST https://cloud.minapp.com/userve/v2.2/file-category/
参数说明
Content-Type: application/json
代码示例
var axios = require('axios').create({
withCredentials: true
})
axios.post('https://cloud.minapp.com/userve/v2.2/file-category/', {name: 'Category'}).then(res => {
console.log(res.data)
})
状态码说明
201 写入成功
接口
GET https://cloud.minapp.com/userve/v2.2/file-category/:category_id/
其中 :category_id 需替换为你的文件分类 ID
代码示例
返回示例
接口
GET https://cloud.minapp.com/userve/v2.2/file-category/
info 该接口支持通过参数 return_total_count 指定是否返回查询对象总数,以协助不关心对象总数只关心查询结果列表的开发者提升接口响应速度。 同时,从 v2.2 版本开始该接口默认不返回查询对象总数,欲获取总数的开发者需要显式指定 return_total_count 参数。
参数说明
Content-Type: application/json
若开发者只需要获取对象总数,则可以通过设置 limit=1 以及 return_total_count=1 来达到该效果,total_count 可从返回的 meta 中获取
请求示例:
代码示例
返回示例
字段 files 在返回中有两个地方出现;在 meta 中表示应用上传文件的数量总和;在 objects 中表示每个分类下的上传文件的数量,同时字段 files 从 v2.2 版本开始仅在 return_total_count 为 1 时返回。
接口
PUT https://cloud.minapp.com/userve/v2.2/file-category/:category_id/
其中 :category_id 需替换为你的文件分类 ID
代码示例
返回示例
状态码说明
200 修改成功
接口
DELETE https://cloud.minapp.com/userve/v2.2/file-category/:category_id/
其中 :category_id 需替换为你的文件分类 ID
代码示例
状态码说明
204 删除成功