hosting
POST /v1/bulk-jobs/installed-plugins
What is already installed across a bulk selection.
身份验证
请将 API 密钥作为 bearer 令牌发送。该密钥必须具有 sites.view 权限;缺少该权限的密钥将被拒绝并返回 403 状态码,而非 404。
此端点不需要组织 ID。您的密钥已用于识别其所属的组织,且响应范围也仅限于该组织。
免费试用
将尖括号中的内容替换为您自己的值,并将键占位符替换为您仪表板中的一个键。
curl -X POST https://api.zinndigital.com/v1/bulk-jobs/installed-plugins \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "operation": <string<plugin_activate, plugin_deactivate, plugin_remove, plugin_update>>, "selector": <BulkSelector> }'已登录?您仪表板中的 API 控制台会自动填入您真实的组织 ID 和您自己的密钥,并针对实时 API 运行请求,以便您查看实际的响应。 在 API 控制台中打开此端点
详细信息
The candidate list for plugin_activate, plugin_deactivate, plugin_remove and plugin_update — read from the sites themselves, not from the wordpress.org directory. Installing picks from what could go on; activating picks from what is already there, and those are different questions. POST, and it writes nothing. Same reason as previewBulkJob beside it: an explicit selection of 400 site ids does not survive a query string that proxies, browsers and access logs will truncate or record. No row is written and no job is started. ⛔ This is one network call per site, so it reads a bounded SAMPLE and says so. matched counts the whole selection, eligible counts the ones that could take the operation, and read counts the ones actually listed — three separate numbers, because a blind version of this endpoint would return read: 0, which must never be readable as "nothing is installed". Sites that could not be reached are named in unreadable rather than dropped into a shorter list that looks complete. uniform is false when the read sites do not all carry the same plugins, so the screen can say that plainly instead of silently acting on a subset. Requires sites.view plus the operation's own key — never a cheaper door than the single-site listing.
请求正文
| 名称 | 类型 | 必填 | 内容简介 |
|---|---|---|---|
operation | string<plugin_activate, plugin_deactivate, plugin_remove, plugin_update> | 是 | ⛔ Only the operations that act on something already installed. Anything else is a 422 — there is nothing to list, and the directory search is the right tool. |
selector | BulkSelector | 是 | Which sites a job targets. ⛔ There is no all. A job belongs to exactly one organization and all would span every tenant on the platform; the fleet-wide act is a staff… |
selector_value | string | 否 | The product line, for selector: product_line. |
site_ids | string[] | 否 | — |
sample | integer | 否 | How many sites to read. A latency bound on an interactive read, not a capacity plan: the response reports what it did not reach, and the bulk job that follows covers the whole… |
响应
| 名称 | 类型 | 必填 | 内容简介 |
|---|---|---|---|
operation | string | 是 | — |
matched | integer | 是 | Sites the selection resolves to, counted over the whole selection. |
eligible | integer | 是 | Of those, how many could take the operation at all. |
read | integer | 是 | How many were actually listed. ⛔ The number that makes an empty data interpretable: 0 means we looked at nothing, never nothing is installed. |
sampled | boolean | 是 | True when the selection is larger than what was read. |
uniform | boolean | 是 | False when the read sites do not all carry the same plugins. Computed here rather than by the client, because it decides what the customer is told. |
data | BulkInstalledPlugin[] | 是 | — |
unreadable | object[] | 是 | Sites in the selection whose plugins could not be listed. ⛔ Reported, never dropped — a shorter list that looks complete is worse than a short list that says so. |
此端点可能返回的错误
401 · 403 · 422 · 429