links
POST /v1/content/external-sites
Connect a WordPress site we do not host, with an application password.
Аутентификација
Пошаљите API кључ као bearer токен. Ова крајња тачка не наводи конкретну дозволу у спецификацији, па свом кључу доделите најмања неопходна овлашћења и проверите одговор уместо да претпостављате.
Где се уноси ID ваше организације
Ова крајња тачка прихвата 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 конзола на вашој контролној табли попуњава ваш прави id организације и ваш сопствени кључ, и покреће захтев према живом 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