hosting
PATCH /v1/sites/{siteId}/cdn/canonical-host
Choose www or non-www, and whether to force HTTPS.
प्रमाणीकरण
बेरर टोकन म्हणून API की पाठवा. की मध्ये hosting.cdn.manage परवानगी असणे आवश्यक आहे; ती नसलेली की 404 ऐवजी 403 सह नाकारली जाते.
या एंडपॉइंटला कोणतीही संस्था आयडी (organisation id) लागत नाही. तुमची की (key) आधीच ती कोणत्या संस्थेशी संबंधित आहे हे ओळखते आणि प्रतिसाद त्यानुसार मर्यादित केला जातो.
प्रयत्न करा
कोनसांस्कृतिक कंसात (<>) असलेली कोणतीही गोष्ट तुमच्या स्वतःच्या मूल्यांनी बदला आणि key प्लेसहोल्डरला तुमच्या डॅशबोर्डवरील किने बदला.
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 विरुद्ध विनंती कार्यान्वित करतो जेणेकरून तुम्हाला वास्तविक प्रतिसाद पाहता येईल. एपी कन्सोलमध्ये हा एंडपॉइंट उघडा
तपशील
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 and… |
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/AAAA… |
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 healthy,… |
ही एंडपॉइंट परत करू शकेल अशा त्रुटी
401 · 403 · 404 · 422 · 429