Home

Kadala Documentation Release 0.1.0 Finlay Beaton

image

Contents

1. driver Sclient gt setCache cache retrieve the item data SitemId P1_CruShield_norm_unique_02 data Sclient gt getItem SitemId Sdata now contains the item type information 1 8 2 SQLite cache Setting the location of the SQLite cache is optional Notice the additional use statements use Stash Driver Sqlite use Stash Pool use Kadala Client use Kadala Region create a new Client SapiKey my bnet api key Sclient new Client Sapikey Region US create the driver for our cache Sdriver new Sqlite optionally set a custom location for the cache Sdriver gt setOptions path gt tmp myCache D create and set the cache Scache new Pool driver 1 8 Set up Caching 25 Kadala Documentation Release 0 1 0 Sclient gt setCache cache retrieve the item data SitemId P1_CruShield_norm_unique_02 data S client gt getItem SitemId Sdata now contains the item type information 1 9 Advanced Options 1 9 1 Region You may want to handle retrieving data in multiple regions or locales The simplest way to handle this is as recommended elsewhere in the manual to create additional Client objects for each region or locale you want Treating the Client as emutable is the safest course of action and will result in the fewest bugs in your code Nevertheless Kadala does provides alternatives to advanced
2. gt string name gt string lc icon gt string displayColor gt string tooltipParams gt string MinMaxData min gt float max gt float 1 6 Get Career You can retrieve information about a player called a career This includes paragon information the list and some information about their heroes and their global account progression To learn what specific items and skills a player uses on a hero see Get Hero instead There is currently no way to know what recipes that drop rare set and legendary the player has learned on their artisans Remember that player and hero data is specific to each region You must specify the correct region for the player you wish to retrieve or you will not get the data 16 Chapter 1 User manual Kadala Documentation Release 0 1 0 1 6 1 Methods Available methods on Client to get player career data are e getCareer lt battleTag gt 1 6 2 Code Example Notice how since wudi jo 2228 plays in europe we had to specify Region EUROPE to our Client use Kadala Client use Kadala Region create a new Client Sapikey my bnet api key Sclient new Client Sapikey Region EUROPE retrieve the item data SbattleTag wudijo 2228 data client gt getCareer SbattleTag Sdata now contains the item data structure 1 6 3 Data Structures For your reference only not aut
3. region gt string locale gt string retrieved gt string lastModified gt string api RecipeData id gt string slug gt string name gt string lc cost gt int in gold reagents gt quantity gt int item gt ReagentItemData reagent another reagent reagents itemProduced gt ProducedItemData ReagentltemData id gt string name gt string lc icon gt string displayColor gt string tooltipParams gt string ProducedltemData Because two of ProducedItemData properties refer back up to RecipeData the 2nd time the ProducedItemData is listed the recipe and craftedBy properties are omitted to avoid an invite loop id gt string name gt string lc icon gt string displayColor gt string tooltipParams gt string recipe gt RecipeData 2nd pass omitted 1 3 Get Artisan 9 Kadala Documentation Release 0 1 0 craftedBy gt RecipeData 2nd pass omitted RecipeData for Mystic without RecipeData The mystic as of May 2015 does not have any trainable recipes It is recommended you deal with the mystic like you would any other artisan However it is worth highlighting how simpler her data structure is as a result slug gt mystic name gt Mystic lc portrait gt pt_mystic t
4. Complex array items are sometimes split into their own Data Structure which may also repeat where marked Kadala inserts the api key into the results with important request and response parameters FollowerData As of May 2015 the value of realName contains something like d3 follower templar realName which may be a bug slug gt string name gt string lc realName gt string portrait gt string Skills gt active gt FollowerActiveSkillData another FollowerActiveSkillData active passive gt not currently used ly skills api gt region gt string locale gt string retrieved gt string lastModified gt string 1 api FollowerActiveSkillData The description and simpleDescription are displayed to the user depending on the simple descriptions in game option slug gt string name gt string lc icon gt string level gt int tooltipUrl gt string description gt string lc 12 Chapter 1 User manual Kadala Documentation Release 0 1 0 simpleDescription gt string lc skillCalcId gt string 1 5 Get Item You can retrieve general information about an item including some base stats This is a good way to obtain the names and descriptions for a specific locale To learn what specific items a player uses see Get Hero instead 1 5 1 M
5. It additionally requires the use of Composer for dependency management Dependencies If you use composer skip this section as it will automatically download the following additional required libraries for you e Guzzle PHP HTTP Client e Stash PHP Caching Client e Version Github version helpers Battle net API Key You will need an API key from the Battle net API Portal 1 Register for an account on the Battle net API Portal This will be different from your regular battle net ac count 2 Login on the Battle net API Portal This is different from logging into the main Battle net website or the Bat tle net desktop launcher 3 Create a new application on the My Applications page You will need to know where on the internet your website will function don t worry if your website is just an information page about your application Kadala Documentation Release 0 1 0 4 Obtain your key from the My Applications page You will not need the secret listed on other pages just your key This is your API key and should be used whenever you are asked for an apiKey or my bnet api key 1 1 2 Installing via Composer The recommended way to install Kadala is through Composer Install Composer curl sS https getcomposer org installer php Next run the Composer command to install the latest stable version composer phar require kadala kadala After installing you need to require Composer s auto
6. Region US You will need a Client for each region you want to access when in doubt pick your own use Kadala Client use Kadala Region create a Client Sapikey my bnet api key Sclient new Client Sapikey Region US You could then call methods on client to look up player data in Region US Create additional Client to access data from different regions at the same time 1 2 2 Choosing a Locale It is important to note that Item and player information is provided very differently for each locale A locale is a language as spoken in a specific country The information is different even in the case of the same language spoken in two different countries Battle net only supports specific locales for each _region_ The list of locales by region is e Region CHINA zh_CN China s Chinese e Region EUROPE en_GB Great Britain s English es_ES Spain s Spanish fr_FR France s French ru_RU Russia s Russian de_DE Germany s German pt_PT Portugal s Portuguese it_IT Italy s Italian 1 2 Creating a Client 5 Kadala Documentation Release 0 1 0 e Region KOREA ko_KR South Korean s Korean e Region TAIWAN zh_TW Taiwan s Chinese e Region US en_US United State s English es_MX Mexico s Spanish pt_BR Brazil s Portugese If you do not specify a
7. monsters gt int elites gt int hardcoreMonsters 1 kills highestHardcoreLevel timePlayed gt string class id gt float another string class id timePlayed progression gt string act id gt bool another string act id progression gt int gt int gt int gt float pair gt bool pair 1 7 Get Hero You can retrieve detailed information about a player hero including the skills and gear loadout for themselves and their followers For general player account information like their artisan progress call Get Career instead 1 7 1 Methods Available methods on Client to get _item_ data are e getHero lt battleTag gt lt herold gt 1 7 2 Code Example Notice how since wudijo 2228 plays in europe we had to specify Region EUROPE to our Client use Kadala Client use Kadala Region create a new Client my bnet api key SapiKey 1 7 Get Hero 19 Kadala Documentation Release 0 1 0 Sclient new Client Sapikey Region EUROPE retrieve the item data SbattleTag wudijo 2228 Sherold 35436981 data S client gt getHero SbattleTag Sherold Sdata now contains the hero data structure 1 7 3 Data Structures For your reference only not authorative In the event that Blizzard changes the data structures returned by the API Kadala will still work 100 T
8. new Client Sapikey my bnet api key Sclient new Client Sapikey Region EUROPE retrieve the item data SbattleTag wudijo 2228 Sherold 35436981 data S client gt getHero SbattleTag S herold headers gt If Modified Since gt Tue 07 Apr 2015 16 30 58 GMT l 1 Sdata now contains the hero data structure if it has changed or false If you get back false then the data has not changed and you don t need to re save it You can get the LastModified in the api key of returned data Some items won t have it so use the retrieved in the api key instead 1 9 3 Guzzle If you would like to specify custom options to guzzle the library that retrives your request from the api you may do so in the options array to any request method use Kadala Client use Kadala Region create a new Client SapiKey my bnet api key Sclient new Client Sapikey Region EUROPE retrieve the item data SbattleTag wudijo 2228 Sherold 35436981 data client gt getHero battleTag S herold headers gt User Agent gt My Website l l1 data now contains the hero data structure 1 10 Frequently Asked Questions 1 10 1 Questions 28 Chapter 1 User manual Kadala Documentation Release 0 1 0 Contents e Frequently Asked Questions Questions How do I turn off compression How do I change the region or l
9. users who want to keep the same Client object but retrieve data in multiple regions or locales Changing the Client You can permanently change the region and locale on the Client Methods Here are the methods to do this e setRegion lt region gt e setRegion lt region gt lt locale gt Examples use Kadala Client use Kadala Region create a Client SapiKey my bnet api key Sclient new Client Sapikey Region US change the region permanently to Europe Sclient gt setRegion Region EUROPE locale will default to en_CB use Kadala Client use Kadala Region create a Client Sapikey my bnet api key Sclient new Client Sapikey Region US 26 Chapter 1 User manual Kadala Documentation Release 0 1 0 change the region permanently to Europe and locale to fr_FR Sclient gt setRegion Region EUROPE fr_FR Changing the request You can also use a different region or locale only for the specific request you are issuing This will not change the region or locale of the Client object itself Methods Each get X method on the Client has an optional parameter for options which can contain region and locale So for example getBlacksmith is optionally getBlacksmith lt options gt For methods already with parameters just append the options on the end like getHero lt battleTag gt lt herold gt l
10. Kadala Documentation Release 0 1 0 Finlay Beaton May 15 2015 Contents 1 User manual 3 Mill OVER doo aida eee a AO eh ee A 3 1 2 Creating a Client 4 55 cae eee sE Rs E OR A E A AR 5 E3 IGECAMISIM Eee A AAA A A eed amp whos 6 WA Get Follower sios eo a Bae e R Re SRDS BA E SG 6s 10 US Gette crei ww eb bea eee bee ee aw eee heehee Pea ae 13 LO Get Career minea e ei op a A Be ey Be Reale Peele Gidget a te dae Ow a 16 Te Geter o a Ge ae oe eo A ee at OG Se he tee Se ad E Y 19 1 8 Setup Caching once Ae ahs God be a a a RE Ess 24 LO Advanced Opuons o 2 5 4 dns we RGA SHEE VRRP ad Ee eR EE t 26 1 10 Frequently Asked Questions mies iai 52354 2 0 254255 2 82084 eee ee hie eed 28 LUD Examples see ke RR E AG ee oe HAS ORS ER E ee ae 30 12 Gontbutims ess whi Sc hy oe vee A eae ee REESE yh hae Aes 30 Kadala Documentation Release 0 1 0 Greetings Nephalem Kadala is a PHP 5 4 library that allows you to easily communicate with the Battle net Diablo 3 Web API This library provides a simple PHP class based interface with methods representing API data and makes use of features such as compression and caching to optimize your requests Contents 1 Kadala Documentation Release 0 1 0 2 Contents CHAPTER 1 User manual 1 1 Overview 1 1 1 Requirements PHP The Kadala library is tested on the following versions of PHP e PHP 5 4 e PHP 5 5 e PHP 5 6 e PHP 7 0 e HHVM
11. Kadala Region create a new Client Sapikey my bnet api key Sclient new Client Sapikey Region US retrieve the templar data data client gt getTemplar Sdata now contains the templar data structure All You could use the getFollower method to retrieve them all in quick succession use Kadala Client use Kadala Region use Kadala Follower create a new Client Sapikey my bnet api key Sclient new Client Sapikey Region US loop through each available follower foreach Follower Sfollowers as Sfollower data client gt getFollower follower Sdata now contains the follower data structure do some processing on the data 1 4 Get Follower 11 Kadala Documentation Release 0 1 0 1 4 3 Data Structures For your reference only not authorative In the event that Blizzard changes the data structures returned by the API Kadala will still work 100 The library does not do any post processing and returns the data to you using json_decode only You will likely have to change your processing code however We have listed the Data Structures as we saw them returned by the API lt https dev battle net io docs gt _ in May 2015 for your convenience only The data you get back is organized in very specific ways using associative arrays Localized strings are marked with lc Array items that may repeat are marked with
12. at healing gt float attackSpeed gt float armor gt int strength gt int dexterity gt int vitality gt int intelligence gt int physicalResist gt int fireResist gt int coldResist gt int lightningResist gt int poisonResist gt int arcaneResist gt int critDamage gt float blockChance gt float blockAmountMin gt int blockAmountMax gt int damageIncrease gt float critChance gt float damageReduction gt float thorns gt float lifeSteal gt float lifePerKill gt float goldFind gt float magicFind gt float lifeOnHit gt float primaryResource gt int secondaryResource gt int 1 stats kills gt elites Le A Bits progression gt string act gt ActProgressData another string act progression int dead gt bool last updated gt int api gt region gt string locale gt string retrieved gt string lastModified gt string api gt ActProgressData pair HeroActiveSkillData The description and simpleDescription are displayed to the user depending on the simple descriptions in game option 1 7 Get Hero 21 Kadala Documentation Release 0 1 0 skill gt slug gt string name gt string lc icon gt string level gt int categorySlug gt string toolt
13. do some processing on the data 1 3 3 Data Structures For your reference only not authorative In the event that Blizzard changes the data structures returned by the API Kadala will still work 100 The library does not do any post processing and returns the data to you using json_decode only You will likely have to change your processing code however We have listed the Data Structures as we saw them returned by the API lt https dev battle net io docs gt _ in May 2015 for your convenience only The data you get back is organized in very specific ways using associative arrays Localized strings are marked with 1c Array items that may repeat are marked with Complex array items are sometimes split into their own Data Structure which may also repeat where marked Kadala inserts the api key into the results with important request and response parameters ArtisanData slug gt string name gt string lc portrait gt string training gt tiers gt tier gt int levels gt tierLevel gt int percent gt int trainedRecipes gt RecipeData another RecipeData trainedRecipes upgradeCost gt int in gold upgradeltems gt 1 level 8 Chapter 1 User manual Kadala Documentation Release 0 1 0 another level levels tier another tier tiers 1 training api gt
14. em gt HeroItemData omitted on transmogItem HeroItemData craftedBy gt RecipeData another RecipeData l HeroFollowerData slug gt string level gt int items gt string slot gt HeroItemData another string slot gt HeroItemData pair items stats gt goldFind gt int magicFind gt int experienceBonus gt int stats skills gt FollowerActiveSkillData another FollowerActiveSkillData Z7 skilts FollowerActiveSkillData The description and simpleDescription are displayed to the user depending on the simple descriptions in game option slug gt string name gt string Ic icon gt string level gt int tooltipUrl gt string description gt string lc simpleDescription gt string lc skillCalcId gt string ActProgressData completed gt bool completedQuests gt QuestData another QuestData 1 completedQuests 1 7 Get Hero 23 Kadala Documentation Release 0 1 0 QuestData slug gt string name gt string lc RecipeData id gt string slug gt string name gt string lc cost gt int in gold reagents gt quantity gt int item gt ReagentItemData reagent another reagent reagents itemProduced gt ProducedIt
15. emData ReagentltemData id gt string name gt string lc icon gt string displayColor gt string tooltipParams gt string ProducedltemData Unlike in artisan data recipe and craftedBy are never listed on this structure id gt string name gt string Ic icon gt string displayColor gt string tooltipParams gt string 1 8 Set up Caching One way to speed up your requests to the API is to cache the responses That way when you ask for the resource again and it has not changed the library will return the cached copy You can use top of the line caching software like memcached or redis as well as get started quickly simpler caches including Filesystem and SQLite 24 Chapter 1 User manual Kadala Documentation Release 0 1 0 All cashing is done through the caching library called Stash 1 8 1 Filesystem cache Setting the location of the Filesystem cache is optional Notice the additional use statements use Stash Driver Filesystem use Stash Pool use Kadala Client use Kadala Region create a new Client Sapikey my bnet api key Sclient new Client Sapikey Region US create the driver for our cache Sdriver new FileSystem optionally set a custom location for the cache Sdriver gt setOptions path gt tmp myCache 1 create and set the cache Scache new Pool
16. ethods Available methods on Client to get item data are e getItem lt itemId gt 1 5 2 Code Example Set itemId to the id attribute of an item to retrieve it use Kadala Client use Kadala Region create a new Client SapiKey my bnet api key Sclient new Client Sapikey Region US retrieve the item data SitemId P1_CruShield_norm_unique_02 data Sclient gt getItem SitemId Sdata now contains the item data structure 1 5 3 Data Structures For your reference only not authorative In the event that Blizzard changes the data structures returned by the API Kadala will still work 100 The library does not do any post processing and returns the data to you using json_decode only You will likely have to change your processing code however We have listed the Data Structures as we saw them returned by the API lt https dev battle net io docs gt _ in May 2015 for your convenience only The data you get back is organized in very specific ways using associative arrays Localized strings are marked with lc Array items that may repeat are marked with Complex array items are sometimes split into their own Data Structure which may also repeat where marked Kadala inserts the api key into the results with important request and response parameters 1 5 Get Item 13 Kadala Documentation Release 0 1 0 ltemData Depending on the type of item reques
17. he library does not do any post processing and returns the data to you using json_decode only You will likely have to change your processing code however We have listed the Data Structures as we saw them returned by the API lt https dev battle net io docs gt _ in May 2015 for your convenience only The data you get back is organized in very specific ways using associative arrays Localized strings are marked with 1c Array items that may repeat are marked with Complex array items are sometimes split into their own Data Structure which may also repeat where marked Kadala inserts the api key into the results with important request and response parameters HeroData id gt int herold name gt string class gt string gender gt int level gt int paragonLevel gt int hardcore gt bool seasonal gt bool seasonCreated gt int skills gt active gt HeroActiveSkillData another HeroActiveSkillData active passive gt HeroPassiveSkillData A another HeroPassiveSkillData ly ZZ skills items gt string slot gt HeroltemData another string slot gt HeroltemData 1 items followers gt HeroFollowerData another HeroFollowerData 20 Chapter 1 User manual Kadala Documentation Release 0 1 0 r stats gt life gt int damage gt float toughness gt flo
18. hen the tiers item in the ArtisanData structure will always be empty 1 3 2 Code Examples Blacksmith use Kadala Client use Kadala Region create a new Client SapiKey my bnet api key Sclient new Client Sapikey Region US retrieve the blacksmith data data client gt getBacksmith Sdata now contains the artisan data structure Jeweler use Kadala Client use Kadala Region create a new Client Sapikey my bnet api key Sclient new Client Sapikey Region US retrieve the jeweler data data client gt getJeweler Sdata now contains the artisan data structure Mystic use Kadala Client use Kadala Region create a new Client Sapikey my bnet api key Sclient new Client Sapikey Region US retrieve the mystic data data client gt getMystic Sdata now contains the artisan data structure All You could use the getArtisan method to retrieve them all in quick succession 1 3 Get Artisan 7 Kadala Documentation Release 0 1 0 use Kadala Client use Kadala Region use Kadala Artisan create a new Client Sapikey my bnet api key Sclient new Client Sapikey Region US loop through each available artisan foreach Artisan Sartisans as Sartisan data Sclient gt getArtisan Sartisan Sdata now contains the artisan data structure
19. horative In the event that Blizzard changes the data structures returned by the API Kadala will still work 100 The library does not do any post processing and returns the data to you using json_decode only You will likely have to change your processing code however We have listed the Data Structures as we saw them returned by the API lt https dev battle net io docs gt _ in May 2015 for your convenience only The data you get back is organized in very specific ways using associative arrays Localized strings are marked with lc Array items that may repeat are marked with Complex array items are sometimes split into their own Data Structure which may also repeat where marked Kadala inserts the api key into the results with important request and response parameters CareerData The battleTag returned will not always be the same as the one requested There are many situations where a player battleTag changes however requesting their old battleTag retrieves their new profile with the new battleTag listed instead battleTag gt string paragonLevel gt int paragonLevelHardcore gt int paragonLevelSeason gt int paragonLevelSeasonHardcore gt int heroes gt 1 6 Get Career 17 Kadala Documentation Release 0 1 0 HeroCareerData another HeroCareerData heroes lastHeroPlayed gt int lastUpdated gt int kills gt mon
20. ipUrl gt string description gt string lc simpleDescription gt string lc skillCalcId gt string lee ALLER rune gt slug gt string type gt string name gt string lc level gt int description gt string lc simpleDescription gt string lc tooltipParams gt string skillCalcId gt string order gt int rune HeroPassiveSkillData Skill gt slug gt string name gt string Ic icon gt string level gt int tooltipUrl gt string description gt string lc flavor gt string lc skillCalcId gt string 7 skill HeroltemData Depending on the type of item requested some fields may not be present For example recipe is only returned when the item can be crafted When the transmogItem property refers to anew HeroltemData transmogItem property is omitted on the item it points to This is a special tooltipParams field that contains a string you can use to lookup the particular item attributes sockets gems etc It is different than the general tooltipParam you usually get including the one from get Item id gt string name gt string lc icon gt string displayColor gt string tooltipParams gt string recipe gt RecipeData 22 Chapter 1 User manual Kadala Documentation Release 0 1 0 transmoglt
21. loader in your code yourphpfile php at the very top before everything EL xcept namespaces and use statements require vendor autoload php 1 1 3 Quickstart Item retrieval To obtain the P1_CruShield_norm_unique_02 item type from the US battle net use Kadala Client use Kadala Region create a new Client SapiKey my bnet api key Sclient new Client Sapikey Region US retrieve the item data SitemId P1_CruShield_norm_unique_02 data Sclient gt getItem SitemId Sdata now contains the item type information Player Career retrieval List of characters and career information for the european player battle tag wudijo 2228 use Kadala Client use Kadala Region create a new client SapiKey my bnet api key region must match where the player plays Sclient new Client Sapikey Region EUROPE retrieve the career data SbattleTag wudijo 2228 4 Chapter 1 User manual Kadala Documentation Release 0 1 0 data client gt getCareer S battleTag Sdata now contains the career information 1 2 Creating a Client 1 2 1 Selecting a Region Player Career and Hero data is specific to a region so it is important to connect to the right one Here is the list of all valid regions for Diablo 3 e Region CHINA I e Region EUROP e Region KOREA Region TAIWAN e
22. locale when creating your Client as above then the first one in this list for the region will be chosen as a default Here is an example of creating a Client specifying the Europe region and France French locale use Kadala Client use Kadala Region create a Client SapiKey my bnet api key Sclient new Client apiKey Region EUROPE fr_FR 1 3 Get Artisan You can retrieve general information about an artisan what recipes could be learned and trained This is a good way to obtain the names and descriptions for a specific locale To learn what level a player s artisan is see Get Career instead There is currently no way to know what recipes that drop rare set and legendary the player has learned on their artisans 1 3 1 Methods Available methods on Client to get artisan data are e getBlacksmith e getJeweler e getMystic e getArtisan lt artisan gt There are also constants on the Artisan object to provide to getArtisan BLACKSMITH e JEWELER e MYSTIC e Sartisans array list of all of the above 6 Chapter 1 User manual Kadala Documentation Release 0 1 0 Special Case The mystic as of May 2015 does not have any trainable recipes You cannot guarantee this will always be the case and if want to make your code robust it is recommend you handle the future addition of recipes like any other artisan Certainly the API treats her as such Until t
23. ocale I have a database can I tell Kadala the lastModified How do I report an issue How do I support you How do I get involved 1 10 2 How do turn off compression By default all communication from Battle net to the library is compressed Data is always returned to you fromt he library in an uncompressed state In vary rare circumstances it can be useful to turn off compressing responses If you choose to do this you may see significant slowdowns of especially larger responses The setSendCompressed method allows you to turn off compression use Kadala Client use Kalada Region create a new Client SapiKey my bnet api key Sclient new Client Sapikey Region US turn off compression Sclient gt setSendCompressed false all method calls including getItem will communicate with bnet uncompressed SitemId P1_CruShield_norm_unique_02 data S client gt getItem SitemId Sdata now contains the item type information 1 10 3 How do change the region or locale The easiest way is to create a new Client object for each region or locale you want For more complex uses see Advanced Options section 1 10 4 I have a database can tell Kadala the LastModified While it s recommended you use our Set up Caching feature for temporarily storing requests a database is a good use case for a user cache See the Advanced Options section on user caches 1 10 5 How do rep
24. ort an issue Bug reports and feature requests can be submitted using the Github Issue Tracker 1 10 Frequently Asked Questions 29 Kadala Documentation Release 0 1 0 1 10 6 How do support you Hi I m Finlay Beaton ofbeaton This software is only made possible by donations of fellow users like you en couraging me to toil the midnight hours away and sweat into the code and documentation Everyone s time should be valuable please seriously consider donating Website Paypal Donate Button Paypal Email Money Form 1 10 7 How do I get involved Pm glad you asked People interested in getting involved in the development of the library should head to the Con tributing section of the manual 1 11 Examples The examples directory of the library contains stand alone programs you can run and inspect to learn how to use the library They are useful if you re looking for complete A Z examples 1 11 1 Basic Client Inexamples basic client is client php This program will retrieve all API endpoints and write each toa json file Run it using the command php client php my bnet api key 1 12 Contributing We re glad you are considering contributing to this project It takes a lot of work to keep the library up to date and any help is appreciated 1 12 1 Where to start e Report a bug or feature improvement in our issue tracker e Submit an improvement to the documentation e Pick an issue and send us a pull reque
25. raining gt tiers gt empty for now training 1 4 Get Follower You can retrieve general information about a follower including a list of their possible skills This is a good way to obtain the names and descriptions for a specific locale To learn what specific follower skills and equipment a player uses see Get Hero instead 1 4 1 Methods Available methods on Client to get follower data are e getEnchantress e getScoundrel e getTemplar e getFollower lt follower gt There are also constants on the Follower object to provide to get Follower al NCHANTRESS e SCOUNDREL e TEMPLAR e followers array list of all of the above 1 4 2 Code Examples Enchantress use Kadala Client use Kadala Region create a new Client SapiKey my bnet api key 10 Chapter 1 User manual Kadala Documentation Release 0 1 0 Sclient new Client Sapikey Region US retrieve the enchantress data data client gt getEnchantress Sdata now contains the follower data structure Scoundrel use Kadala Client use Kadala Region create a new Client SapiKey my bnet api key Sclient new Client Sapikey Region US retrieve the scoundrel data data client gt getScoundrel Sdata now contains the follower data structure Templar use Kadala Client use
26. st with code to fix it If you decide to contribute code please ensure that you add the appropriate unit tests that covers your change The project must also build properly 1 12 2 Building the project php composer phar install bin phing dist bin phing all 30 Chapter 1 User manual Kadala Documentation Release 0 1 0 If you are fixing an issue you MUST submit an accompanying unit test that fails in the current version but passes with your fix Code quality is important and things that must run without errors phpfcb must successfully beautify your code phpcs must report Zero Code Style errors or warnings See build browser index html phpunit unit tests must run with Zero errors humbug mutation testing must pass with Zero errors build coverage index html must report 100 code coverage apigen and apigen dev must successfully generate documentation Good luck in your adventures Nephalem 1 12 Contributing 31
27. sters gt int elites gt int hardcoreMonsters gt int ly AA katis highestHardcoreLevel gt int timePlayed gt string class id gt float another string class id 1 timePlayed progression gt string act id gt bool another string act id progression fallenHeroes gt HeroCareerData another HeroCareerData 1 fallenHeroes string artisan id Season Hardcore another string artisan id Season Hardcore seasonalProfiles gt string season name gt SeasonalProfileData another string season name seasonalProfiles api gt region gt string locale gt string retrieved gt string lastModified gt string 1 api gt float pair gt bool pair gt ArtisanCareerData gt SeasonalProfileData palr gt ArtisanCareerData pair HeroCareerData paragonLevel gt int seasonal gt bool name gt string id gt int level gt int hardcore gt bool last updated gt int gender gt int dead gt bool class gt string 18 Chapter 1 User manual Kadala Documentation Release 0 1 0 ArtisanCareerData slug gt string level gt string stepCurrent gt int stepMax gt int SeasonalProfileData seasonld gt int paragonLevel gt int paragonLevelHardcore kills gt
28. t options gt Example use Kadala Client use Kadala Region create a Client SapiKey my bnet api key Sclient new Client Sapikey Region US because of the extra options this request will temporarily return data in fr_FR from EUROPE data S client gt getBlacksmith region gt Region EUROPE locale gt fr_FR i this regequest does not provide the overrides so data will return as normal from US defaulted to en_US data client gt getBlackSmith Warning If this all seems a bit confusing that is because it is Changing the region and locale on the fly can make your code very confusing especially if you change it per request It can become very hard to know what region and locale you are really requesting data from and how it will be returned to you leading to problems in your application Nevertheless this is a powerful feature that when used properly can simplify your application 1 9 2 User Cache Many applications have a data layer on top of a cache For setting a cache within Kadala see the Set up Caching section You may have a database where you store the results from the API In this case you will want to tell Kadala the lastModified for any item you stored on your end 1 9 Advanced Options 27 Kadala Documentation Release 0 1 0 Simply pass it in like you would to Guzzle use Kadala Client use Kadala Region create a
29. ted some fields may not be present For example recipe is only returned when the item can be crafted Additionally some fields only hold data when this structure appears in get Hero id gt string name gt string lc icon gt string displayColor gt string tooltipParams gt string requiredLevel gt int itemLevel gt int bonusAffixes gt int bonusAffixesMax gt int accountBound gt bool flavorText gt string lc typeName gt string lc type gt twoHanded gt bool id gt string type dps gt MinMaxData attacksPerSecond gt MinMaxData minDamage gt MinMaxData maxDamage gt MinMaxData armor gt MinMaxData slots gt string another string slot name ly 77 slots attributes gt AttributeListData attributesRaw gt AttributesRawListData randomAffixes gt oneOf gt attributes gt AttributeListData attributesRaw gt AttributesRawListData oneof 1 randomAffixes gems gt in getHero socketEffects gt SocketEffectData another SocketEffectData 1 socketEffects recipe gt RecipeData craftedBy gt RecipeData another RecipeData craftedBy seasonRequiredToDrop gt int isSeasonREquiredtoDrop gt bool blockChance gt MinMaxData api gt region gt string locale gt string re
30. trieved gt string lastModified gt string 1 api 14 Chapter 1 User manual Kadala Documentation Release 0 1 0 AttributeListData primary gt AttributeData another AttributeData primary secondary gt AttributeData another AttributeData secondary passive gt AttributeData another AttributeData passive AttributeData text gt string le color gt string affixType gt string AttributesRawListData string gt MinMaxData another string gt MinMaxData pair SocketEffectData attributes gt AttributeListData itemTypeName gt string lc itemTypeld gt string attributesRaw gt AttributesRawListData RecipeData id gt string slug gt string name gt string lc cost gt int in gold reagents gt 1 5 Get Item 15 Kadala Documentation Release 0 1 0 quantity gt int item gt ReagentItemData reagent another reagent reagents itemProduced gt ProducedItemData ReagentltemData id gt string name gt string lc icon gt string displayColor gt string tooltipParams gt string ProduceditemData Unlike in artisan data recipe and craftedBy are never listed on this structure id

Download Pdf Manuals

image

Related Search

Related Contents

LG AX310 Black Quick Start Guide  LCD Touch BacPac™  programmable stoneware slow cooker  GRANPOWER5000 モデル 680/780 取扱説明書の記述への  

Copyright © All rights reserved.
Failed to retrieve file