创建文档文章/目录/外链文章

创建于 2024-08-16 / 最近更新于 2024-08-19 / 138
字体: [默认] [大] [更大]

基本信息

接口地址: 您的域名/?m=ArticleApi&a=index

请求方式: GET

Get参数请求

参数 示例值 类型 默认值 是否必填 描述
m ArticleApi string - 必填 控制器
a index string - 必填 方法

Header参数请求

参数 示例值 类型 默认值 是否必填 描述
Authorization base64(key:secret) string 必填

Body参数请求

请求方式: JSON


创建目录/外链文章的示例格式

示例格式:

{
  "id": "21",
  "article_title": "API目录",
  "article_parent": "0",
  "article_node": "1",
  "using_api_tool": "0",
  "editor": "0",
  "article_listsort": "1",
  "article_mark": ""
}
参数 示例值 类型 默认值 是否必填 描述
id 21 string - 必填 文档ID (必须是字符串)
article_title API目录 string - 必填 文章/目录/外链文章的标题
article_parent 0 string - 必填 文章/目录/外链文章的父类节点
article_node 1 string - 必填 创建的类型 0: 文章 1:目录 2:外链文章
using_api_tool 0 string - 必填 是否开启API工具。0:暂停 1:启用 (建议选0)
editor 0 string - 必填 编辑器类型 0:富文本编辑器 1:MD编辑器
article_listsort 1 string - 非必填 文章/目录/外链文章排序值
article_mark - string - 非必填 文章的标记ID,留空则随机生成ID

创建文章的示例格式

富文本API格式

示例格式:

{
    "id": "21",
    "article_title": "API文章",
    "article_parent": "0",
    "article_node": "0",
    "using_api_tool": "0",
    "editor": "0",
    "content": "<p>API文章示例内容</p>",
    "article_listsort": "0",
    "article_mark": ""
}
参数 示例值 类型 默认值 是否必填 描述
id 21 string - 必填 文档ID (必须是字符串)
article_title API目录 string - 必填 文章/目录/外链文章的标题
article_parent 0 string - 必填 文章/目录/外链文章的父类节点
article_node 0 string - 必填 创建的类型 0: 文章 1:目录 2:外链文章
using_api_tool 0 string - 必填 是否开启API工具。0:暂停 1:启用 (建议选0)
editor 0 string - 必填 编辑器类型 0:富文本编辑器 1:MD编辑器
content API文章示例内容 string - 必填 富文本的内容
article_listsort 0 string - 非必填 文章/目录/外链文章排序值
article_mark - string - 非必填 文章的标记ID,留空则随机生成ID

MD编辑器API格式

{
    "id": "21",
    "article_title": "API文章",
    "article_parent": "0",
    "article_node": "0",
    "using_api_tool": "0",
    "editor": "1",
    "md": "我是MD编辑器",
    "html" : "<p>我是MD编辑器</p>",
    "article_listsort": "0",
    "article_mark": ""
}
参数 示例值 类型 默认值 是否必填 描述
id 21 string - 必填 文档ID (必须是字符串)
article_title API目录 string - 必填 文章/目录/外链文章的标题
article_parent 0 string - 必填 文章/目录/外链文章的父类节点
article_node 0 string - 必填 创建的类型 0: 文章 1:目录 2:外链文章
using_api_tool 0 string - 必填 是否开启API工具。0:暂停 1:启用 (建议选0)
editor 1 string - 必填 编辑器类型 0:富文本编辑器 1:MD编辑器
md 我是MD编辑器 string - 必填 MD编辑器的内容
html 我是MD编辑器 string - 必填 MD格式转HTML的内容,预留给切换用
article_listsort 0 string - 非必填 文章/目录/外链文章排序值
article_mark - string - 非必填 文章的标记ID,留空则随机生成ID

成功

成功时返回的结构

{
  "status": 200,
  "msg": "新增文档完成",
  "data": {
    "refresh": 1,
    "aid": "218",
    "mark": "665077785147998208",
    "url": "/?g=Doc&m=Article&a=index&id=21&aid=665077785147998208"
  },
  "url": "",
  "waitSecond": "3",
  "token": "619c6212460e47372c18e529a8fdf34e_8443122381624"
}

返回参数说明

参数 类型 描述
aid string 创建成功的文章/目录/外链文章ID值
mark string 创建成功的文章/目录/外链文章标记ID值
0 人点赞过