hosting
GET /v1/sites/{siteId}/cdn/canonical-host
Which hostname serves, which redirects, and whether HTTPS is forced.
Xác thực
Gửi khóa API dưới dạng mã thông báo bearer. Khóa này phải có quyền sites.view; khóa không có quyền này sẽ bị từ chối với mã lỗi 403, không phải 404.
Endpoint này không nhận ID tổ chức. Khóa của bạn đã xác định tổ chức mà nó thuộc về và phản hồi được giới hạn trong phạm vi đó.
Dùng thử
Thay thế bất kỳ nội dung nào trong ngoعل (angle brackets) bằng giá trị của riêng bạn và trình giữ chỗ key bằng một key từ trang tổng quan của bạn.
curl -X GET https://api.zinndigital.com/v1/sites/{siteId}/cdn/canonical-host \
-H "Authorization: Bearer zdk_live_…"Đã đăng nhập? Bảng điều khiển API trong trang quản lý của bạn sẽ tự điền ID tổ chức thực tế và khóa của riêng bạn, sau đó chạy yêu cầu đối với API trực tiếp để bạn có thể xem phản hồi thực tế. Mở điểm cuối này trong bảng điều khiển API
Chi tiết
Returns the whole serving plan rather than the two stored flags: the host that serves, the host that `301`s to it, and **every hostname the edge certificate must cover**. A client given only `canonical_host` would have to work out the alias itself, and two implementations of "what is the other hostname" is exactly the drift the engine-owns-policy rule exists to prevent. `certificate_hosts` always contains **both** names, and that is the half that is invisible when testing in a browser. TLS is negotiated on the name being redirected *from*, so a certificate covering only the canonical host puts a full-page security interstitial in front of the alias and the visitor never reaches the redirect at all. Requires `sites.view`.
Tham số
| Tên | Loại | Bắt buộc | Nội dung này là gì |
|---|---|---|---|
siteId (path) | Uuid | Có | Site ID (UUIDv7). |
Phản hồi
| Tên | Loại | Bắt buộc | Nội dung này là gì |
|---|---|---|---|
canonical_host | string<apex, www> | Có | — |
force_https | boolean | Có | Redirect http to https at the edge. Defaults to true on every new site. |
serves_on | string | Có | The hostname that actually serves. |
redirects_from | string | Có | The hostname that permanently redirects to `serves_on`. |
redirect_status | integer | Có | 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[] | Có | **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> | Có | 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 | Có | `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… |
Các lỗi điểm cuối này có thể trả về
401 · 403 · 404 · 422 · 429