按请求顺序通过 ID 获取区块,并解析图像引用。
根据 ID 为某个网站获取区块,并将图像引用解析为 URL。区块将按请求中的 ids 顺序返回;未知的 ID 将被静默跳过。
认证: API 密钥(x-api-key 请求头或 api_key 查询参数)。
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
websiteId | uuid | 否 | 目标网站;回退到 Host 请求头/配置。 |
ids | string | 否 | 用逗号分隔的区块 UUID。为空或缺失时 → []。 |
api_key | string | 否 | x-api-key 请求头的替代方案。 |
区块的 JSON 数组:
[
{
"id": "...",
"website_id": "...",
"schema_id": "...",
"draft_content": {},
"published_content": {},
"state": "published",
"version": 3,
"schema_name": "hero-block",
"layout": {},
"cloned_from_id": null,
"created_at": "2026-06-23T18:34:16Z",
"updated_at": "2026-06-23T20:36:55Z"
}
]
curl '{CMS_API_URL}/blocks?websiteId=<uuid>&ids=<id1>,<id2>' \
-H 'x-api-key: <key>'
400 — ids 中的 UUID 无效,或网站无法解析401 — API 密钥无效