monsieursloop / woleet-php-sdk
Woleet.io API PHP SDK
1.0
2021-07-22 14:57 UTC
Requires
- php: ^7.2
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^6.2
This package is auto-updated.
Last update: 2025-02-22 23:10:53 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
Class | Method | HTTP request | Description |
---|---|---|---|
AnchorApi | createAnchor | POST /anchor | Create a new anchor. |
AnchorApi | deleteAnchor | DELETE /anchor/{anchorId} | Delete an anchor. |
AnchorApi | getAnchor | GET /anchor/{anchorId} | Get an anchor by its identifier. |
AnchorApi | getAnchorAttestation | GET /anchor/{anchorId}/attestation | Download the Proof Attestation document of an anchor. |
AnchorApi | searchAnchorIds | GET /anchorIds | Search for public anchor identifiers. |
AnchorApi | searchAnchors | GET /anchors | Search for anchors. |
AnchorApi | updateAnchor | PUT /anchor/{anchorId} | Update an anchor. |
DomainApi | createDomainUser | POST /domain/admin/user | Create a new domain user. |
DomainApi | deleteDomainUser | DELETE /domain/admin/user/{userId} | Delete a domain user. |
DomainApi | getDomainUser | GET /domain/admin/user/{userId} | Get a domain user by its identifier. |
DomainApi | searchDomainUsers | GET /domain/admin/users | Search for domain users. |
DomainApi | updateDomainUser | PUT /domain/admin/user/{userId} | Update a domain user. |
ReceiptApi | getOTSReceipt | GET /receipt/{anchorId}/ots | Get the proof receipt of an anchor (OpenTimestamps proof format). |
ReceiptApi | getReceipt | GET /receipt/{anchorId} | Get the proof receipt of an anchor. |
ReceiptApi | verifyReceipt | POST /receipt/verify | Verify a proof receipt. |
SignatureRequestApi | createSignatureRequest | POST /signatureRequest | Create a new signature request. |
SignatureRequestApi | delegateSignatureRequest | POST /signatureRequest/{requestId}/delegate | Sign a signature request by delegating the signature. |
SignatureRequestApi | deleteSignatureRequest | DELETE /signatureRequest/{requestId} | Delete a signature request. |
SignatureRequestApi | downloadSignatureRequestFile | GET /signatureRequest/{requestId}/file | Download the file to sign. |
SignatureRequestApi | getSignatureRequest | GET /signatureRequest/{requestId} | Get a signature request by its identifier. |
SignatureRequestApi | getSignatureRequestAttestation | GET /signatureRequest/{requestId}/attestation | Download the Signature Attestation document of a signature request. |
SignatureRequestApi | getSignatureRequestProofBundle | GET /signatureRequest/{requestId}/proofbundle | Get the proof bundle of a signature request. |
SignatureRequestApi | reportSignatureRequestEvent | POST /signatureRequest/{requestId}/event | Report an event on a signature request. |
SignatureRequestApi | reportSignatureRequestFeedback | POST /signatureRequest/{requestId}/feedback | Report a feedback about a signature request. |
SignatureRequestApi | searchSignatureRequestIds | GET /signatureRequestIds | Search for public signature request identifiers. |
SignatureRequestApi | searchSignatureRequests | GET /signatureRequests | Search for signature requests. |
SignatureRequestApi | sendSignatureRequestOTP | GET /signatureRequest/{requestId}/otp/{signeeId} | Generate and send an OTP to a signer of a signature request. |
SignatureRequestApi | sendSignatureRequestReminder | POST /signatureRequest/{requestId}/remind | Send a reminder email to a set of signers of a signature request. |
SignatureRequestApi | signSignatureRequest | POST /signatureRequest/{requestId}/sign | Sign a signature request by registering a signature. |
SignatureRequestApi | transitionSignatureRequest | POST /signatureRequest/{requestId}/transition | Change the state of a signature request. |
SignatureRequestApi | updateSignatureRequest | PUT /signatureRequest/{requestId} | Update a signature request. |
SignatureRequestApi | uploadSignatureRequestFile | POST /signatureRequest/{requestId}/file | Upload the file to sign. |
TokenApi | generateToken | GET /token | Generate a JWT token. |
TokenApi | revokeToken | DELETE /token | Revoke a JWT token. |
UserApi | getCallbackSecret | GET /user/callbackSecret | Get the current callback secret (null if not set). |
UserApi | getCredits | GET /user/credits | Get user's credits. |
UserApi | getTokens | GET /user/tokens | Get user's registered JWT tokens. |
UserApi | putTokens | PUT /user/tokens | Update user's registered JWT tokens. |
UserApi | updateCallbackSecret | PUT /user/callbackSecret | Generates a new callback secret. |
Documentation For Models
- Anchor
- AnchorIds
- Anchors
- AuthorizedSignee
- CallbackSecret
- Credits
- Identity
- IdentityVerificationStatus
- Info
- Key
- OtsReceipt
- PdfFile
- Receipt
- ReceiptAnchorsNode
- ReceiptProofNode
- ReceiptSignature
- ReceiptVerificationStatus
- RequestIdFileBody
- SignatureRequest
- SignatureRequestDelegate
- SignatureRequestEvent
- SignatureRequestFeedback
- SignatureRequestIds
- SignatureRequestProofBundle
- SignatureRequestSign
- SignatureRequestSignResult
- SignatureRequestState
- SignatureRequests
- SignatureVerificationStatus
- TimestampVerificationStatus
- Token
- Tokens
- User
- Users
- Watcher
- X500Name
- X509SubjectIssuer
Documentation For Authorization
BasicAuth
- Type: HTTP basic authentication
JWTAuth
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header