菜单

创建栏目/文章

下载

用于创建文档或栏目

请求方式 请求地址
POST https://api.helplook.net/api/content
Content-Type application/json
 
:id  要更新的文章ID
 
参数说明:
 
body类型:application/json
 
参数名 类型 必填 说明
type int 文档类型:1-栏目 2-文章
name string 文章/栏目名称
parent_id int 父级id 0-表示最顶级目录(默认)
content string 文章内容/栏目描述
status int

发布状态:1-发布 2-草稿

editor_type int 编辑器类型: 2-markdown 3-富文本编辑器
version_id int 版本ID,文章版本列表获取, 未传为主版本
 
 
 
body:application/json

示例:创建文章

{
    "type": "2",
    "name": "测试文章2",
    "parent_id": "8164683",
    "content": "hello world",
    "status": "1",
    "editor_type": "3",
    "version_id": "0"
}

示例:创建栏目

{
    "type": "1",
    "name": "测试栏目",
    "parent_id": "8164683",
    "content": "hello world",
    "status": "1",
    "editor_type": "3",
    "version_id": "0"
}

 

CURL示例:

curl --location --request POST 'https://api.helplook.net/api/content' \
--header 'x-api-key: API KEY' \
--header 'Content-Type: application/json' \
--header 'Accept: */*' \
--header 'Connection: keep-alive' \
--data-raw '{
    "type": "2",
    "name": "测试文章2",
    "parent_id": "8164683",
    "content": "hello world",
    "status": "1",
    "editor_type": "3",
    "version_id": "0"
}'

响应:

参数名  
id 文章id
string_id 文章字符串id
status 文章状态: 1-已发布(线上) 2-草稿(下线)
type
类型: 1-栏目 2-文章
id 此次问答的id(问答记录id)
name 文章/栏目名称
slug 文章的路径 https://站点域名/docs/:slug
add_time 创建时间
update_time 更新时间
content 已发布的文章内容(线上访客看到的文章内容)
draft_content

未发布或草稿内容

响应示例:

{
    "data": {
        "id": "8161504",
        "string_id": "vuLVJ8",
        "status": "1",
        "is_del": "0",
        "type": "2",
        "name": "新文章名",
        "slug": "11-yong-hu-xin-xi-mu-ban-s4eQ",
        "add_time": "1725517672",
        "update_time": "1734420390",
        "content": {
            "content_id": "8161504",
            "content": "<h1>hello world2</h1>",
            "pure_content": "hello world2",
            "is_draft": "0",
            "editor_type": "3",
            "file_path": "",
            "add_time": "1725517673",
            "update_time": "1734420390"
        },
        "draft_content": {
            "content_id": "8161504",
            "content": "<h1>hello world2</h1>",
            "pure_content": "hello world2",
            "is_draft": "0",
            "editor_type": "3",
            "file_path": "",
            "add_time": "1725517673",
            "update_time": "1734420390"
        }
    },
    "msg": "Success",
    "code": 200
}
上一个
获取内容详情
下一个
更新栏目/文章
最近修改: 2025-03-25Powered by