fw4 / setle-api
PHP library for implementing the Setle API
v2.1.0
2024-06-26 12:20 UTC
Requires
- php: ^7.1|^8.0|^8.1
- caseyamcl/guzzle_retry_middleware: ^2.10
- guzzlehttp/guzzle: ~6.0|~7.0
- ocramius/package-versions: ^1.4|^2.1
Requires (Dev)
- phpstan/phpstan: ^1.4|^1.9
- phpunit/phpunit: ^7.5|^8.4|^9.0
- squizlabs/php_codesniffer: ^3.7
This package is auto-updated.
Last update: 2024-12-26 13:20:30 UTC
README
PHP client for the Setle API. For information and terms of use, refer to the official documentation.
Installation
composer require fw4/setle-api
Usage
use Setle\Setle; // Instantiate the API using a client id and client secret $api = new Setle('client-id-string', 'client-secret-string'); // Request a list of estates $estates = $api->getEstates(); foreach ($estates as $estate) { echo $estate->estate->estate_type . ': ' . $estate->referral_link . PHP_EOL; }
Access tokens
Access tokens are managed by the library, and long-running scripts will automatically trigger a refresh when a token
expires. Due to the short lifespan of Setle's access tokens it is not recommended to manage tokens manually, but it is
supported through the requestAccessToken()
and setAccessToken()
methods.
License
fw4/setle-api
is licensed under the MIT License (MIT). Please see LICENSE for more information.