links
POST /v1/content/external-sites
Connect a WordPress site we do not host, with an application password.
احراز هویت
یک کلید API را به عنوان یک توکن برbearer ارسال کنید. این نقطه پایانی مجوز خاصی را در مشخصات خود ذکر نمیکند، بنابراین به جای فرض کردن، حداقل نیازهای کلید خود را بدهید و پاسخ را بررسی کنید.
جایی که شناسه سازمان شما قرار میگیرد
این نقطه پایانی 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 | خیر | — |
خطاهایی که این نقطه پایانی میتواند برگرداند
401 · 403 · 422