Giter VIP home page Giter VIP logo

blizzard-api-php-client's Introduction

Blizzard API PHP Client

API client for Blizzard API written in PHP. Blizzard API Documentation

Scrutinizer Code Quality Build Status Latest Stable Version Total Downloads SensioLabsInsight

Installation

$ composer require logansua/blizzard-api-client

This command requires you to have Composer installed globally, as explained in the Composer documentation.

Basic usage

// Include composer autoload file
require_once __DIR__.'/../vendor/autoload.php';

// Create a new Blizzard client with Blizzard API key and secret
$client = new \BlizzardApi\BlizzardClient('apiKey', 'apiSecret');

// Create a new API service with configured Blizzard client
$diablo = new \BlizzardApi\Service\Diablo($client);

// Use API method for getting specific data
$response = $diablo->getItemDataById('Unique_Shoulder_103_x1');

// Show response body
echo $response->getBody();

List of available API services

Contributing

See CONTRIBUTING file.

License

This software is published under the MIT License

blizzard-api-php-client's People

Contributors

duronrulez avatar illepic avatar logansua avatar rgdeploy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blizzard-api-php-client's Issues

Unable to get user data

I am trying to get user data, mainly the battletag for a single user through OAuth. I am, however, getting an error 403 from Guzzle.

My code is minimal:

$client = new BlizzardClient(config('blizzard.key'), config('blizzard.secret'), config('blizzard.region'), config('blizzard.locale'));

$auth = new CommunityOAuth($client);
$user = $auth->getUser();

return $user;

When using the tool at https://dev.battle.net/io-docs, an extra "authorization code" is needed to generate the access token, but I cannot find any reference to it here. The resulting link, here looks similar to the one provided by Blizzard, but it always results in the 403 error {"code":403, "type":"Forbidden", "detail":"Not Authorized"}.

Composer Problem

I have cpanel and cannot install composer to my account. I tried logging into SSH and everything. My bin directory is read-only.

What can I do? I don't know enough about the requirements for connecting to the blizz api but it seems like a lot of other developers are using composer for their projects.

How can I use this without composer?

Json mapping

  • Add mapping json result to objects

Some part of it already in feature-wow-api-mapping branch

Update to new Blizzard API format

Blizzard has recently changed their API format - if work is already being done to transition this package to use the new format, great, if not, I'm forked and ready to start work on it.

setup

Seems to be a good work, but not everybody have access to his server.
Like me i think lots of people cant use your work because of that.
Personnaly i only have access to ftp & mysql.

Cannot get WoW realm status

The url for this seems to be wrong:

Currently:

    public function getRealmStatus(array $options = [])
    {
        return $this->request('/realm/', $options);
    }

I believe this should be:

    public function getRealmStatus(array $options = [])
    {
        return $this->request('/realm/status', $options);
    }

I'd be happy to submit a PR once this is verified as an issue

Already working?

Code:

$client = new BlizzardApi\BlizzardClient('My_API_KEY');

$blizzApi = new BlizzardApi\Service\Diablo($client);
$blizzApi->getCareerProfile('MY_BATTLE_TAG'');

Expected:

Json with career data.

Got:

PHP Fatal error: Uncaught GuzzleHttp\Exception\ClientException: Client error: GET https://us.api.battle.net/d3/profile/MY_BATTLE_TAG?locale=en_us&apiKey=My_API_KEY/ resulted in a 404 Not Found...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.