๋ธ๋ก์ ๊ฐ์ ธ์ค๊ณ ํ๊ฐ๋ ํ๋ ์์ค CEL ์คํฌ๋ฆฝํธ๋ฅผ ๊ฒ์๋ ์ฝํ ์ธ ์ ๋ณํฉํฉ๋๋ค.
GET /blocks์ ์ ์ฌํ์ง๋ง, ๊ฐ ๋ธ๋ก์ ๋ฑ๋ก๋ ํ๋ ์์ค CEL ์คํฌ๋ฆฝํธ๋ฅผ ์ถ๊ฐ๋ก ํ๊ฐํ๊ณ ๊ทธ ๊ฒฐ๊ณผ๋ฅผ ๊ฐ ๋ธ๋ก์ published_content์ ๋ณํฉํฉ๋๋ค. ๋ธ๋ก์ ๊ณ์ฐ๋ ํ๋๊ฐ ํฌํจ๋์ด ์์ ๋ ์ฌ์ฉํ์ธ์.
์ธ์ฆ: API ํค (x-api-key ํค๋ ๋๋ api_key ์ฟผ๋ฆฌ ๋งค๊ฐ๋ณ์).
| ๋งค๊ฐ๋ณ์ | ์ ํ | ํ์ | ์ค๋ช |
|---|---|---|---|
websiteId | uuid | ์๋์ | ๋์ ์น์ฌ์ดํธ; ์ง์ ํ์ง ์์ผ๋ฉด Host ํค๋/๊ตฌ์ฑ์ผ๋ก ๋์ฒด๋ฉ๋๋ค. |
blockIds | string | ์๋์ | ์ผํ๋ก ๊ตฌ๋ถ๋ ๋ธ๋ก UUID. ์ฐธ๊ณ : ids๊ฐ ์๋๋ผ blockIds์
๋๋ค. |
routePath | string | ์๋์ | CEL meta ์ปจํ
์คํธ์ ์ฌ์ฉํ ๋ผ์ฐํธ ๊ฒฝ๋ก. |
params | string | ์๋์ | ๋ผ์ฐํธ ๋งค๊ฐ๋ณ์์ URL ์ธ์ฝ๋ฉ๋ JSON ๊ฐ์ฒด(์: {"code":"JFK"}). |
locale | string | ์๋์ | meta.locale ๋ฐ ๋ฒ์ญ ์กฐํ์ ์ฌ์ฉํ ๋ก์ผ์ผ. ๊ธฐ๋ณธ๊ฐ์ en์
๋๋ค. |
api_key | string | ์๋์ | x-api-key ํค๋์ ๋์์
๋๋ค. |
{
"blocks": [
{
"id": "...",
"schema_name": "hero-block",
"published_content": {},
"cached_fields": ["hero.title", "hero.subtitle"]
}
]
}
๊ฐ ์์๋(๋ชจ๋ GET /blocks์ ๋์ผํ ํ๋๋ฅผ ๊ฐ๋) ๋ธ๋ก์ด๋ฉฐ, CEL๋ก ์ฑ์์ง ๋ํธ ๊ฒฝ๋ก๋ฅผ ๋์ดํ๋ ์ ํ์ cached_fields ๋ฐฐ์ด์ด ์ถ๊ฐ๋ฉ๋๋ค. ์๋ฌด ๊ฒ๋ ๊ณ์ฐ๋์ง ์์ ๊ฒฝ์ฐ cached_fields๋ ์๋ต๋ฉ๋๋ค. ๋ธ๋ก์ published_content๊ฐ null์ด ์๋ ๊ฒฝ์ฐ์๋ง CEL์ด ๋ณํฉ๋ฉ๋๋ค.
curl '{CMS_API_URL}/blocks/with-cel-cache?websiteId=<uuid>&blockIds=<id1>,<id2>&locale=en' \
-H 'x-api-key: <key>'
400 โ blockIds์ ์๋ชป๋ UUID๊ฐ ์๊ฑฐ๋ ์น์ฌ์ดํธ๋ฅผ ํด์ํ ์ ์์401 โ ์๋ชป๋ API ํค500 โ CEL ์์ง ์ค๋ฅ