PHP code example of davidvanerkelens / ynab-php-client

1. Go to this page and download the library: Download davidvanerkelens/ynab-php-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

davidvanerkelens / ynab-php-client example snippets


// Create a basic configuration
// Returns an instance of ConfigurationInterface
$config = YNAB::createConfiguration('your api token');

// Create a client object
// Returns an instance of ClientInterface
$client = YNAB::createClient($config);

$converter = YNAB::getMilliunitsConverter();
$converter->toFloat(123930); // returns 123.93
$converter->fromFloat(123.93); // returns 123930

$config = YNAB::createConfiguration('your api token');
$client = YNAB::createClient($config);

// your logic here

$rateLimit = $client->getRateLimit();

$config = YNAB::createConfiguration('your api token');
$config->setCachingDisabled(true);

$config = YNAB::createConfiguration('your api token');
$config->setCacheTimeout(new DateInterval("PT10M"));

$config = YNAB::createConfiguration('your api token');
$config->setCacheItemPool(new MyCache());

composer