hosting
PUT /v1/sites/{siteId}/wordpress/themes/{themeName}
Activate or deactivate a theme on a site.
Pagpapatotoo
Magpadala ng API key bilang isang bearer token. Kailangang taglayin ng key ang pahintulot na sites.view; 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}/wordpress/themes/{themeName} \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "active": <boolean> }'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
Switches the site's active theme and returns the whole theme list. Activating a theme changes what every visitor sees immediately, so the client confirms first. Refused `422` when the package type does not carry `wp_themes`, or when WordPress is not installed. `404` for a site with no vendor hosting package. Requires `sites.view` and `sites.panel_access`.
Mga Parameter
| Pangalan | Uri | Kailangan | Ano ito |
|---|---|---|---|
siteId (path) | Uuid | Oo | Site ID (UUIDv7). |
themeName (path) | string | Oo | The theme's slug, exactly as `listSiteWordPressThemes` reports it. WordPress's identifier, not ours — percent-encode it. |
Katawan ng kahilingan
| Pangalan | Uri | Kailangan | Ano ito |
|---|---|---|---|
active | boolean | Oo | Whether the theme should be the site's active theme. |
Tugon
| Pangalan | Uri | Kailangan | Ano ito |
|---|---|---|---|
data | SiteWordPressTheme[] | Oo | The installed themes. |
Mga error na maibabalik ng endpoint na ito
401 · 403 · 404 · 409 · 422 · 429 · 503