URL重定向-类型
接口信息
- 接口地址:
{your-site-url}/api/skill/redirect/types - 基础 URL:
{your-site-url}需替换为你自己的独立站 URL 地址,如https://your-domain.com/apimanager666 - 请求方式:
GET - 说明: 此接口用于获取所有重定向类型列表,返回各类型的多语言文本和对应
code值。主要用于创建/编辑重定向时下拉选择类型。
认证
请求头中需要携带 skill-access-token:
| Header | 值 |
|---|---|
skill-access-token |
{your-skill-access-token} (请替换为你自己的 token) |
请求参数
无参数。
请求示例
cURL
curl --location --request GET '{your-site-url}/api/skill/redirect/types' \
--header 'skill-access-token: {your-skill-access-token}'
返回结果
code 为 200 表示调用成功;code 不为 200 表示调用失败。
成功响应
{
"code": 200,
"data": [
{
"text": "商品类型",
"cn": "商品类型",
"tw": "商品類型",
"en": "Product Type",
"page_type": "product",
"code": 1
},
{
"text": "商品专辑类型",
"cn": "商品专辑类型",
"tw": "商品專輯類型",
"en": "Product Collection Type",
"page_type": "collection",
"code": 2
},
{
"text": "自定义页面类型",
"cn": "自定义页面类型",
"tw": "自訂頁面類型",
"en": "Custom page type",
"page_type": "page",
"code": 3
},
{
"text": "博客文章类型",
"cn": "博客文章类型",
"tw": "部落格文章類型",
"en": "Blog Article Type",
"page_type": "blog_article",
"code": 4
},
{
"text": "博客专辑类型",
"cn": "博客专辑类型",
"tw": "部落格專輯類型",
"en": "Blog Collection Type",
"page_type": "blog_collection",
"code": 5
},
{
"text": "手动添加类型",
"cn": "手动添加类型",
"tw": "手動新增類型",
"en": "Manually add types",
"page_type": "none",
"code": 10
}
],
"message": "success"
}
返回字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
code |
Number | 状态码,200 表示成功 |
message |
String | 执行结果的文字描述 |
data |
Array[Object] | 重定向类型列表 |
data 子项字段
| 字段 | 类型 | 说明 |
|---|---|---|
code |
int | 类型值,创建/编辑重定向时传入此值 |
text |
string | 默认文本 |
cn |
string | 中文名称 |
tw |
string | 繁体中文名称 |
en |
string | 英文名称 |
page_type |
string | 对应的页面类型标识。product = 商品,collection = 商品专辑,page = 自定义页面,blog_article = 博客文章,blog_collection = 博客专辑,none = 手动添加 |
注意事项
- 主要用于创建重定向时下拉框的数据源,
code字段为实际传入后端的值 - 系统自动添加的重定向类型为
1~5,手动添加的类型为10