gedankengut / gsales-api-php
GSALES 3 REST PHP Client Library using PSR-17 and PSR-18
v3.0.1
2024-04-07 10:50 UTC
Requires
- php: ^8
- php-http/client-common: ^2.7
- php-http/discovery: ^1.12
- psr/http-client: ^1.0
- psr/http-client-implementation: ^1.0
- psr/http-factory: ^1.0
Requires (Dev)
- laminas/laminas-diactoros: ^2.4
- php-http/curl-client: ^2.1
- php-http/mock-client: ^1.4
- phpunit/phpunit: ^9.5
README
The GSALES PHP library provides convenient and easy access to the GSALES 3 REST API from applications written in the PHP language.
It includes a pre-defined set of classes for API resources and entities that makes it fast forward for developers to interact with GSALES 3.
Requirements
PHP 8 and later.
Composer
You can install the bindings via Composer. Run the following command:
composer require gedankengut/gsales-api-php
To use the bindings, use Composer's autoload:
require_once 'vendor/autoload.php';
Getting Started
Simple usage looks like:
<?php require_once 'vendor/autoload.php'; $clientBuilder = new \Gsales\ClientBuilder(); $clientBuilder->addPlugin(new \Http\Client\Common\Plugin\HeaderDefaultsPlugin(['Authorization' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'])); $clientOptions = new \Gsales\Options(['client_builder' => $clientBuilder,'api_uri' => 'https://mydomain.de/gsales3/api']); $gsales = new \Gsales\Client($clientOptions); $gsales->articles()->get()
For more examples how to use the Client Library in detail see examples/gsales-client.php
file.