m4tthumphrey/php-dynect-api-rest

0.1.4 2013-06-20 13:16 UTC

This package is auto-updated.

Last update: 2024-11-12 05:30:22 UTC


README

PHP wrapper for v2 of the Dynect API. This is very much a work in progress, do not use in production.

Foreword

I no longer have access to a Dynect account so will be unable to maintain this library until further notice. If anyone wishes to continue please contact me and I can transfer or add you onto the repo.

Installation

Install Composer

$ curl -sS https://getcomposer.org/installer | php
$ sudo mv composer.phar /usr/local/bin/composer

Add the following to your require block in composer.json config:

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

Include Composer's autoloader:

require_once dirname(__DIR__).'/vendor/autoload.php';

Usage

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>';
}