hosting

PUT /v1/sites/{siteId}/cms-target

Tell us where this site's posts should go.

Всички крайни точки в hosting

Всички документи за разработчици

Упълномощаване

Изпратете API ключ като носител (bearer token). Тази точка за достъп не указва конкретно разрешение в спецификацията, затова дайте на ключа си най-малкото необходимо и проверете отговора, вместо да правите предположения.

Този ендпойнт не изисква идентификатор на организация. Вашият ключ вече идентифицира организацията, към която принадлежи, и отговорът е ограничен до нея.

Опитайте

Заменете всичко в квадратни скоби със собствени стойности, а ключовия заместващ символ – с ключ от вашето табло за управление.

curl -X PUT https://api.zinndigital.com/v1/sites/{siteId}/cms-target \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "kind": <string<wordpress, headless_rest, git_static>> }'

Влязохте ли в профила си? API конзолата във вашето табло за управление попълва действителното идентификационно число на вашата организация и вашия собствен ключ и изпълнява заявката спрямо реалното API, за да можете да видите действителния отговор. Отворете този крайpoint в API конзолата

Детайли

Creates or replaces the site's content target. Gated on links.edit. ⛔ secret is write-only, and omitting it keeps the credential you already have rather than clearing it — a customer editing a collection name must not silently delete their key. The secret is written to Vault before the row is saved, and the row is only written if that succeeded: the other order leaves a row that reads as configured on every screen and fails at the first publish.

Параметри

ИмеТипЗадължителноКакво представлява
siteId (path)stringДа

Тяло на заявката

ИмеТипЗадължителноКакво представлява
kindstring<wordpress, headless_rest, git_static>Да
presetstring<, payload, strapi, directus, ghost, shopify, webflow, custom>Не
base_urlstringНе
collectionstringНе
auth_schemestring<, bearer, payload_api_key, ghost_admin_jwt, shopify_token, header>Не
auth_headerstringНе
field_mapobjectНе
enabledbooleanНе
secretstringНеThe API key. ⛔ Write-only, and omitting it keeps the credential you already have rather than clearing it. It is written to Vault before the row is saved, and the row is only…

Отговор

ИмеТипЗадължителноКакво представлява
site_idstringДа
kindstring<, wordpress, headless_rest, git_static>ДаEmpty when nothing claims this site. For a site with no configured row this is the derived target — most WordPress sites on our own fleet need no configuration at all, because…
presetstring<, payload, strapi, directus, ghost, shopify, webflow, custom>Да
base_urlstringДаThe CMS's API root. Empty for a target whose address is derived from the site (fleet WordPress, a connected Git repository).
collectionstringДаThe collection posts are created in — posts on Payload, a blog id on Shopify, a collection id on Webflow, the content directory on a Git target.
auth_schemestring<, bearer, payload_api_key, ghost_admin_jwt, shopify_token, header>Да
auth_headerstringДаFor the header auth scheme — which header the key is sent in.
field_mapobjectДаRenames, for a destination that spells our fields differently. ⛔ It renames; it never adds a capability. A field map cannot make a target able to carry a tag it has no field…
enabledbooleanДаA disabled target is skipped and reads as needs_setup — kept rather than deleted so pausing publishing to a site does not lose its set-up.
has_credentialbooleanДа
capabilitiesstring[]Да
detected_identitystringДаWhat the destination said it was, last time it answered.
last_probe_atstringДа
last_probe_reachablebooleanДаnull means never probed; false means probed and could not be reached. Those are different facts and a client must not render them the same.
last_probe_codestringДа
last_probe_detailstringДа

Грешки, които този крайpoint може да върне

401 · 403 · 404 · 422