This PHP package is a lightweight wrapper for OpenXBL. It's the easiest way to use OpenXBL in your PHP application.
Part of the XBL.IO feature set.
<?php
// Instantiate.
require __DIR__ . '/vendor/autoload.php';
use OpenXBL\Client;
$client = new Client('API_KEY');
print_r($client->get('account'));
?>
This library is available through Composer.
Use the following command:
`composer require openxbl/openxbl`
Alternatively, add the repository in your composer.json file. If you don't already have this file create it at the root of your project with this content:
{
"name": "Example Application",
"description": "This is an example of OpenXBL",
"require": {
"openxbl/openxbl": "^2"
}
}
<?php
// Instantiate.
require __DIR__ . '/vendor/autoload.php';
use OpenXBL\Client;
$client = new Client('APP_KEY');
$client->isApp = true;
print_r($client->get('account'));
?>
<?php
// Instantiate.
require __DIR__ . '/vendor/autoload.php';
use OpenXBL\Auth;
$auth = new Auth('YOUR_PUBLIC_KEY');
$response = $auth->claim('CODE_VALUE');
?>
<?php
// Format the response (either json or xml).
$client->format = 'json';
// Language of response.
$client->language = 'en-US,en';
?>
This wrapper is built using OpenXBL /api/v2/
Visit our discord channel and say hello!