hosting
PUT /v1/sites/{siteId}/crawler-policy
Set a site's SEO-crawler-blocking policy.
Pagpapatotoo
Magpadala ng API key bilang isang bearer token. Kailangang taglayin ng key ang pahintulot na sites.crawler.manage; ang key na wala nito ay tatanggihan gamit ang 403, hindi 404.
Ang endpoint na ito ay hindi nangangailangan ng id ng organisasyon. Natutukoy na ng iyong key ang organisasyong kinabibilangan nito, at nakatuon ang tugon dito.
Subukan ito
Palitan ang anuman sa loob ng mga panaklong na may anggulo ng iyong sariling mga halaga, at ang placeholder ng key na may key mula sa iyong dashboard.
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[]> }'Nakalagda? Ang API console sa iyong dashboard ay awtomatikong naglalagay ng iyong tunay na ID ng organisasyon at sariling susi, at pinapatakbo ang kahilingan laban sa live na API upang makita mo ang aktwal na tugon. Buksan ang endpoint na ito sa console ng API
Mga Detalye
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`.
Mga Parameter
| Pangalan | Uri | Kailangan | Ano ito |
|---|---|---|---|
siteId (path) | Uuid | Oo | Site ID (UUIDv7). |
Katawan ng kahilingan
| Pangalan | Uri | Kailangan | Ano ito |
|---|---|---|---|
blocked | string[] | Oo | 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 | Hindi | — |
ip_deny | boolean | Hindi | — |
Tugon
| Pangalan | Uri | Kailangan | Ano ito |
|---|---|---|---|
site_id | Uuid | Oo | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
policy | CrawlerPolicy | Oo | — |
available_crawlers | CrawlerCatalogEntry[] | Oo | — |
rendered | CrawlerPolicyRendered | Oo | The rendered rule artifacts for the worker / Zinn® plugin to write. |
enforcement | CrawlerEnforcement | Hindi | 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… |
Mga error na maibabalik ng endpoint na ito
401 · 403 · 404 · 422 · 429