DevCraft Документации
Справочник

OpenAPI

Интерактивная спецификация OpenAPI для /api/v2.

Спецификация генерируется из PHP attributes (swagger-php) в репозитории dle_api: apidata/openapi.yaml.

cd upload/api && composer openapi

Сырой файл: openapi.yaml

Интерактивный playground рендерится ниже через Fumadocs OpenAPI (app/lib/openapi.ts).

Операции

/oauth/token

POST
/oauth/token

Предпочтительно credential_type=api_key|auth|oauth_client. Альтернатива: grant_type=client_credentials|password|authorization_code|refresh_token. В DEMO_MODE при успехе — authorized без access_token.

Request Body

application/json

Параметры credential_type или OAuth2 grant

Response Body

application/json

application/json

curl -X POST "https://example.com/oauth/token" \  -H "Content-Type: application/json" \  -d '{    "credential_type": "api_key",    "api_key": "your_api_key"  }'
{  "access_token": "…",  "token_type": "Bearer",  "expires_in": 3600,  "refresh_token": "…"}

/.well-known/oauth-authorization-server

GET
/.well-known/oauth-authorization-server

Response Body

application/json

curl -X GET "https://example.com/.well-known/oauth-authorization-server"
{  "issuer": "string",  "authorization_endpoint": "string",  "token_endpoint": "string",  "revocation_endpoint": "string",  "userinfo_endpoint": "string",  "response_types_supported": [    "string"  ],  "grant_types_supported": [    "string"  ],  "code_challenge_methods_supported": [    "string"  ],  "token_endpoint_auth_methods_supported": [    "string"  ],  "credential_types_supported": [    "string"  ]}

/me

GET
/me

Authorization

bearerAuth
AuthorizationBearer <token>

Access token из POST /oauth/token (credential_type или grant_type). Сырой API-ключ на ресурсах не принимается.

In: header

Response Body

application/json

application/json

curl -X GET "https://example.com/me"
{  "sub": "string",  "user_id": 0,  "name": "string",  "email": "string",  "user_group": 0,  "user": {},  "api_key_id": 0,  "access_level": {},  "client_id": "string",  "auth_via": "access_token"}

/key/check

GET
/key/check

Принимает Authorization: Bearer , возвращает ключ, scopes и payload me. validTo = null означает бессрочный ключ.

Authorization

rawApiKeyBearer
AuthorizationBearer <token>

Сырой API-ключ только для GET /key/check. Формат: Authorization: Bearer .

In: header

Response Body

application/json

application/json

curl -X GET "https://example.com/key/check"
{  "apiKey": {    "key": "string",    "validFrom": "2019-08-24T14:15:22Z",    "validTo": "2019-08-24T14:15:22Z",    "accessLevel": {}  },  "scopes": {    "property1": {      "read": true,      "write": true,      "edit": true,      "delete": true    },    "property2": {      "read": true,      "write": true,      "edit": true,      "delete": true    }  },  "me": {}}

/oauth/userinfo

GET
/oauth/userinfo

Authorization

bearerAuth
AuthorizationBearer <token>

Access token из POST /oauth/token (credential_type или grant_type). Сырой API-ключ на ресурсах не принимается.

In: header

Response Body

application/json

application/json

curl -X GET "https://example.com/oauth/userinfo"
{  "sub": "string",  "user_id": 0,  "name": "string",  "email": "string",  "user_group": 0,  "user": {},  "api_key_id": 0,  "access_level": {},  "client_id": "string",  "auth_via": "string"}

/oauth/revoke

POST
/oauth/revoke

Request Body

application/json

Response Body

application/json

curl -X POST "https://example.com/oauth/revoke" \  -H "Content-Type: application/json" \  -d '{    "token": "string"  }'
{  "revoked": true}

/post/

GET
/post/

Query-параметры колонок схемы; xf[name]=value для доп. полей; ! и % префиксы значений. Legacy: HTTP-заголовки с именами колонок (BC). category — virtual FK csv + post_extras_cats.

Authorization

bearerAuth
AuthorizationBearer <token>

Access token из POST /oauth/token (credential_type или grant_type). Сырой API-ключ на ресурсах не принимается.

In: header

Query Parameters

limit?integer
Default20
offset?integer
Default0
orderby?string

Колонка сортировки

sort?string
Default"DESC"

Value in

  • "ASC"
  • "DESC"
category?string

Virtual FK csv → category.id (FIND_IN_SET + post_extras_cats). !negate, %LIKE

approve?string
xf?

Доп. поля: xf[field]=value (pad-LIKE по xfields). Пример: xf[title]=foo

Response Body

application/json

application/json

curl -X GET "https://example.com/post/"
{  "data": [    {      "id": 0,      "autor": "string",      "date": "string",      "short_story": "string",      "full_story": "string",      "xfields": "string",      "title": "string",      "descr": "string",      "keywords": "string",      "category": "string",      "alt_name": "string",      "comm_num": 0,      "allow_comm": 0,      "allow_main": 0,      "approve": 0,      "fixed": 0,      "allow_br": 0,      "symbol": "string",      "tags": "string",      "metatitle": "string"    }  ],  "count": 0}
POST
/post/

Authorization

bearerAuth
AuthorizationBearer <token>

Access token из POST /oauth/token (credential_type или grant_type). Сырой API-ключ на ресурсах не принимается.

In: header

Request Body

application/json

Новость + optional nested children

Схема таблицы post.

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/post/" \  -H "Content-Type: application/json" \  -d '{}'
{  "id": 1}

/post/{id}

GET
/post/{id}

Authorization

bearerAuth
AuthorizationBearer <token>

Access token из POST /oauth/token (credential_type или grant_type). Сырой API-ключ на ресурсах не принимается.

In: header

Path Parameters

id*integer

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/post/0"
{  "data": {    "id": 0,    "autor": "string",    "date": "string",    "short_story": "string",    "full_story": "string",    "xfields": "string",    "title": "string",    "descr": "string",    "keywords": "string",    "category": "string",    "alt_name": "string",    "comm_num": 0,    "allow_comm": 0,    "allow_main": 0,    "approve": 0,    "fixed": 0,    "allow_br": 0,    "symbol": "string",    "tags": "string",    "metatitle": "string"  }}

/table/{name}

GET
/table/{name}

Любая таблица SchemaRegistry. Фильтры = query-параметры колонок. Virtual FK (RelationMap): csv→FIND_IN_SET, one→=. Операторы: !negate, %LIKE. Пример: /table/banners/?category=1&approve=1. xf[name] если есть колонка xfields.

Authorization

bearerAuth
AuthorizationBearer <token>

Access token из POST /oauth/token (credential_type или grant_type). Сырой API-ключ на ресурсах не принимается.

In: header

Path Parameters

name*string

Логическое имя таблицы SchemaRegistry (banners, post, category, …)

Query Parameters

limit?integer
Default20
offset?integer
Default0
orderby?string

Колонка сортировки (из схемы)

sort?string
Default"DESC"

Value in

  • "ASC"
  • "DESC"
xf?

Доп. поля (если у таблицы есть xfields): xf[field]=value. Пример: xf[title]=foo

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/table/string"
{  "data": [    {      "id": 0,      "name": "string",      "date": 0,      "ip": "string",      "action": 0,      "extras": "string"    }  ],  "count": 0,  "table": "string"}
POST
/table/{name}

Authorization

bearerAuth
AuthorizationBearer <token>

Access token из POST /oauth/token (credential_type или grant_type). Сырой API-ключ на ресурсах не принимается.

In: header

Path Parameters

name*string

Логическое имя таблицы SchemaRegistry

Request Body

application/json

Колонки выбранной таблицы (+ optional nested children). Схема = oneOf TableRow.

Тело записи: выберите схему по логическому имени таблицы в path {name} (SchemaRegistry).

Схема таблицы admin_logs.

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/table/string" \  -H "Content-Type: application/json" \  -d '{}'
{  "id": 1,  "table": "banners"}

/table/{name}/{id}

GET
/table/{name}/{id}

Authorization

bearerAuth
AuthorizationBearer <token>

Access token из POST /oauth/token (credential_type или grant_type). Сырой API-ключ на ресурсах не принимается.

In: header

Path Parameters

name*string

Логическое имя таблицы SchemaRegistry

id*string

Значение первичного ключа

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/table/string/string"
{  "data": {    "id": 0,    "name": "string",    "date": 0,    "ip": "string",    "action": 0,    "extras": "string"  },  "table": "string"}
PUT
/table/{name}/{id}

Authorization

bearerAuth
AuthorizationBearer <token>

Access token из POST /oauth/token (credential_type или grant_type). Сырой API-ключ на ресурсах не принимается.

In: header

Path Parameters

name*string

Логическое имя таблицы SchemaRegistry

id*string

Request Body

application/json

Тело записи: выберите схему по логическому имени таблицы в path {name} (SchemaRegistry).

Схема таблицы admin_logs.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X PUT "https://example.com/table/string/string" \  -H "Content-Type: application/json" \  -d '{}'
{  "id": "1",  "table": "banners",  "updated": true}
DELETE
/table/{name}/{id}

Authorization

bearerAuth
AuthorizationBearer <token>

Access token из POST /oauth/token (credential_type или grant_type). Сырой API-ключ на ресурсах не принимается.

In: header

Path Parameters

name*string

Логическое имя таблицы SchemaRegistry

id*string

Response Body

application/json

application/json

application/json

application/json

curl -X DELETE "https://example.com/table/string/string"
{  "id": "1",  "table": "banners",  "deleted": true}

/user/

POST
/user/

Authorization

bearerAuth
AuthorizationBearer <token>

Access token из POST /oauth/token (credential_type или grant_type). Сырой API-ключ на ресурсах не принимается.

In: header

Request Body

application/json

Схема таблицы users.

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/user/" \  -H "Content-Type: application/json" \  -d '{}'
{  "id": 1}

/usergroup/

POST
/usergroup/

Authorization

bearerAuth
AuthorizationBearer <token>

Access token из POST /oauth/token (credential_type или grant_type). Сырой API-ключ на ресурсах не принимается.

In: header

Request Body

application/json

Схема таблицы usergroups.

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/usergroup/" \  -H "Content-Type: application/json" \  -d '{}'
{  "id": 1}

/plugin/

POST
/plugin/

Authorization

bearerAuth
AuthorizationBearer <token>

Access token из POST /oauth/token (credential_type или grant_type). Сырой API-ключ на ресурсах не принимается.

In: header

Request Body

application/json

Схема таблицы plugins.

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/plugin/" \  -H "Content-Type: application/json" \  -d '{}'
{  "id": 1}

/upload/

POST
/upload/

Authorization

bearerAuth
AuthorizationBearer <token>

Access token из POST /oauth/token (credential_type или grant_type). Сырой API-ключ на ресурсах не принимается.

In: header

Request Body

multipart/form-data

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/upload/" \  -F file="string"
{  "url": "/uploads/files/…",  "name": "file.jpg"}

/conversations/

GET
/conversations/

Authorization

bearerAuth
AuthorizationBearer <token>

Access token из POST /oauth/token (credential_type или grant_type). Сырой API-ключ на ресурсах не принимается.

In: header

Response Body

application/json

application/json

curl -X GET "https://example.com/conversations/"
{  "data": [    {      "id": 0,      "subject": "string",      "created_at": 0,      "updated_at": 0,      "sender_id": 0,      "recipient_id": 0    }  ]}

/xfields/{scope}/

GET
/xfields/{scope}/

Authorization

bearerAuth
AuthorizationBearer <token>

Access token из POST /oauth/token (credential_type или grant_type). Сырой API-ключ на ресурсах не принимается.

In: header

Path Parameters

scope*string

Value in

  • "post"
  • "user"

Response Body

application/json

application/json

curl -X GET "https://example.com/xfields/post/"
{  "data": {    "fields": {      "property1": {        "name": "string",        "description": "string",        "hint": "string",        "group": "string",        "category": "string",        "allow_add_usergroups": "string",        "allow_view_usergroups": "string",        "type": "text",        "min": "string",        "max": "string",        "storage": "string",        "max_files": "string",        "max_size": "string",        "image_sizes": "string",        "image_size": "string",        "image_side": "string",        "image_max_size": "string",        "thumb_size": "string",        "thumb_side": "string",        "max_images": "string",        "files_ext": "string",        "file_max_size": "string",        "condition": "string",        "date_format": "string",        "date_view_format": "string",        "select_separator": "string",        "links_separator": "string",        "not_required": 0,        "default": "string",        "allow_multi": 0,        "use_as_links": 0,        "use_editor": 0,        "safe_mode": 0,        "make_watermark": 0,        "make_thumb": 0,        "use_opengraph": "string",        "is_public": "string",        "date_local": "string",        "date_declension": "string",        "allow_in_news": 0,        "lazy_load": "string"      },      "property2": {        "name": "string",        "description": "string",        "hint": "string",        "group": "string",        "category": "string",        "allow_add_usergroups": "string",        "allow_view_usergroups": "string",        "type": "text",        "min": "string",        "max": "string",        "storage": "string",        "max_files": "string",        "max_size": "string",        "image_sizes": "string",        "image_size": "string",        "image_side": "string",        "image_max_size": "string",        "thumb_size": "string",        "thumb_side": "string",        "max_images": "string",        "files_ext": "string",        "file_max_size": "string",        "condition": "string",        "date_format": "string",        "date_view_format": "string",        "select_separator": "string",        "links_separator": "string",        "not_required": 0,        "default": "string",        "allow_multi": 0,        "use_as_links": 0,        "use_editor": 0,        "safe_mode": 0,        "make_watermark": 0,        "make_thumb": 0,        "use_opengraph": "string",        "is_public": "string",        "date_local": "string",        "date_declension": "string",        "allow_in_news": 0,        "lazy_load": "string"      }    },    "groups": {      "property1": {        "title": "string",        "description": "string"      },      "property2": {        "title": "string",        "description": "string"      }    }  },  "scope": "post"}
POST
/xfields/{scope}/

Authorization

bearerAuth
AuthorizationBearer <token>

Access token из POST /oauth/token (credential_type или grant_type). Сырой API-ключ на ресурсах не принимается.

In: header

Path Parameters

scope*string

Value in

  • "post"
  • "user"

Request Body

application/json

Описание одного доп. поля новости (xfields.json → fields.*).

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/xfields/post/" \  -H "Content-Type: application/json" \  -d '{}'
{  "name": "string",  "scope": "string",  "data": {    "name": "string",    "description": "string",    "hint": "string",    "group": "string",    "category": "string",    "allow_add_usergroups": "string",    "allow_view_usergroups": "string",    "type": "text",    "min": "string",    "max": "string",    "storage": "string",    "max_files": "string",    "max_size": "string",    "image_sizes": "string",    "image_size": "string",    "image_side": "string",    "image_max_size": "string",    "thumb_size": "string",    "thumb_side": "string",    "max_images": "string",    "files_ext": "string",    "file_max_size": "string",    "condition": "string",    "date_format": "string",    "date_view_format": "string",    "select_separator": "string",    "links_separator": "string",    "not_required": 0,    "default": "string",    "allow_multi": 0,    "use_as_links": 0,    "use_editor": 0,    "safe_mode": 0,    "make_watermark": 0,    "make_thumb": 0,    "use_opengraph": "string",    "is_public": "string",    "date_local": "string",    "date_declension": "string",    "allow_in_news": 0,    "lazy_load": "string"  }}

/xfields/{scope}/encode

POST
/xfields/{scope}/encode

Body: {fields:{name:value}} или {name,value}. Ответ: raw + parsed.

Authorization

bearerAuth
AuthorizationBearer <token>

Access token из POST /oauth/token (credential_type или grant_type). Сырой API-ключ на ресурсах не принимается.

In: header

Path Parameters

scope*string

Value in

  • "post"
  • "user"

Request Body

application/json

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/xfields/post/encode" \  -H "Content-Type: application/json" \  -d '{}'
{  "raw": "string",  "parsed": {}}

/xfields/{scope}/{name}

GET
/xfields/{scope}/{name}

Authorization

bearerAuth
AuthorizationBearer <token>

Access token из POST /oauth/token (credential_type или grant_type). Сырой API-ключ на ресурсах не принимается.

In: header

Path Parameters

scope*string

Value in

  • "post"
  • "user"
name*string

Query Parameters

as?string

Projection по типу (image, text, …)

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/xfields/post/string"
{  "data": {    "name": "string",    "description": "string",    "hint": "string",    "group": "string",    "category": "string",    "allow_add_usergroups": "string",    "allow_view_usergroups": "string",    "type": "text",    "min": "string",    "max": "string",    "storage": "string",    "max_files": "string",    "max_size": "string",    "image_sizes": "string",    "image_size": "string",    "image_side": "string",    "image_max_size": "string",    "thumb_size": "string",    "thumb_side": "string",    "max_images": "string",    "files_ext": "string",    "file_max_size": "string",    "condition": "string",    "date_format": "string",    "date_view_format": "string",    "select_separator": "string",    "links_separator": "string",    "not_required": 0,    "default": "string",    "allow_multi": 0,    "use_as_links": 0,    "use_editor": 0,    "safe_mode": 0,    "make_watermark": 0,    "make_thumb": 0,    "use_opengraph": "string",    "is_public": "string",    "date_local": "string",    "date_declension": "string",    "allow_in_news": 0,    "lazy_load": "string"  },  "scope": "string"}
PUT
/xfields/{scope}/{name}

Authorization

bearerAuth
AuthorizationBearer <token>

Access token из POST /oauth/token (credential_type или grant_type). Сырой API-ключ на ресурсах не принимается.

In: header

Path Parameters

scope*string

Value in

  • "post"
  • "user"
name*string

Request Body

application/json

Описание одного доп. поля новости (xfields.json → fields.*).

Response Body

application/json

application/json

application/json

curl -X PUT "https://example.com/xfields/post/string" \  -H "Content-Type: application/json" \  -d '{}'
{  "name": "myfield",  "updated": true}
DELETE
/xfields/{scope}/{name}

Authorization

bearerAuth
AuthorizationBearer <token>

Access token из POST /oauth/token (credential_type или grant_type). Сырой API-ключ на ресурсах не принимается.

In: header

Path Parameters

scope*string

Value in

  • "post"
  • "user"
name*string

Response Body

application/json

application/json

application/json

application/json

curl -X DELETE "https://example.com/xfields/post/string"
{  "name": "myfield",  "deleted": true}

/health

GET
/health

Response Body

application/json

curl -X GET "https://example.com/health"
{  "version": "200.1.0",  "api": "v2",  "auth": "Bearer"}

Схемы

Компоненты components.schemas из OpenAPI.

AdminLogs

AdminLogs?

Схема таблицы admin_logs.

AdminSections

AdminSections?

Схема таблицы admin_sections.

ApiError

ApiError?

Единый JSON-формат ошибки API v2: error, message, details?

Example

{  "error": "unauthorized",  "message": "Требуется Authorization: Bearer <AuthToken>"}

Banned

Banned?

Схема таблицы banned.

Banners

Banners?

Схема таблицы banners.

BannersLogs

BannersLogs?

Схема таблицы banners_logs.

BannersRubrics

BannersRubrics?

Схема таблицы banners_rubrics.

Category

Category?

Схема таблицы category.

CommentRatingLog

CommentRatingLog?

Схема таблицы comment_rating_log.

Comments

Comments?

Схема таблицы comments.

CommentsFiles

CommentsFiles?

Схема таблицы comments_files.

Complaint

Complaint?

Схема таблицы complaint.

ConversationReads

ConversationReads?

Схема таблицы conversation_reads.

ConversationUsers

ConversationUsers?

Схема таблицы conversation_users.

Conversations

Conversations?

Схема таблицы conversations.

ConversationsMessages

ConversationsMessages?

Схема таблицы conversations_messages.

DownloadsLog

DownloadsLog?

Схема таблицы downloads_log.

Email

Email?

Схема таблицы email.

Files

Files?

Схема таблицы files.

Flood

Flood?

Схема таблицы flood.

IgnoreList

IgnoreList?

Схема таблицы ignore_list.

Images

Images?

Схема таблицы images.

LoginLog

LoginLog?

Схема таблицы login_log.

Logs

Logs?

Схема таблицы logs.

Lostdb

Lostdb?

Схема таблицы lostdb.

MailLog

MailLog?

Схема таблицы mail_log.

Metatags

Metatags?

Схема таблицы metatags.

NewsletterTemplateCategories

NewsletterTemplateCategories?

Схема таблицы newsletter_template_categories.

NewsletterTemplateItems

NewsletterTemplateItems?

Схема таблицы newsletter_template_items.

Notice

Notice?

Схема таблицы notice.

Plugins

Plugins?

Схема таблицы plugins.

PluginsFiles

PluginsFiles?

Схема таблицы plugins_files.

PluginsLogs

PluginsLogs?

Схема таблицы plugins_logs.

Poll

Poll?

Схема таблицы poll.

PollLog

PollLog?

Схема таблицы poll_log.

Post

Post?

Схема таблицы post.

PostExtras

PostExtras?

Схема таблицы post_extras.

PostExtrasCats

PostExtrasCats?

Схема таблицы post_extras_cats.

PostLog

PostLog?

Схема таблицы post_log.

PostPass

PostPass?

Схема таблицы post_pass.

PostXfieldField

PostXfieldField?

Описание одного доп. поля новости (xfields.json → fields.*).

PostXfieldGroup

PostXfieldGroup?

Группа доп. полей новости (xfields.json → groups.*).

PostXfieldsCatalog

PostXfieldsCatalog?

Каталог доп. полей новостей (xfields.json).

Question

Question?

Схема таблицы question.

ReadLog

ReadLog?

Схема таблицы read_log.

Redirects

Redirects?

Схема таблицы redirects.

Rss

Rss?

Схема таблицы rss.

Rssinform

Rssinform?

Схема таблицы rssinform.

Sendlog

Sendlog?

Схема таблицы sendlog.

SocialLogin

SocialLogin?

Схема таблицы social_login.

SpamLog

SpamLog?

Схема таблицы spam_log.

Static

Static?

Схема таблицы static.

StaticFiles

StaticFiles?

Схема таблицы static_files.

Storage

Storage?

Схема таблицы storage.

Subscribe

Subscribe?

Схема таблицы subscribe.

TableRow

TableRow?||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

Тело записи: выберите схему по логическому имени таблицы в path {name} (SchemaRegistry).

Tags

Tags?

Схема таблицы tags.

Twofactor

Twofactor?

Схема таблицы twofactor.

UserXfieldField

UserXfieldField?

Описание доп. поля профиля (userxfields.json → fields.*).

UserXfieldsCatalog

UserXfieldsCatalog?

Каталог доп. полей профиля (userxfields.json).

Usergroups

Usergroups?

Схема таблицы usergroups.

Users

Users?

Схема таблицы users.

UsersDelete

UsersDelete?

Схема таблицы users_delete.

Views

Views?

Схема таблицы views.

Vote

Vote?

Схема таблицы vote.

VoteResult

VoteResult?

Схема таблицы vote_result.

Xfsearch

Xfsearch?

Схема таблицы xfsearch.

На этой странице