hosting
POST /v1/sites/{siteId}/wordpress/uploads
Start a resumable upload of a plugin or theme zip.
Аутентификација
Пошаљите API кључ као bearer токен. Кључ мора имати дозволу sites.view; кључ без ње се одбија уз 403, а не 404.
Ова крајња тачка не прихвата id организације. Ваш кључ већ идентификује организацију којој припада, а одговор је ограничен на њу.
Испробајте
Замените све што је у угластим заградама сопственим вредностима, а чувар места кључа кључем са своје контролне табле.
curl -X POST https://api.zinndigital.com/v1/sites/{siteId}/wordpress/uploads \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "kind": <string<plugin, theme>>, "size": <integer> }'Пријављени сте? API конзола на вашој контролној табли попуњава ваш прави id организације и ваш сопствени кључ, и покреће захтев према живом API-ју како бисте могли да видите стварни одговор. Отворите ову крајњу тачку у API конзоли
Детаљи
Opens a resumable upload of a plugin or theme zip of up to 256 MB. Use it for anything larger than a few megabytes, and always on a slow or unreliable connection. The file travels as small parts, each its own request, so no request comes near a timeout and a dropped connection costs one part rather than the whole file (D28103). The protocol: start (this call, declaring the file's size) → PUT every part (uploadSiteWordPressUploadPart, the platform decides part_size) → complete with the whole-file checksum. GET the upload at any point to see which parts have arrived, which is how a client resumes after a drop. Unfinished uploads expire after 24 hours and their parts are deleted. Refused up front, before any byte is sent: 413 for a file over 256 MB, 422 when the plan does not include uploading this kind. Requires sites.view and sites.panel_access.
Параметри
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
siteId (path) | Uuid | Да | Site ID (UUIDv7). |
Тело захтева
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
kind | string<plugin, theme> | Да | — |
size | integer | Да | The file's exact size in bytes. |
file_name | string | Не | Shown back to the customer only. Never used as a path anywhere. |
activate | boolean | Не | Activate after installing. Omitted: a plugin is activated and a theme is not, the same defaults as the single-request install. |
Одговор
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
id | string | Да | — |
kind | string<plugin, theme> | Да | — |
status | string<open, assembling, installed, failed> | Да | — |
size | integer | Да | — |
part_size | integer | Да | Bytes per part, chosen by the platform. Every part but the last is exactly this long. |
part_count | integer | Да | — |
file_name | string | Да | — |
activate | boolean | Да | — |
message | string | Да | On failed, what went wrong, written for the customer. Empty otherwise. |
expires_at | string | Да | — |
created_at | string | Да | — |
finished_at | string | Да | — |
received_parts | integer[] | Не | Present while open — the part numbers already stored. |
Грешке које ова крајња тачка може вратити
401 · 403 · 404 · 413 · 422 · 429 · 503