profound-logoProfound CMS
⌘K
Admin
Theme
DocsTutorialBlogPhilosophy
DocsTutorialBlogPhilosophy

Hybrid

Collection of Pages with ComponentsTypes of ComponentsSetup server sent events (SSE) content refetchInstall Profound CMS as a proxyCEL Scripting in Template BuilderProject ScaffoldingMedia Library

Headless

Quick startJSON 与 Claude 代码组件 Zod 拉取

REST API

REST API 概览get连接网站 APIgetGET /routesgetGET /routegetGET /blocksget获取带有 CEL 缓存的区块getGET /blocks/generatedgetGET /componentsgetGET /components/{name}getGET /dataset/{schema_name}get获取内容变更 SSEpatchPATCH /dataset/{schema_name}postPOST /translationpatchPATCH /translationsgetGET /usagepostPOST /csvpatch修补 CSV
All Systems Operational
Powered Byprofound-logo
Theme

GET /route

按 URL 路径解析单个路由,支持参数化匹配并验证参数文档。

针对给定路径解析单个路由。若存在完全匹配的路径,则优先使用;否则会选择得分最高的参数化模式,验证其绑定参数对应的文档,并计算有效的内容块。可选地返回已解析的参数文档。

认证: API 密钥(x-api-key 请求头或 api_key 查询参数)。

查询参数

参数类型必填说明
websiteIduuid是目标站点。
pathstring是要解析的 URL 路径,例如 /docs/getting-started。
api_keystring否x-api-key 请求头的替代方案。
previewboolean否默认值为 false。当为 true 时,将基于草稿内容进行解析,无需已发布的文档。
skipValidationboolean否默认值为 false。当为 true 时,参数验证失败不会返回 404。

响应

{
  "route": {
    "path": "/docs/us/guide",
    "pattern": "/docs/{country}/guide",
    "block_ids": ["..."],
    "state": "Live",
    "param_bindings": { "country": "country" }
  },
  "resolvedParams": {
    "country": {
      "value": "us",
      "schemaName": "country",
      "document": { "id": "...", "schema_name": "country", "title": "United States", "published_content": {} }
    }
  }
}

route 的结构与 GET /routes 响应中的条目相同。仅当路由具有参数绑定并且至少成功解析到一个文档时才会返回 resolvedParams。绑定到 language 架构的参数会匹配内置的受支持语言列表,而不是数据库。

示例

curl '{CMS_API_URL}/route?websiteId=<uuid>&path=/docs/getting-started' \
  -H 'x-api-key: <key>'

错误

  • 400 — 缺少或无效的 websiteId,或缺少/为空的 path
  • 401 — 无效的 API 密钥
  • 404 — 未找到路由,或参数验证失败(除非 skipValidation=true)
Continue Reading
Previous‹GET /routesNextGET /blocks›