links
POST /v1/content/external-sites
Connect a WordPress site we do not host, with an application password.
Pengesahan
Hantar kunci API sebagai token pembawa. Titik akhir ini tidak menyatakan kebenaran tertentu dalam spesifikasi, jadi berikan kunci anda kebenaran minimum yang diperlukan dan semak respons tersebut daripada membuat andaian.
Tempat ID organisasi anda diletakkan
Titik akhir ini mengambil org_id sebagai parameter pertanyaan. Biarkan ia kosong dan panggilan tersebut meliputi keseluruhan subpohon penyewaan anda; hantarkannya untuk mengecilkan panggilan kepada satu organisasi.
ID organisasi anda terletak pada skrin kekunci API dalam papan pemuka anda, di sebelah kekunci itu sendiri. Ia adalah ID yang sama dalam setiap panggilan yang anda buat.
Cuba
Gantikan apa sahaja di dalam kurungan sudut dengan nilai anda sendiri, dan pemegang tempat kunci dengan kunci dari papan pemuka anda.
curl -X POST https://api.zinndigital.com/v1/content/external-sites \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "url": <string>, "username": <string>, "application_password": <string> }'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
Gated on `links.edit`. The credential is **verified against the site before anything is stored**: if WordPress refuses it, nothing is created and the error says what to fix. The password goes to Vault; no secret is stored on the row. Generate the application password in that site's WordPress admin under Users → your user → Application Passwords. The user needs to be able to publish posts.
Parameter
| Nama | Jenis | Diperlukan | Apakah ia |
|---|---|---|---|
org_id (query) | string | Tidak | — |
Badan permintaan
| Nama | Jenis | Diperlukan | Apakah ia |
|---|---|---|---|
url | string | Ya | The site's address, e.g. `https://example.com` or `https://example.com/blog`. |
username | string | Ya | — |
application_password | string | Ya | The application password WordPress generated. Spaces are ignored, so it may be pasted exactly as displayed. |
name | string | Tidak | — |
Respons
| Nama | Jenis | Diperlukan | Apakah ia |
|---|---|---|---|
site_id | string | Ya | — |
primary_domain | string | Ya | — |
name | string | Ya | — |
is_external | boolean | Ya | Always true here. The same site appears in `/v1/sites` badged External. |
base_url | string | Ya | The address we publish to, including any path (e.g. `https://example.com/blog`). |
reachable | boolean | Tidak | What the last check found. **`null` means we have not checked**, which is not the same as "it does not work" — an unchecked site is never rendered as broken. |
checked_at | string | Tidak | — |
detail | string | Tidak | What the site said last time, verbatim. Shown on the site's own screen. |
detected_identity | string | Tidak | — |
Ralat yang boleh dikembalikan oleh titik akhir ini
401 · 403 · 422