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).

POST
/oauth/token

Request Body

application/json

Параметры OAuth2 grant

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/oauth/token" \  -H "Content-Type: application/json" \  -d '{    "grant_type": "client_credentials",    "client_id": "string",    "client_secret": "string"  }'
{  "access_token": "string",  "token_type": "Bearer",  "expires_in": 0,  "refresh_token": "string",  "scope": "string"}
POST
/oauth/revoke

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

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

Authorization

bearerAuth
AuthorizationBearer <token>

Access token из POST /oauth/token

In: header

Query Parameters

limit?integer
Default20
offset?integer
Default0

Response Body

application/json

curl -X GET "https://example.com/post/"
[  {    "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"  }]
POST
/post/

Authorization

bearerAuth
AuthorizationBearer <token>

Access token из POST /oauth/token

In: header

Request Body

application/json

Новость + optional nested children

TypeScript Definitions

Use the request body type in TypeScript.

Схема таблицы post (DLE install.php).

Response Body

application/json

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

Authorization

bearerAuth
AuthorizationBearer <token>

Access token из POST /oauth/token

In: header

Path Parameters

id*integer

Response Body

application/json

curl -X GET "https://example.com/post/0"
{  "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"}
GET
/table/{name}/

Authorization

bearerAuth
AuthorizationBearer <token>

Access token из POST /oauth/token

In: header

Path Parameters

name*string

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

Query Parameters

limit?integer
Default20
offset?integer
Default0
orderby?string

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

sort?string
Default"DESC"

Value in

  • "ASC"
  • "DESC"

Response Body

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

In: header

Path Parameters

name*string

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

Request Body

application/json

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

TypeScript Definitions

Use the request body type in TypeScript.

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

Схема таблицы admin_logs (DLE install.php).

Response Body

application/json

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

Authorization

bearerAuth
AuthorizationBearer <token>

Access token из POST /oauth/token

In: header

Path Parameters

name*string

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

id*string

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

Response Body

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

In: header

Path Parameters

name*string

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

id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

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

Схема таблицы admin_logs (DLE install.php).

Response Body

application/json

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

Authorization

bearerAuth
AuthorizationBearer <token>

Access token из POST /oauth/token

In: header

Path Parameters

name*string

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

id*string

Response Body

application/json

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

Authorization

bearerAuth
AuthorizationBearer <token>

Access token из POST /oauth/token

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Схема таблицы users (DLE install.php).

Response Body

application/json

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

Authorization

bearerAuth
AuthorizationBearer <token>

Access token из POST /oauth/token

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Схема таблицы usergroups (DLE install.php).

Response Body

application/json

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

Authorization

bearerAuth
AuthorizationBearer <token>

Access token из POST /oauth/token

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Схема таблицы plugins (DLE install.php).

Response Body

application/json

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

Authorization

bearerAuth
AuthorizationBearer <token>

Access token из POST /oauth/token

In: header

Request Body

multipart/form-data

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/upload/" \  -F file="string"
{}
GET
/conversations/

Authorization

bearerAuth
AuthorizationBearer <token>

Access token из POST /oauth/token

In: header

Response Body

application/json

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

Authorization

bearerAuth
AuthorizationBearer <token>

Access token из POST /oauth/token

In: header

Path Parameters

scope*string

Value in

  • "post"
  • "user"

Response Body

application/json

curl -X GET "https://example.com/xfields/post/"
{}
POST
/xfields/{scope}/

Authorization

bearerAuth
AuthorizationBearer <token>

Access token из POST /oauth/token

In: header

Path Parameters

scope*string

Value in

  • "post"
  • "user"

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

curl -X POST "https://example.com/xfields/post/" \  -H "Content-Type: application/json" \  -d '{}'
Empty
GET
/xfields/{scope}/{name}

Authorization

bearerAuth
AuthorizationBearer <token>

Access token из POST /oauth/token

In: header

Path Parameters

scope*string

Value in

  • "post"
  • "user"
name*string

Response Body

curl -X GET "https://example.com/xfields/post/string"
Empty
PUT
/xfields/{scope}/{name}

Authorization

bearerAuth
AuthorizationBearer <token>

Access token из POST /oauth/token

In: header

Path Parameters

scope*string

Value in

  • "post"
  • "user"
name*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

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

Authorization

bearerAuth
AuthorizationBearer <token>

Access token из POST /oauth/token

In: header

Path Parameters

scope*string

Value in

  • "post"
  • "user"
name*string

Response Body

curl -X DELETE "https://example.com/xfields/post/string"
Empty
GET
/health/

Authorization

bearerAuth
AuthorizationBearer <token>

Access token из POST /oauth/token

In: header

Response Body

application/json

curl -X GET "https://example.com/health/"
{  "ok": true,  "version": "200.1.0"}

Схемы

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