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

This package is auto-updated.

Last update: 2024-04-07 10:51:25 UTC


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.