curl -X PATCH "https://api.scanova.io/theme/user-42-ocean-breeze-a1b2c3/update/" \
-H "Authorization: 401f7ac837da42b97f613d789819ff93537bee6a" \
-H "Content-Type: application/json" \
-d '{
"config_json": { "color": { "accent": "#005f99" } },
"clear_conflicting_overrides": true
}'
{
"id": 7,
"name": "Ocean Breeze",
"slug": "user-42-ocean-breeze-a1b2c3",
"description": "A cool blue palette.",
"config_json": { "color": { "accent": "#005f99", "background": "#f0f8ff" }, "font": { "heading": "Inter" } },
"schema_version": 2,
"category_hints": ["website-url", "vcard"],
"thumbnail_url": "https://cdn.scanova.io/themes/7/thumb.png",
"is_system": false,
"is_premium": false,
"order": 0
}
主题与页面模板
更新主题
PATCH /theme//update/
PATCH
/
theme
/
{slug}
/
update
/
curl -X PATCH "https://api.scanova.io/theme/user-42-ocean-breeze-a1b2c3/update/" \
-H "Authorization: 401f7ac837da42b97f613d789819ff93537bee6a" \
-H "Content-Type: application/json" \
-d '{
"config_json": { "color": { "accent": "#005f99" } },
"clear_conflicting_overrides": true
}'
{
"id": 7,
"name": "Ocean Breeze",
"slug": "user-42-ocean-breeze-a1b2c3",
"description": "A cool blue palette.",
"config_json": { "color": { "accent": "#005f99", "background": "#f0f8ff" }, "font": { "heading": "Inter" } },
"schema_version": 2,
"category_hints": ["website-url", "vcard"],
"thumbnail_url": "https://cdn.scanova.io/themes/7/thumb.png",
"is_system": false,
"is_premium": false,
"order": 0
}
在 Management API 主机(
仅支持
api.scanova.io)上更新账户拥有的主题,使用您的原始 Management API 密钥进行身份验证。
PATCH https://api.scanova.io/theme/{slug}/update/
Authorization: 401f7ac837da42b97f613d789819ff93537bee6a
string
必填
主题的
slug。string
新的主题名称。
object
遵循 ThemeConfigV2 模式的新设计令牌。
boolean
设为
true 时,会从当前使用此主题的每个 QR 码中,清除与您正在更改的字段冲突的按 QR 覆盖项(theme_overrides)——这样此处的编辑就不会遗留过时的按 QR 覆盖项将其遮蔽。curl -X PATCH "https://api.scanova.io/theme/user-42-ocean-breeze-a1b2c3/update/" \
-H "Authorization: 401f7ac837da42b97f613d789819ff93537bee6a" \
-H "Content-Type: application/json" \
-d '{
"config_json": { "color": { "accent": "#005f99" } },
"clear_conflicting_overrides": true
}'
{
"id": 7,
"name": "Ocean Breeze",
"slug": "user-42-ocean-breeze-a1b2c3",
"description": "A cool blue palette.",
"config_json": { "color": { "accent": "#005f99", "background": "#f0f8ff" }, "font": { "heading": "Inter" } },
"schema_version": 2,
"category_hints": ["website-url", "vcard"],
"thumbnail_url": "https://cdn.scanova.io/themes/7/thumb.png",
"is_system": false,
"is_premium": false,
"order": 0
}
PATCH(不支持 PUT)。此端点仅可写入账户自己的非系统主题——系统主题或其他账户的主题会返回 404,如同该主题不存在一般,即使获取主题能够读取它。如果 config_json 未通过模式验证,则返回 400。
相关内容
- 获取主题——更新前先查看。
- 获取主题使用情况统计——在编辑前检查哪些内容正在使用此主题。
- Management API 概览——适用于此端点的身份验证方案和配额规则。
授权
Send your Management API key as the raw value of the Authorization header — no "Bearer " or "Token " prefix, and no other characters. Example: Authorization: 401f7ac837da42b97f613d789819ff93537bee6a. A header containing more than one space-separated part is rejected outright. Requests also require the request's Host header to be the management API host (e.g. api.scanova.io) — the same key sent to the regular API host will not authenticate.
路径参数
响应
Theme updated.
此页面对您有帮助吗?