hosting

PUT /v1/sites/{siteId}/ssl/force

Turn HTTPS enforcement on or off for a site.

Tất cả các điểm cuối hosting

Tất cả tài liệu dành cho nhà phát triển

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 PUT https://api.zinndigital.com/v1/sites/{siteId}/ssl/force \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "enabled": <boolean> }'

Đã đă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

Sets whether every plain-HTTP request to the site is redirected to HTTPS, and returns the site's whole TLS state so the client re-renders from the server's answer rather than from what it asked for. PUT because the body states the desired end state: sending the same value twice is the same site. Turning enforcement on while no certificate is installed is refused 422 rather than accepted, because the redirect would send every visitor to a URL the browser then rejects — the site is not merely unchanged, it is unreachable. A package type that does not permit the setting is refused 422 before the vendor is called. 404 for a site with no vendor hosting package. Requires sites.view and hosting.ssl.manage.

Tham số

TênLoạiBắt buộcNội dung này là gì
siteId (path)UuidSite ID (UUIDv7).

Nội dung yêu cầu

TênLoạiBắt buộcNội dung này là gì
enabledbooleanWhether plain HTTP should be redirected to HTTPS. There is no third value: getSiteSsl may report force_https as null when the package does not publish the setting, but a…

Phản hồi

TênLoạiBắt buộcNội dung này là gì
availablebooleanWhether the package type exposes a certificate surface at all. False renders an explanation rather than an empty list, so "nothing has been issued yet" and "not part of this plan"…
certificatesSiteSslCertificate[]The certificates installed on the package.
force_httpsbooleanWhether plain HTTP is redirected to HTTPS, or null when the package does not report the setting. Null is a third state the client must render as unknown: an unchecked toggle would…
free_ssl_permittedbooleanWhether this package type permits requesting the free certificate. An absent vendor capability means refused, never "probably on" — the refusal is ours, in our words, before…
force_ssl_permittedbooleanWhether this package type permits changing HTTPS enforcement.
external_ssl_permittedbooleanWhether this package type permits installing a certificate the customer obtained elsewhere (installSiteExternalSsl). Reported separately from free_ssl_permitted because they…

Các lỗi điểm cuối này có thể trả về

401 · 403 · 404 · 409 · 422 · 429 · 503