sportsit/api-client

PHP library for interacting with the DASH Platform API

v2.1.0 2020-09-01 01:20 UTC

README

Dash - API Client Library

Additional documentation to follow.

Installing Dash API Client

With Composer

The recommended way to install Dash API Client is through Composer.

# Install Composer
curl -sS https://getcomposer.org/installer | php

Next, run the Composer command to install the latest stable version of Dash API Client:

php composer.phar require sportsit/api-client

After installing, you need to require Composer's autoloader:

require 'vendor/autoload.php';

You can then later update Dash API Client using composer:

composer.phar update

Usage

Creation of a client can be done as shown below:

$config = new \Dash\Configuration($clientID, $clientSecret, $companyCode);
$client = new \Dash\Client($config);

The client is a simple wrapper around the Guzzle HTTP library and as such any Guzzle methods can be accessed on the client as well.

$response = $client->get($uri, $options);

Making calls to the Dash API requires that you have a valid access token so make sure you authenticate with the API before making any other calls. Once you have an access token, it will automatically be added to all subsequent calls.

$response = $client->authenticate()->get($uri, $options);