菜单

更新栏目/文章

下载

 

请求方式 请求地址
PUT https://api.helplook.net/api/content/:id
Content-Type application/json
 
:id  要更新的栏目/文章ID
 
参数说明:
 
body类型:application/json
 
参数名 类型 必填 说明
name string 文章/栏目名称
content string 文章内容/栏目描述
status int

发布状态:1-发布 2-草稿  3-待发布(不影响线上内容)

editor_type int 编辑器类型: 2-markdown 3-富文本编辑器
parent_id int 父级id 不传则不修改
 
 
 
body:application/json

示例:更新文章

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

CURL示例:

curl --location --request PUT 'https://api.helplook.net/api/content/8161504' \
--header 'x-api-key: API KEY' \
--header 'Content-Type: application/json' \
--header 'Accept: */*' \
--header 'Connection: keep-alive' \
--data-raw '{
    "name": "新文章名",
    "content": "<h1>hello world2</h1>",
    "status": "1",
    "editor_type": "3"
}'

 

响应:

参数名  
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