This is a simple PHP implementation for Unibet API.
You can either get the files from GIT or you can install the library via Composer. To use Composer, simply add the following to your composer.json
file.
{
"require": {
"sharapov/unibet-php-api": "dev-master"
}
}
To initialize the API, you'll need to pass an array with your application key
and application_id
.
require_once "../vendor/autoload.php";
$api = new \Sharapov\UnibetPHP\UnibetAPI( [
'app_id' => 'APP_ID',
'app_key' => 'APP_KEY'
] );
// Request examples
// /sportsbook/groups
$response = $api->sportsbook()->groups()->json();
// /sportsbook/betoffer/event/{eventId}.{responseformat}
$response = $api->sportsbook()->betoffer()->event('EVENT_ID')->json();
// More examples are on https://developer.unibet.com/docs
print '<pre>';
print_r( json_decode($response->getBody()->getContents()) );
print '</pre>';