文件-类型
接口信息
- 接口地址:
{your-site-url}/api/skill/base-download/get-file-types - 基础 URL:
{your-site-url}需替换为你自己的独立站 URL 地址,如https://your-domain.com/apimanager666 - 请求方式:
GET - 说明: 得到文件类型列表。返回的文件类型
type_code,用于 下载文件-列表 接口的type参数过滤文件类型。
认证
请求头中需要携带 skill-access-token:
| Header | 值 |
|---|---|
skill-access-token |
{your-skill-access-token} (请替换为你自己的 token) |
请求参数
无请求参数。
请求示例
cURL
curl --location --request GET '{your-site-url}/api/skill/base-download/get-file-types' \
--header 'skill-access-token: {your-skill-access-token}' \
--header 'Content-Type: application/json'
返回结果
code 为 200 表示调用成功;code 不为 200 表示调用失败。
成功响应
{
"code": 200,
"data": [
{
"type_code": "1",
"text": "文件类型-图片",
"code": "image"
},
{
"type_code": "2",
"text": "文件类型-音频",
"code": "audio"
},
{
"type_code": "3",
"text": "文件类型-视频",
"code": "video"
},
{
"type_code": "4",
"text": "文件类型-excel",
"code": "excel"
},
{
"type_code": "5",
"text": "文件类型-ico",
"code": "ico"
},
{
"type_code": "6",
"text": "文件类型-pdf",
"code": "pdf"
},
{
"type_code": "7",
"text": "文件类型-doc",
"code": "doc"
},
{
"type_code": "8",
"text": "文件类型-zip",
"code": "zip"
},
{
"type_code": "9",
"text": "文件类型-csv",
"code": "csv"
}
],
"message": "success"
}
返回字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
code |
Number | 状态码,200 表示成功 |
message |
String | 执行结果的文字描述 |
data |
Array | 文件类型列表 |
data[].type_code |
String | 文件类型编码,用于 下载文件-列表 接口的 type 参数 |
data[].text |
String | 文件类型的文字描述,如:文件类型-图片 |
data[].code |
String | 文件类型的代码,如:image、audio |
注意事项
- 返回的文件类型
type_code与 下载文件-列表 返回的data.list[].type字段对应。 - 文件类型汇总:
1图片(image)、2音频(audio)、3视频(video)、4excel、5ico、6pdf、7doc、8zip、9csv。