links

POST /v1/content/external-sites

Connect a WordPress site we do not host, with an application password.

Све links крајње тачке

Сва документација за програмере →

Аутентификација

Пошаљите 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Не—

Тело захтева

НазивТипОбавезноШта је ово
urlstringДаThe site's address, e.g. https://example.com or https://example.com/blog.
usernamestringДа—
application_passwordstringДаThe application password WordPress generated. Spaces are ignored, so it may be pasted exactly as displayed.
namestringНе—

Одговор

НазивТипОбавезноШта је ово
site_idstringДа—
primary_domainstringДа—
namestringДа—
is_externalbooleanДаAlways true here. The same site appears in /v1/sites badged External.
base_urlstringДаThe address we publish to, including any path (e.g. https://example.com/blog).
reachablebooleanНе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_atstringНе—
detailstringНеWhat the site said last time, verbatim. Shown on the site's own screen.
detected_identitystringНе—
backupobjectДа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