hosting
PUT /v1/sites/{siteId}/build-env
Replace a site's whole build environment.
Pengesahan
Hantar kunci API sebagai token pembawa. Kunci tersebut mesti membawa kebenaran hosting.deploy.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}/build-env \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "variables": <object> }'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
Replaces rather than merges, because that is the only shape in which DELETING a variable is expressible — merge semantics would make a rotated-out key undeletable, and it would keep reaching the customer's builds from a screen that no longer lists it. An empty `variables` object clears them all. Names must be POSIX environment-variable syntax and may not start with a prefix the build platform owns (`CF_PAGES`, `GITHUB_`). Requires `hosting.deploy.manage`.
Parameter
| Nama | Jenis | Diperlukan | Apakah ia |
|---|---|---|---|
siteId (path) | Uuid | Ya | Site ID (UUIDv7). |
Badan permintaan
| Nama | Jenis | Diperlukan | Apakah ia |
|---|---|---|---|
variables | object | Ya | Name to new value, for the variables being set or replaced. A mapping rather than a list of key/value objects because a mapping cannot express a duplicate name — two rows with o… |
keep | string[] | Tidak | Names to retain unchanged. A name here that the store does not hold is ignored rather than refused — it means the variable was deleted elsewhere, and failing the whole save over… |
Respons
| Nama | Jenis | Diperlukan | Apakah ia |
|---|---|---|---|
names | string[] | Ya | The variable names this site holds, sorted. |
Ralat yang boleh dikembalikan oleh titik akhir ini
401 · 403 · 404 · 422 · 429