staatic/staatic-api-php

Staatic API客户端库用于PHP。Staatic允许您创建和部署WordPress站点的简化静态版本,同时提升性能、SEO和安全性。

1.0.2 2024-05-23 07:50 UTC

This package is auto-updated.

Last update: 2024-09-23 08:29:44 UTC


README

这是Staatic API。您可以在https://staatic.com了解更多关于Staatic的信息。

如需更多信息,请访问https://staatic.com/support

安装与使用

要求

PHP 7.4及更高版本。也应在PHP 8.0+上运行。

Composer

要使用Composer安装绑定,请运行以下命令

composer require staatic/staatic-api-php

入门

请按照安装流程进行操作,然后运行以下命令

<?php
require_once(__DIR__ . '/vendor/autoload.php');



// Configure OAuth2 access token for authorization: oauth_site
$config = Staatic\Api\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Configure OAuth2 access token for authorization: oauth_user
$config = Staatic\Api\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Staatic\Api\Api\AccountApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$create_site_request = new \Staatic\Api\Model\CreateSiteRequest(); // \Staatic\Api\Model\CreateSiteRequest | Site to be created

try {
    $result = $apiInstance->createSite($create_site_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AccountApi->createSite: ', $e->getMessage(), PHP_EOL;
}

API端点

所有URI都是相对于https://api.staatic.com

模型

授权

为API定义的认证方案

oauth_site

  • 类型: OAuth
  • 流程: application
  • 授权URL: ``
  • 范围: N/A

oauth_user

  • 类型: OAuth
  • 流程: password
  • 授权URL: ``
  • 范围:
    • manage-deployments: 管理部署
    • manage-forms: 管理表单
    • manage-sites: 管理站点
    • manage-search: 管理搜索

public_api_key

  • 类型: API密钥
  • API密钥参数名称: X-Staatic-API-Key
  • 位置: HTTP头

关于此包

此PHP包由OpenAPI Generator项目自动生成

  • API版本: 1.0.2
    • 包版本: 1.0.2
  • 构建包: org.openapitools.codegen.languages.PhpClientCodegen