First, you need to install the library. For this, use Composer:
composer require ardralik/blizzard-api
First, you need to init the Client which is used by all Blizzard APIs:
// I assume you have included Composer autoloader
$client = new \Ardralik\API\Blizzard\Client("clientId", "clientSecret", "returnUri");| Parameter | Type | Description |
|---|---|---|
clientId |
string |
Your Blizzard App public key |
clientSecret |
string |
Your Blizzard App secret key |
returnUri |
string |
The value you have set in your Blizzard App settings |
First, init the WoW class. It uses the Client object previously created:
$wow = new \Ardralik\API\Blizzard\WoW($client);Then, call the get method:
$wow->get("ressource", "data");| Parameter | Type | Description |
|---|---|---|
ressource |
string |
The ressource you want to retrieve |
data |
array |
Params required by the ressource |
Here is data structure depending on ressource:
| Ressource | 'data' keys (type) | Details |
|---|---|---|
| achievement | id (int) | |
| auction | realm (string) | |
| boss | id (int) | Can be blank to get all bosses. 'data' is not required in this case. |
| challenge | realm (string) | Can be blank to get all realms of the region. 'data' is not required in this case. |
| character | realm (string) | |
| name (string) | ||
| fields (array) |
Example: ["achievements", "mounts"]Not required to get basic info. |
|
| guild | realm (string) | |
| name (string) | ||
| fields (array) |
Example: ["members"]Not required to get basic info. |
|
| item | id (int) | |
| item_set | id (int) | |
| mount | *None* | |
| pet | details (string) |
'data' is not required to get a list of all pets. If used, available values are:
|
| id (int) | Required only if 'type' key used. | |
| pvp | format (string) |
Available values:
|
| quest | id (int) | |
| realm | ||
| recipe | id (int) | |
| spell | id (int) | |
| zone | id (int) | Can be blank for all zones. 'data' not required in this case. |
| data | type (string) |
Available values:
|
| gameData | data (string) |
Available balues :
|
Additional values when using gameData:
| 'gameData' value | 'data' key | Optional/Required |
|---|---|---|
| achievementCategory | id (int) | Optional |
| achievement | id (int) | Optional |
| achievementMedia | id (int) | Required |
| connectedRealm | id (int) | Optional |
| creatureFamily | id (int) | Optional |
| creatureType | id (int) | Optional |
| creature | id (int) | Required |
| creatureDisplayMedia | id (int) | Required |
| creatureFamilyMedia | id (int) | Required |
| guild | realm (string) | Required |
| name (string) | Required | |
| guildAchievements | realm (string) | Required |
| name (string) | Required | |
| guildRoster | realm (string) | Required |
| name (string) | Required | |
| guildCrestBorder | id (int) | Required |
| guildCrestEmblem | id (int) | Required |
| mythicAffix | id (int) | Optional |
| mythicRaid | raid (string) | Required |
| faction (string) | Required | |
| mythicKeystoneDungeon | id (int) | Optional |
| mythicKeystonePeriod | id (int) | Optional |
| mythicKeystoneSeason | id (int) | Optional |
| mythicLeaderboard | id (int) | Required (connected-realm ID) |
| dungeon (int) | Optional | |
| period (int) | Required (only if 'dungeon' is used) | |
| pet | id (int) | Optional |
| class | id (int) | Optional |
| classPvP | id (int) | Required |
| specialization | id (int) | Optional |
| powerType | id (int) | Optional |
| PvPSeason | id (int) | Optional |
| PvPLeaderboard | id (int) | Required |
| bracket (string) | Optional | |
| PvPRewards | id (int) | Required |
| PvPTier | id (int) | Optional |
| PvPTierMedia | id (int) | Optional |
| realms | slug (string) | Optional |
| region | id (int) | Optional |
First, init the Diablo class. It uses the Client object previously created:
$diablo = new \Ardralik\API\Blizzard\Diablo($client);Then, call the get method:
$wow->diablo("ressource", "data");| Parameter | Type | Description |
|---|---|---|
ressource |
string |
The ressource you want to retrieve |
data |
array |
Params required by the ressource |
Here is data structure depending on ressource:
| Ressource | 'data' keys (type) | Details |
|---|---|---|
| act | id (int) | Not required. 'data' not required in this case. |
| artisan_recipe | artisan (string) | |
| recipe (string) | Optional | |
| follower | slug (string) | |
| class_skill | hero (string) | |
| skill (string) | Not required. 'data' not required in this case. | |
| item_type | type (string) | Not required. 'data' not required in this case. |
| item | slug (string) | |
| profile | battleTag (string) | |
| hero (int) | ID of the hero | |
| field (string) |
Available values:
|
First, init the Oauth class. It uses the Client object previously created:
$oauth = new \Ardralik\API\Blizzard\Oauth($client);Then, call the get method:
$wow->oauth("ressource", "data");| Parameter | Type | Description |
|---|---|---|
ressource |
string |
The ressource you want to retrieve |
data |
array |
Params required by the ressource |
Here is data structure depending on ressource:
| Ressource | 'data' keys (type) | Details |
|---|---|---|
| link | scope (string) |
Available values:
|
| state (string) | ||
| token | scope (string) | The same used previously via 'link' |
| code (string) | ||
| characters | token (string) | |
| check_token | token (string) |