Blog Article Update API 文档

博客文章-更新(全量更新)

接口信息

  • 接口地址: {your-site-url}/api/skill/blog-article/update
  • 基础 URL: {your-site-url} 需替换为你自己的独立站 URL 地址,如 https://your-domain.com/apimanager666
  • 请求方式: POST
  • Content-Type: application/json
  • 说明: 此接口用于更新博客文章

认证

请求头中需要携带 skill-access-token

Header
skill-access-token {your-skill-access-token} (请替换为你自己的 token)

与创建文章的区别

不同点 创建文章 更新文章
id 无此字段 ✅ 必填

其余字段与创建文章一致。


请求参数 (Body - JSON)

基础字段

字段 类型 必填 说明
id int ✅ 必填 文章 ID
title string ✅ 必填 文章标题
handle string 选填 文章 URL handle。如果与已有 handle 冲突,会自动追加随机后缀
author string 选填 作者名称
body_html string 选填 文章正文(HTML)
summary_html string 选填 文章简短描述(摘要)

封面图片

字段 类型 必填 说明
image string 选填 文章封面图 URL
width int 选填 封面图宽度(像素)
height int 选填 封面图高度(像素)
ratio decimal 选填 封面图宽高比
image_show_type int 选填 封面图展示方式。1 显示在顶部,2 显示在底部,3 不显示

发布状态

字段 类型 必填 说明
is_published int 选填 是否发布。1 已发布,2 未发布。默认 1
published_at int 选填 发布时间(时间戳)

SEO 字段

字段 类型 必填 说明
meta_title string 选填 SEO 标题
meta_keywords string 选填 SEO 关键字
meta_description string 选填 SEO 描述
meta_is_edit int 选填 SEO 是否独立编辑。1 非独立编辑,2 独立编辑

关联字段

字段 类型 必填 说明
product_ids Array[int] 选填 关联商品 ID 数组。绑定后在前台文章详情页底部显示商品内容
collection_ids Array[int] 选填 关联专辑 ID 数组

其他字段

字段 类型 必填 说明
translate_type int 选填 翻译方式。1 强制翻译,2 只翻译多语言为空的部分,3 不翻译
template_type string 选填 模板布局样式(通过 get-template-types 接口获取,page_type=blog_article
description_json Array 选填 JSON 描述内容
description_json_status int 选填 描述是否使用 JSON 字段。1 开启,2 关闭
remote_id string 选填 远程 ID,一般用于数据同步

请求示例

cURL

curl --location --request POST '{your-site-url}/api/skill/blog-article/update' \
--header 'skill-access-token: {your-skill-access-token}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "id": 473,
    "author": "yu zhang",
    "handle": "fecify-article-3",
    "title": "封面在顶部",
    "summary_html": "",
    "body_html": "<p>fecify article 3</p>",
    "meta_title": "封面在顶部",
    "meta_keywords": "",
    "meta_description": "fecify article 3",
    "meta_is_edit": 1,
    "translate_type": 3,
    "image": "/blog_article/15/image/2026/02/08/3443b7accccc9b7f1bb993b23e2f7bdd.webp",
    "width": 1024,
    "height": 1024,
    "ratio": "1.00",
    "is_published": 1,
    "published_at": "2026-02-08 22:19:08",
    "product_ids": [],
    "collection_ids": [123, 125],
    "image_show_type": 1,
    "template_type": ""
}'

返回结果

code200 表示调用成功;code 不为 200 表示调用失败。

成功响应

{
    "code": 200,
    "data": {
        "id": 473,
        "shop_id": 15,
        "user_id": 0,
        "author": "yu zhang",
        "handle": "fecify-article-3-m49fsg6u",
        "title": "封面在顶部",
        "summary_html": "",
        "body_html": "<p>fecify article 3</p>",
        "meta_title": "封面在顶部",
        "meta_keywords": "",
        "meta_description": "fecify article 3",
        "meta_is_edit": 1,
        "translate_type": 3,
        "image": "/blog_article/15/image/2026/02/08/3443b7accccc9b7f1bb993b23e2f7bdd.webp",
        "width": 1024,
        "height": 1024,
        "ratio": "1.00",
        "is_published": 1,
        "published_at": "2026-02-08 22:19:08",
        "created_at": "2026-05-11 17:40:00",
        "updated_at": "2026-05-11 17:57:42",
        "remote_id": "",
        "product_id": 0,
        "product_ids": "",
        "description_json_status": 2,
        "description_json": "",
        "image_show_type": 1,
        "template_type": ""
    },
    "message": "success"
}

返回字段说明

字段 类型 说明
code Number 状态码,200 表示成功
message String 执行结果的文字描述
data.id int 文章 ID
data.shop_id int 店铺 ID
data.user_id int 创建用户 ID
data.author string 作者名称
data.handle string 文章 URL handle(若冲突自动追加随机后缀)
data.title string 文章标题
data.summary_html string 文章简短描述(摘要)
data.body_html string 文章正文(HTML)
data.image string 封面图 URL
data.width int 封面图宽度
data.height int 封面图高度
data.ratio string 封面图宽高比
data.image_show_type int 封面图展示方式。1 显示在顶部,2 显示在底部,3 不显示
data.meta_title string SEO 标题
data.meta_keywords string SEO 关键字
data.meta_description string SEO 描述
data.meta_is_edit int SEO 是否独立编辑。1 非独立编辑,2 独立编辑
data.is_published int 发布状态。1 已发布,2 未发布
data.published_at int 发布时间(时间戳)
data.product_id int 关联的单个商品 ID(已废弃)
data.product_ids Array/string 关联的商品 ID 数组
data.translate_type int 翻译方式
data.template_type string 模板布局样式
data.description_json_status int 描述是否使用 JSON 字段。1 开启,2 关闭
data.description_json Array/string JSON 描述内容
data.remote_id string 远程 ID,一般用于数据同步
data.created_at string 创建时间
data.updated_at string 更新时间

注意事项

  1. idtitle 为必填
  2. 字段说明与创建文章一致,详细参考创建文章 API 文档
  3. handle 冲突时会自动追加随机后缀
  4. product_ids 绑定商品后,前台文章详情页底部将展示关联商品
Copyright © fecify.com 2025 all right reserved,powered by Gitbook该文件修订时间: 2026-05-11 21:57:35

results matching ""

    No results matching ""