Skip to content
WasFor
Laghachi n'ụlọ
Akwụkwọ/Onye nrụpụta API

API onye ọrụ

Onye ọrụ API na-ejikwa akụrụngwa nke ndị ahịa egosipụtara. A kpakara ụzọ ọ bụla: akara maka otu akaụntụ enweghị ike ịgụ ma ọ bụ dee data akaụntụ ọzọ, ọbụlagodi na njirimara echepụtara.

Ebe njedebe

UsoroỤzọEbumnuche
WFP0XWFP0XDepụta saịtị
WFP0XWFP0XMepụta saịtị
WFP0XWFP0XNkọwa saịtị
WFP0XWFP0XMelite ntọala
WFP0XWFP0XHichapụ saịtị
WFP0XWFP0XGụọ nhazi PHP
WFP0XWFP0XMmelite gabigara
WFP0XWFP0XTọgharịa mbugharị
WFP0XWFP0XNdepụta ndọtị
WFP0XWFP0XNdepụta ọdụ data
WFP0XWFP0XMepụta nchekwa data
WFP0XWFP0XDepụta nseta ihuenyo
WFP0XWFP0XKpalite ndabere
WFP0XWFP0XNdepụta tiketi
WFP0XWFP0XMepee tiketi

Depụta saịtị

http
GET /api/user/sites?page=1&per_page=25
Authorization: Bearer <token>
json
{
  "ok": true,
  "data": [
    {
      "id": 42,
      "domain": "app.example.com",
      "document_root": "/home/acme/sites/app.example.com/public",
      "php_version": "8.3",
      "ssl": { "status": "active", "expires_at": "2027-02-18T00:00:00Z" },
      "disk_used_mb": 1840,
      "status": "active"
    }
  ],
  "meta": { "page": 1, "per_page": 25, "total": 1 }
}

Mepụta saịtị

http
POST /api/user/sites
Content-Type: application/json

{
  "domain": "shop.example.com",
  "php_version": "8.3",
  "document_root": "/home/acme/sites/shop.example.com/public"
}

Nkwado na-ajụ ngalaba ejirila na akaụntụ ahụ, akwụkwọ root na mpụga ụlọ akaụntụ yana ụdị PHP anaghị akwado. Mepụta nke ọma na-eji ihe saịtị weghachi 201.

Gụọ ntọala PHP

http
GET /api/user/sites/42/php/settings
json
{
  "ok": true,
  "data": {
    "php_version": "8.3",
    "runtime": "fpm",
    "supported": [
      "memory_limit", "max_execution_time", "max_input_time",
      "upload_max_filesize", "post_max_size", "max_input_vars",
      "display_errors", "error_reporting", "date.timezone",
      "session.gc_maxlifetime"
    ],
    "inherited": {
      "memory_limit": "128M",
      "max_execution_time": "60",
      "post_max_size": "64M"
    },
    "overrides": {
      "memory_limit": "256M"
    },
    "effective": {
      "memory_limit": "256M",
      "max_execution_time": "60",
      "post_max_size": "64M"
    },
    "limits": {
      "memory_limit": { "min": "64M", "max": "1G" },
      "max_execution_time": { "min": 30, "max": 300 }
    },
    "warnings": []
  }
}

Mmelite gabigara

Ziga naanị ntuziaka ịchọrọ ịgbanwe. Igodo ewepụrụ na-edobe uru ha dị ugbu a; null na-ewepụ ngafe ma weghachi ihe nketa.

http
PUT /api/user/sites/42/php/settings
Content-Type: application/json

{
  "overrides": {
    "memory_limit": "256M",
    "upload_max_filesize": "128M",
    "post_max_size": "128M",
    "date.timezone": "Asia/Shanghai"
  }
}

Ụkpụrụ ezighi ezi na-ada n'ụzọ atọ - ọ nweghị ihe edere ma ọ bụrụ na ntuziaka ọ bụla na-akwado nkwado:

json
{
  "ok": false,
  "error": {
    "code": "validation_failed",
    "message": "post_max_size must be greater than or equal to upload_max_filesize",
    "fields": { "post_max_size": "lt_upload_max_filesize" },
    "request_id": "req_01J8Z4A2"
  }
}

Tọgharia mbugharị niile:

http
POST /api/user/sites/42/php/settings/reset

Mgbatị

http
GET /api/user/sites/42/php/extensions
json
{
  "ok": true,
  "data": {
    "php_version": "8.3",
    "loaded": ["bcmath", "curl", "gd", "intl", "mbstring", "opcache", "openssl", "pdo_mysql", "redis", "zip"],
    "available": ["imagick", "sodium", "xdebug"]
  }
}

Mgbanwe ndọtị chọrọ onye nchịkwa mgbe ha chọrọ ngwugwu usoro; rịọ ha site na tiketi.

Ebe nchekwa data na ndabere

http
POST /api/user/databases
{
  "name": "shop_prod",
  "user": "shop_user",
  "charset": "utf8mb4"
}
http
POST /api/user/backups/run
{
  "scope": ["files", "database"],
  "site_id": 42
}

Ọrụ ndabere na-eweghachi ihe nchọpụta ọrụ; ntuli aka GET /api/user/backups maka ọkwa kama igbochi arịrịọ ahụ.

Njehie

KooduPụtara
WFP0XAjụjụ otu ma ọ bụ karịa
WFP0XEruola oke ngwugwu
WFP0XNgalaba adịlarị na oke
WFP0XAkụrụngwa na-abụghị akaụntụ token
WFP0XNhazi dị irè mana ibugharị ya dara

Ejikọtara ya

Emelitere ikpeazụ: 2026-12-01