curl -X POST "https://api.scanova.io/page-template/" \
-H "Authorization: 401f7ac837da42b97f613d789819ff93537bee6a" \
-H "Content-Type: application/json" \
-d '{
"name": "My Landing Page",
"description": "A custom page.",
"blocks_json": [{ "type": "hero" }],
"theme": 7,
"accent_color": "#0077be",
"preview_bg": "#f0f8ff"
}'
{
"id": 9,
"name": "My Landing Page",
"slug": "user-42-my-landing-page-d4e5f6",
"description": "A custom page.",
"category": null,
"theme": {
"id": 7,
"name": "Ocean Breeze",
"slug": "user-42-ocean-breeze-a1b2c3",
"description": "A cool blue palette.",
"config_json": { "color": { "accent": "#0077be", "background": "#f0f8ff" } },
"schema_version": 2,
"category_hints": ["website-url"],
"thumbnail_url": "https://cdn.scanova.io/themes/7/thumb.png",
"is_system": false,
"is_premium": false,
"order": 0
},
"blocks_json": [{ "type": "hero" }],
"filter_tags": [],
"accent_color": "#0077be",
"preview_bg": "#f0f8ff",
"thumbnail_url": null,
"is_premium": false,
"is_system": false,
"is_favourited": false,
"order": 0
}
主题与页面模板
创建页面模板
POST /page-template/
POST
/
page-template
/
curl -X POST "https://api.scanova.io/page-template/" \
-H "Authorization: 401f7ac837da42b97f613d789819ff93537bee6a" \
-H "Content-Type: application/json" \
-d '{
"name": "My Landing Page",
"description": "A custom page.",
"blocks_json": [{ "type": "hero" }],
"theme": 7,
"accent_color": "#0077be",
"preview_bg": "#f0f8ff"
}'
{
"id": 9,
"name": "My Landing Page",
"slug": "user-42-my-landing-page-d4e5f6",
"description": "A custom page.",
"category": null,
"theme": {
"id": 7,
"name": "Ocean Breeze",
"slug": "user-42-ocean-breeze-a1b2c3",
"description": "A cool blue palette.",
"config_json": { "color": { "accent": "#0077be", "background": "#f0f8ff" } },
"schema_version": 2,
"category_hints": ["website-url"],
"thumbnail_url": "https://cdn.scanova.io/themes/7/thumb.png",
"is_system": false,
"is_premium": false,
"order": 0
},
"blocks_json": [{ "type": "hero" }],
"filter_tags": [],
"accent_color": "#0077be",
"preview_bg": "#f0f8ff",
"thumbnail_url": null,
"is_premium": false,
"is_system": false,
"is_favourited": false,
"order": 0
}
在 Management API 主机(
api.scanova.io)上保存一个新的页面模板,使用您的原始 Management API 密钥进行身份验证。
POST https://api.scanova.io/page-template/
Authorization: 401f7ac837da42b97f613d789819ff93537bee6a
string
必填
模板名称。空白或仅含空格的名称会被拒绝。
string
模板描述。
array
必填
页面的区块内容——可以是区块列表,也可以是包含
pages 键的字典。任何其他形状都会被拒绝。integer
与此模板关联的主题 id。如果该主题不是系统主题,则必须属于您。
string
强调色,当关联主题无法实时解析出该值时作为后备。
string
预览背景色,与
accent_color 承担相同的后备角色。curl -X POST "https://api.scanova.io/page-template/" \
-H "Authorization: 401f7ac837da42b97f613d789819ff93537bee6a" \
-H "Content-Type: application/json" \
-d '{
"name": "My Landing Page",
"description": "A custom page.",
"blocks_json": [{ "type": "hero" }],
"theme": 7,
"accent_color": "#0077be",
"preview_bg": "#f0f8ff"
}'
{
"id": 9,
"name": "My Landing Page",
"slug": "user-42-my-landing-page-d4e5f6",
"description": "A custom page.",
"category": null,
"theme": {
"id": 7,
"name": "Ocean Breeze",
"slug": "user-42-ocean-breeze-a1b2c3",
"description": "A cool blue palette.",
"config_json": { "color": { "accent": "#0077be", "background": "#f0f8ff" } },
"schema_version": 2,
"category_hints": ["website-url"],
"thumbnail_url": "https://cdn.scanova.io/themes/7/thumb.png",
"is_system": false,
"is_premium": false,
"order": 0
},
"blocks_json": [{ "type": "hero" }],
"filter_tags": [],
"accent_color": "#0077be",
"preview_bg": "#f0f8ff",
"thumbnail_url": null,
"is_premium": false,
"is_system": false,
"is_favourited": false,
"order": 0
}
slug 由服务器生成。创建后会异步生成缩略图——thumbnail_url 起始为 null,生成完成后会被填充。
如果 name 为空、blocks_json 格式错误,或 theme 既不是系统主题也不属于您,则返回 400。
相关内容
- 列出页面模板——查看已保存的模板(
?mine=true)。 - 更新页面模板——编辑现有模板。
- 创建主题——创建一个主题,以便通过
theme关联。 - 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.
响应
Template created.
此页面对您有帮助吗?