links
POST /v1/content/external-sites
Connect a WordPress site we do not host, with an application password.
Автентифікація
Надішліть ключ API як маркер носія (bearer token). Ця кінцева точка не вказує конкретного дозволу в специфікації, тому надайте своєму ключу мінімально необхідні права та перевірте відповідь, замість того щоб припускати.
Де вказується ідентифікатор вашої організації
Цей ендпоїнт приймає org_id як параметр запиту. Залиште його порожнім, і виклик охопить увесь ваше дерево орендарів; надішліть його, щоб звузити виклик до однієї організації.
Ідентифікатор вашої організації знаходиться на екрані API-ключів у вашій панелі керування, поруч із самим ключем. Це той самий ідентифікатор у кожному вашому запиті.
Спробувати
Замініть усе в кутових дужках власними значеннями, а заповнювач ключа — ключем із вашої панелі керування.
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> }'Увійшли в систему? Консоль API у вашій панелі керування автоматично підставляє ваш реальний ідентифікатор організації та ваш власний ключ, а також виконує запит до робочого API, щоб ви могли побачити справжню відповідь. Відкрийте цю кінцеву точку в консолі API
Деталі
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.
Параметри
| Назва | Тип | Обов'язкове | Що це таке |
|---|---|---|---|
org_id (query) | string | Ні | — |
Тіло запиту
| Назва | Тип | Обов'язкове | Що це таке |
|---|---|---|---|
url | string | Так | The site's address, e.g. https://example.com or https://example.com/blog. |
username | string | Так | — |
application_password | string | Так | The application password WordPress generated. Spaces are ignored, so it may be pasted exactly as displayed. |
name | string | Ні | — |
Відповідь
| Назва | Тип | Обов'язкове | Що це таке |
|---|---|---|---|
site_id | string | Так | — |
primary_domain | string | Так | — |
name | string | Так | — |
is_external | boolean | Так | Always true here. The same site appears in /v1/sites badged External. |
base_url | string | Так | The address we publish to, including any path (e.g. https://example.com/blog). |
reachable | boolean | Ні | 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 | Ні | — |
detail | string | Ні | What the site said last time, verbatim. Shown on the site's own screen. |
detected_identity | string | Ні | — |
backup | object | Так | Whether we can back this site up, and whether we can put it back. Served on the list so a screen showing a customer's whole external estate makes one request rather than one per… |
Помилки, які може повертати ця кінцева точка
401 · 403 · 422