OpenAPIClient-php
SDK to interact with all print instructions (StandKizzen) from the file service
This PHP package is automatically generated by the OpenAPI Generator project:
- API version: 1.0.0
- Build package: org.openapitools.codegen.languages.PhpClientCodegen
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/andresfabianguerrero/standkizzenservice-sdk.git"
}
],
"require": {
"andresfabianguerrero/standkizzenservice-sdk": ">=1.1"
}
}
Then run composer install
Manual Installation
Download the files and include autoload.php
:
require_once('/path/to/OpenAPIClient-php/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 Bearer (JWT) authorization: bearerAuth
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new OpenAPI\Client\Api\DefaultApi(
// 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
);
$key_parameters = new \OpenAPI\Client\Model\KeyParameters(); // \OpenAPI\Client\Model\KeyParameters | Data to perform a delete
try {
$apiInstance->deletePrintInstruction($key_parameters);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->deletePrintInstruction: ', $e->getMessage(), PHP_EOL;
}
?>
Documentation for API Endpoints
All URIs are relative to http://api.standskizzen.giffits.local
Class | Method | HTTP request | Description |
---|---|---|---|
DefaultApi | deletePrintInstruction | DELETE / | Delete a print instruction in the file service |
DefaultApi | getTokenAction | GET /auth/token | Authenticate the client in order to retrieve the authorization access |
DefaultApi | modifyDataPrintInstruction | PATCH / | Update a property of a print instruction in the file service |
DefaultApi | savePrintInstructionsAction | POST / | Create a new record in the file service |
DefaultApi | searchByParams | GET / | Search print instructions by multiple metadata |
DefaultApi | searchFilesPixel | GET /search/files/vector | Search print instructions by multiple metadata and return the file as PDF |
DefaultApi | searchFilesVector | GET /search/files/pixel | Search print instructions by multiple metadata and return the file converted to a image |
DefaultApi | updatePrintInstructionsAction | PUT / | Update two or more properties of a print instruction in the file service |
Documentation For Models
- AuthToken
- BadCredentials
- BadParameters
- BadParametersStructure
- DuplicatedRecord
- FileInformation
- FileInformationPixel
- FileInformationVector
- FileObject
- FileObjectSingle
- GeneralError
- KeyParameters
- MetadataInfo
- NotFound
- Unauthorized
- UserData
Documentation For Authorization
For JWT configuration follow this steps:
Generate the SSH keys :
$ mkdir -p config/jwt # For Symfony3+, no need of the -p option
$ openssl genrsa -out config/jwt/private.pem -aes256 4096
$ openssl rsa -pubout -in config/jwt/private.pem -out config/jwt/public.pem
Configuration
Configure the SSH keys path in your config/packages/lexik_jwt_authentication.yaml
:
Also you can create .env variables here.
lexik_jwt_authentication:
secret_key: '%kernel.project_dir%/config/jwt/private.pem' # required for token creation
public_key: '%kernel.project_dir%/config/jwt/public.pem' # required for token verification
pass_phrase: 'your_secret_passphrase' # required for token creation, usage of an environment variable is recommended
token_ttl: 3600
BearerAuth
- For every endpoint you need to generate a token using the endpoint (/get_token).
- Please see the endpoint examples.