staatic/staatic-api-php

Staatic API client library for PHP. Staatic lets you create and deploy a streamlined static version of your WordPress site, enhancing performance, SEO, and security simultaneously.

1.0.2 2024-05-23 07:50 UTC

This package is auto-updated.

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


README

This is the Staatic API. You can find out more about Staatic at https://staatic.com.

For more information, please visit https://staatic.com/support.

Installation & Usage

Requirements

PHP 7.4 and later. Should also work with PHP 8.0+.

Composer

To install the bindings via Composer, run:

composer require staatic/staatic-api-php

Getting Started

Please follow the installation procedure and then run the following:

<?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 Endpoints

All URIs are relative to https://api.staatic.com

Models

Authorization

Authentication schemes defined for the API:

oauth_site

  • Type: OAuth
  • Flow: application
  • Authorization URL: ``
  • Scopes: N/A

oauth_user

  • Type: OAuth
  • Flow: password
  • Authorization URL: ``
  • Scopes:
    • manage-deployments: Manage deployments
    • manage-forms: Manage forms
    • manage-sites: Manage sites
    • manage-search: Manage search

public_api_key

  • Type: API key
  • API key parameter name: X-Staatic-API-Key
  • Location: HTTP header

About this package

This PHP package is automatically generated by the OpenAPI Generator project:

  • API version: 1.0.2
    • Package version: 1.0.2
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen