Аутентификация
Отправьте ключ API в качестве токена носителя (bearer token). Ключ должен иметь разрешение sites.view; ключ без него отклоняется с кодом 403, а не 404.
Этот эндпоинт не принимает идентификатор организации. Ваш ключ уже определяет организацию, к которой он принадлежит, и ответ ограничивается ее рамками.
Попробовать
Замените всё в угловых скобках на собственные значения, а плейсхолдер ключа — на ключ из вашей панели управления.
curl -X GET https://api.zinndigital.com/v1/wordpress/theme-directory?q=<q> \
-H "Authorization: Bearer zdk_live_…"Вошли в систему? Консоль API в вашей панели управления автоматически подставляет реальный идентификатор вашей организации и ваш собственный ключ, а также выполняет запрос к работающему API, чтобы вы могли увидеть актуальный ответ. Откройте эту конечную точку в API-консоли
Подробнее
Themes a customer can install, from the wordpress.org directory. **Collection-level and not under a site**, for the same reason as the plugin catalogue: choosing a theme comes before choosing where to put it. An empty or whitespace-only `q` returns an empty page rather than the directory's popularity ranking. `rating` is normalised to **0–5** (upstream reports 0–100). `author` is plain text — upstream returns it as an **object** on this API and as an HTML anchor on the plugin one, so neither shape reaches our page. `screenshot_url` and `preview_url` are normalised to `https`: upstream emits them protocol-relative (`//ts.w.org/…`), which is a working URL in a browser and a broken one everywhere else. ⚠️ `screenshot_url` and `preview_url` are **third-party URLs** a client will put in an `<img src>` and an anchor. Choosing a theme without seeing it is not a feature, so they travel; this is a considered risk, not an oversight. The engine never fetches them. Requires `sites.view`. Our egress routing for the upstream is registered as `wordpress_org` — the **same** service key as the plugin directory, because it is the same host, the same (absent) account and therefore the same throttling subject.
Параметры
| Имя | Тип | Обязательно | Что это |
|---|---|---|---|
q (query) | string | Да | What to search for. |
page (query) | integer | Нет | — |
per_page (query) | integer | Нет | — |
Ответ
| Имя | Тип | Обязательно | Что это |
|---|---|---|---|
data | WordPressDirectoryTheme[] | Да | — |
page | integer | Да | — |
pages | integer | Да | Total pages available. `0` when nothing matched. |
total | integer | Да | Total matching themes across all pages. |
Ошибки, которые может возвращать этот эндпоинт
401 · 403 · 429 · 503