PHP code example of m4tthumphrey / php-dynect-api-rest

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

    

m4tthumphrey / php-dynect-api-rest example snippets




try {
    $client = new Dynect\Client();
    $response = $client->api('session')->login('company_name', 'username', 'password');

    print_r($response);

    /*
    Array
    (
        [token] => ...
        [version] => 3.4.0
    )
    */
} catch (Exception $e) {
    echo '<h1>Error!</h1><p>'.$e->getMessage().'</p>';
}

"m4tthumphrey/php-dynect-api-rest": "dev-master"