Download the PHP package davidvanerkelens/ynab-php-client without Composer
On this page you can find all versions of the php package davidvanerkelens/ynab-php-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download davidvanerkelens/ynab-php-client
More information about davidvanerkelens/ynab-php-client
Files in davidvanerkelens/ynab-php-client
Package ynab-php-client
Short Description A PHP client implementation for the You Need A Budget (YNAB) API.
License MIT
Informations about the package ynab-php-client
PHP client library for YNAB
This is a PHP client implementation for the You Need A Budget (YNAB) API.
:warning: This library is still in active development. Not all code is covered by tests yet, and contracts are subject to change. Breaking changes will be released according to semantic versioning version numbers.
Installation
Using composer
Manual installation
Download the contents of this repository, and include the vendor/autoloader.php
file.
Basic usage
In order to use this library, you need an API key. See the YNAB API documentation for more information about this.
Via the $client
object, all non-deprecated methods available on the YNAB API can be accessed. See this
document for all available methods on the client object.
Server knowledge
Several endpoints can be provided with a number, indicating the last server knowledge state. If available, the server knowledge state is included in the response object.
Error handling
If a request to the API returns an unexpected status code, a YnabErrorException will be thrown. In this exception, an instance of ErrorResponseInterface can be found, which contains the error reported by the YNAB API.
Milliunits
All amounts reported by the YNAB API are in milliunits format. A converter for this format is available.
Rate limiting
YNAB's API is rate limited to 200 requests per access token per hour. The current usage is returned by the YNAB API in a header, which you can fetch via the client object after a call to the API has been performed.
This function will return null
if no requests have been made yet. The returned value of this function is the number of
requests made towards the rate limit as reported at the moment of the last response from the YNAB API.
Caching
This library supports caching for all GET requests. By default, a simple in-memory cache will be used with a timeout of 5 minutes. If you want to disable caching, you can do so via the configuration object.
In the same way, you can configure the timeout for the cache.
You can also call the setCacheTimeout
function with null
to disable expiration of cached items.
It is also possible to provide your own caching adapter that implements the PSR-6
CacheItemPoolInterface
.
Contributing
This library is still an active work in progress by the author. Pull requests are appreciated, but the library can undergo structural changes at any moment in time.
Authors
License
All versions of ynab-php-client with dependencies
symfony/serializer Version ^5.3
symfony/property-access Version ^5.3
doctrine/annotations Version ^1.13
fig/http-message-util Version ^1.1
symfony/cache Version ^5.3
phpdocumentor/reflection-docblock Version ^5.2