monsieursloop/woleet-php-sdk

Woleet.io API PHP SDK

1.0 2021-07-22 14:57 UTC

This package is auto-updated.

Last update: 2024-11-22 22:39:52 UTC


README

Welcome to Woleet API reference documentation.
It is highly recommanded to read the chapters introducing Woleet API concepts before reading this documentation.

This PHP package is automatically generated by the Swagger Codegen project:

  • API version: 1.10.0
  • Package version: 1
  • Build package: io.swagger.codegen.v3.generators.php.PhpClientCodegen For more information, please visit https://www.woleet.io/

Requirements

PHP 5.5 and later

Installation & Usage

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/monsieursloop/woleet-php-sdk.git"
    }
  ],
  "require": {
    "monsieursloop/woleet-php-sdk": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

    require_once('/path/to/WoleetPhpSdk/vendor/autoload.php');

Tests

To run the unit tests:

composer install
./vendor/bin/phpunit

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: BasicAuth
$config = WooletClient\Configuration::getDefaultConfiguration()
    ->setUsername('YOUR_USERNAME')
    ->setPassword('YOUR_PASSWORD');
// Configure API key authorization: JWTAuth
$config = WooletClient\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = WooletClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');

$apiInstance = new WooletClient\API\AnchorApi(
    // 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
);
$body = new \WooletClient\Model\Anchor(); // \WooletClient\Model\Anchor | Anchor object to create.

try {
    $result = $apiInstance->createAnchor($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AnchorApi->createAnchor: ', $e->getMessage(), PHP_EOL;
}
// Configure HTTP basic authorization: BasicAuth
$config = WooletClient\Configuration::getDefaultConfiguration()
    ->setUsername('YOUR_USERNAME')
    ->setPassword('YOUR_PASSWORD');
// Configure API key authorization: JWTAuth
$config = WooletClient\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = WooletClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');

$apiInstance = new WooletClient\API\AnchorApi(
    // 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
);
$anchor_id = "anchor_id_example"; // string | Identifier of the anchor to delete.

try {
    $apiInstance->deleteAnchor($anchor_id);
} catch (Exception $e) {
    echo 'Exception when calling AnchorApi->deleteAnchor: ', $e->getMessage(), PHP_EOL;
}
// Configure HTTP basic authorization: BasicAuth
$config = WooletClient\Configuration::getDefaultConfiguration()
    ->setUsername('YOUR_USERNAME')
    ->setPassword('YOUR_PASSWORD');
// Configure API key authorization: JWTAuth
$config = WooletClient\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = WooletClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');

$apiInstance = new WooletClient\API\AnchorApi(
    // 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
);
$anchor_id = "anchor_id_example"; // string | Identifier of the anchor to retrieve.

try {
    $result = $apiInstance->getAnchor($anchor_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AnchorApi->getAnchor: ', $e->getMessage(), PHP_EOL;
}
// Configure HTTP basic authorization: BasicAuth
$config = WooletClient\Configuration::getDefaultConfiguration()
    ->setUsername('YOUR_USERNAME')
    ->setPassword('YOUR_PASSWORD');
// Configure API key authorization: JWTAuth
$config = WooletClient\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = WooletClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');

$apiInstance = new WooletClient\API\AnchorApi(
    // 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
);
$anchor_id = "anchor_id_example"; // string | Identifier of the anchor.

try {
    $result = $apiInstance->getAnchorAttestation($anchor_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AnchorApi->getAnchorAttestation: ', $e->getMessage(), PHP_EOL;
}
// Configure HTTP basic authorization: BasicAuth
$config = WooletClient\Configuration::getDefaultConfiguration()
    ->setUsername('YOUR_USERNAME')
    ->setPassword('YOUR_PASSWORD');
// Configure API key authorization: JWTAuth
$config = WooletClient\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = WooletClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');

$apiInstance = new WooletClient\API\AnchorApi(
    // 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
);
$page = 0; // int | Index of the page to retrieve (from 0).
$size = 20; // int | Number of anchor identifiers per page.
$hash = "hash_example"; // string | `hash` to search for: all public anchors whose `hash` property is equal are returned.
$signed_hash = "signed_hash_example"; // string | `signedHash` to search for: all public anchors whose `signedHash` property is equal are returned.

try {
    $result = $apiInstance->searchAnchorIds($page, $size, $hash, $signed_hash);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AnchorApi->searchAnchorIds: ', $e->getMessage(), PHP_EOL;
}
// Configure HTTP basic authorization: BasicAuth
$config = WooletClient\Configuration::getDefaultConfiguration()
    ->setUsername('YOUR_USERNAME')
    ->setPassword('YOUR_PASSWORD');
// Configure API key authorization: JWTAuth
$config = WooletClient\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = WooletClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');

$apiInstance = new WooletClient\API\AnchorApi(
    // 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
);
$page = 0; // int | Index of the page to retrieve (from 0).
$size = 20; // int | Number of anchors per page.
$direction = "ASC"; // string | Sorting direction: ASC for ascending DESC for descending.
$sort = "created"; // string | Sorting property: possible values are limited to `created`, `hash` and `signedHash`.
$name = "name_example"; // string | `name` to search for: all anchors whose `name` property contains this sub-string are returned.<br> **WARNING: Searching by name can timeout on a large anchor set.**
$hash = "hash_example"; // string | `hash` to search for: all anchors whose `hash` property is equal are returned.
$signed_hash = "signed_hash_example"; // string | `signedHash` to search for: all anchors whose `signedHash` property is equal are returned.
$tags = array("tags_example"); // string[] | Tags to search for: all anchors having all of these tags sets are returned.

try {
    $result = $apiInstance->searchAnchors($page, $size, $direction, $sort, $name, $hash, $signed_hash, $tags);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AnchorApi->searchAnchors: ', $e->getMessage(), PHP_EOL;
}
// Configure HTTP basic authorization: BasicAuth
$config = WooletClient\Configuration::getDefaultConfiguration()
    ->setUsername('YOUR_USERNAME')
    ->setPassword('YOUR_PASSWORD');
// Configure API key authorization: JWTAuth
$config = WooletClient\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = WooletClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');

$apiInstance = new WooletClient\API\AnchorApi(
    // 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
);
$body = new \WooletClient\Model\Anchor(); // \WooletClient\Model\Anchor | Anchor object to update.
$anchor_id = "anchor_id_example"; // string | Identifier of anchor to update.

try {
    $result = $apiInstance->updateAnchor($body, $anchor_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AnchorApi->updateAnchor: ', $e->getMessage(), PHP_EOL;
}
?>

Documentation for API Endpoints

All URIs are relative to https://api.woleet.io/v1

Documentation For Models

Documentation For Authorization

BasicAuth

  • Type: HTTP basic authentication

JWTAuth

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Author

contact@woleet.com