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: 2025-05-23 09:58:52 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

Class Method HTTP request Description
AccountApi createSite POST /v1/sites Creates a new site
AccountApi deleteSite DELETE /v1/sites/{id} Deletes an existing site
AccountApi getPlugins GET /v1/plugins Gets a collection of plugins
AccountApi getSiteById GET /v1/sites/{id} Gets a site by ID
AccountApi getSites GET /v1/sites Gets a collection of sites
AccountApi getSubscriptions GET /v1/subscriptions Gets a collection of subscriptions
AccountApi updateSite PATCH /v1/sites/{id} Updates an existing site
DeploymentsApi createDeployment POST /v1/deployments Creates a new deployment
DeploymentsApi getDeploymentById GET /v1/deployments/{id} Gets a deployment by ID
DeploymentsApi getDeployments GET /v1/deployments Gets a collection of deployments
DeploymentsApi getSiteFiles GET /v1/sites/{id}/files Gets a collection of deployment files for the specified site
DeploymentsApi updateDeployment PATCH /v1/deployments/{id} Updates an existing deployment
DeploymentsApi uploadDeploymentFile PUT /v1/deployments/{id}/files/{path} Uploads a deployment file
FormsApi createForm POST /v1/forms Creates a new form
FormsApi createFormNotification POST /v1/form-notifications Creates a new form notification
FormsApi createFormSubmission POST /v1/form-submissions Creates a new form submission
FormsApi createFormTemplate POST /v1/form-templates Creates a new form template
FormsApi deleteForm DELETE /v1/forms/{id} Deletes an existing form
FormsApi deleteFormNotification DELETE /v1/form-notifications/{id} Deletes an existing form notification
FormsApi deleteFormSubmission DELETE /v1/form-submissions/{id} Deletes an existing form submission
FormsApi deleteFormTemplate DELETE /v1/form-templates/{id} Deletes an existing form template
FormsApi getFormById GET /v1/forms/{id} Gets a form by ID
FormsApi getFormNotificationById GET /v1/form-notifications/{id} Gets a form notification by ID
FormsApi getFormNotifications GET /v1/form-notifications Gets a collection of form notifications
FormsApi getFormSubmissionById GET /v1/form-submissions/{id} Gets a form submission by ID
FormsApi getFormSubmissions GET /v1/form-submissions Gets a collection of form submissions
FormsApi getFormTemplateById GET /v1/form-templates/{id} Gets a form template by ID
FormsApi getFormTemplates GET /v1/form-templates Gets a collection of form templates
FormsApi getForms GET /v1/forms Gets a collection of forms
FormsApi updateForm PATCH /v1/forms/{id} Updates an existing form
FormsApi updateFormNotification PATCH /v1/form-notifications/{id} Updates an existing form notification
FormsApi updateFormSubmission PATCH /v1/form-submissions/{id} Updates an existing form submission
FormsApi updateFormTemplate PATCH /v1/form-templates/{id} Updates an existing form template
SearchApi clearSearchIndexByName POST /v1/search-indices/{index}/clear Clears a search index by name
SearchApi createSearchIndex POST /v1/search-indices Creates a new search index
SearchApi deleteSearchIndex DELETE /v1/search-indices/{index} Deletes an existing search index
SearchApi deleteSearchRecord DELETE /v1/search-indices/{index}/{id} Deletes an existing search record
SearchApi deleteSearchRecords POST /v1/search-indices/{index}/delete Deletes search records from the specified search index
SearchApi getSearchIndexByName GET /v1/search-indices/{index} Gets a search index by name
SearchApi getSearchIndices GET /v1/search-indices Gets a collection of search indices
SearchApi importSearchRecords POST /v1/search-indices/{index}/import Imports search records into the specified search index
SearchApi search POST /v1/search/{index} Performs a search query on the specified search index
SearchApi updateSearchIndex PATCH /v1/search-indices/{index} Updates an existing search index

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