hosting
PATCH /v1/sites/{siteId}/cdn/canonical-host
Choose www or non-www, and whether to force HTTPS.
Упълномощаване
Изпратете API ключ като токен за носене. Ключът трябва да притежава разрешението hosting.cdn.manage; ключ без него се отхвърля с 403, а не с 404.
Този ендпойнт не изисква идентификатор на организация. Вашият ключ вече идентифицира организацията, към която принадлежи, и отговорът е ограничен до нея.
Опитайте
Заменете всичко в квадратни скоби със собствени стойности, а ключовия заместващ символ – с ключ от вашето табло за управление.
curl -X PATCH https://api.zinndigital.com/v1/sites/{siteId}/cdn/canonical-host \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ }'Влязохте ли в профила си? API конзолата във вашето табло за управление попълва действителното идентификационно число на вашата организация и вашия собствен ключ и изпълнява заявката спрямо реалното API, за да можете да видите действителния отговор. Отворете този крайpoint в API конзолата
Детайли
A **merge**: only the fields present in the body change. An absent field is left alone rather than reset, so a client written before one of these existed cannot switch it off on every save. `force_https` defaults to `true` on every new site. The insecure choice has to be made explicitly; it is never reached by omitting a field. A site whose primary domain is a **deeper subdomain** (`shop.blog.example.com`) has no `www` counterpart, and the request is a `422` rather than a stored preference whose plan can never be built. Refusing at write time is deliberate: the alternative saves cleanly and then fails later inside provisioning, where the customer sees a stuck deploy instead of the bad input. An empty body is a `422`, not a no-op success. Requires `hosting.cdn.manage`.
Параметри
| Име | Тип | Задължително | Какво представлява |
|---|---|---|---|
siteId (path) | Uuid | Да | Site ID (UUIDv7). |
Тяло на заявката
| Име | Тип | Задължително | Какво представлява |
|---|---|---|---|
canonical_host | string<apex, www> | Не | — |
force_https | boolean | Не | — |
Отговор
| Име | Тип | Задължително | Какво представлява |
|---|---|---|---|
canonical_host | string<apex, www> | Да | — |
force_https | boolean | Да | Redirect http to https at the edge. Defaults to true on every new site. |
serves_on | string | Да | The hostname that actually serves. |
redirects_from | string | Да | The hostname that permanently redirects to `serves_on`. |
redirect_status | integer | Да | Always 301. A 302 tells search engines to keep indexing the alias, which leaves the duplicate-content problem unsolved while looking correct in a browser. |
certificate_hosts | string[] | Да | **Both** hostnames, always. TLS is negotiated on the name being redirected from, so a certificate covering only `serves_on` puts a security interstitial in front of the alias an… |
apex_delivery | string<native, alias, a_records, unsupported> | Да | How the zone apex is made to resolve. A bare apex cannot be a `CNAME`, so on a pull-zone CDN it resolves only through CNAME-flattening/ALIAS at the DNS provider, or through A/AA… |
apex_deliverable | boolean | Да | `false` when neither mechanism is available for this CDN/DNS pairing. The combination is refused rather than accepted, because the alternative provisions cleanly, reports health… |
Грешки, които този крайpoint може да върне
401 · 403 · 404 · 422 · 429