hosting
PUT /v1/sites/{siteId}/crawler-policy
Set a site's SEO-crawler-blocking policy.
Pengesahan
Hantar kunci API sebagai token pembawa. Kunci tersebut mesti membawa kebenaran sites.crawler.manage; kunci yang tidak mempunyainya akan ditolak dengan 403, bukan 404.
Titik akhir ini tidak memerlukan id organisasi. Kunci anda telah mengenal pasti organisasi kepunyaannya, dan respons dis skopkan kepadanya.
Cuba
Gantikan apa sahaja di dalam kurungan sudut dengan nilai anda sendiri, dan pemegang tempat kunci dengan kunci dari papan pemuka anda.
curl -X PUT https://api.zinndigital.com/v1/sites/{siteId}/crawler-policy \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "blocked": <string[]> }'Sudah log masuk? Konsol API dalam papan pemuka anda mengisi id organisasi sebenar dan kunci anda sendiri, serta menjalankan permintaan terhadap API langsung supaya anda boleh melihat respons sebenar. Buka penamat ini dalam konsol API
Butiran
Set which SEO crawlers to block (`blocked` is a list of crawler keys from the catalog). An unknown key is a `422`; a search engine has no key, so it can never be blocked. Publishes `site.crawler_policy_changed` so the server-level rules are re-written. Requires `sites.crawler.manage`.
Parameter
| Nama | Jenis | Diperlukan | Apakah ia |
|---|---|---|---|
siteId (path) | Uuid | Ya | Site ID (UUIDv7). |
Badan permintaan
| Nama | Jenis | Diperlukan | Apakah ia |
|---|---|---|---|
blocked | string[] | Ya | Crawler keys to block (from the catalog's `available_crawlers`). An unknown key is a 422; a search engine has no key and can never be blocked. |
robots_txt | boolean | Tidak | — |
ip_deny | boolean | Tidak | — |
Respons
| Nama | Jenis | Diperlukan | Apakah ia |
|---|---|---|---|
site_id | Uuid | Ya | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
policy | CrawlerPolicy | Ya | — |
available_crawlers | CrawlerCatalogEntry[] | Ya | — |
rendered | CrawlerPolicyRendered | Ya | The rendered rule artifacts for the worker / Zinn® plugin to write. |
enforcement | CrawlerEnforcement | Tidak | Whether the stored crawler policy is actually a rule on a web server, and if not why not (#1954, D8300). ⛔ These are two different questions and collapsing them is the defect th… |
Ralat yang boleh dikembalikan oleh titik akhir ini
401 · 403 · 404 · 422 · 429