PHP code example of onfact / onfact-api-php

1. Go to this page and download the library: Download onfact/onfact-api-php 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/ */

    

onfact / onfact-api-php example snippets


composer 

<?PHP

<?PHP
define('ONFACT_API_KEY', '...');
$onFact = new onFact\Api(ONFACT_API_KEY);
$id = $onFact->Customers->add(array(
    'Contact' => array(
        'name' => 'John Dhoe',
    )
));
$customer = $onFact->Customer->view($id);
echo $customer['Contact']['name']; // John Dhoe