Get the Desktop App for Battle.net Now
- All your games in 1 place
- Log in once
- Automatic game updates
I am pleased to announce that the first release of D3API.Net is finally here.
D3API.Net allows .Net developers to access Diablo 3's Web API in a completely familiar and comfortable way. No web requests. No parsing. No serializing. Simply use the object that is returned how you please.
D3API.Net has a testing version of the API along with a testing tool which allows you to access existing examples and use them as if they were really sent from the API! The testing tool allows you to input any Json string(pre-loaded with examples), then it spits out a treeview, in which you are able to visually navigate through the object. From here you have the ability to locate specific variables and their identifiers!
If you are interested in the least bit about the D3API.Net project, or simply wish to use it in your project, I urge you to head on over and have a look at it:
I've just released a new version which fixes the URI exception. Basically it was a miss-formatted URI, due to it being changed in the release API ("account" is now "profile").
This project is under the GPLv2 License
Edited by Promedeus#1393 on 8/15/2012 7:57 PM PDT
Thank you, I may end up using this.....I was using a completely different approach (assuming a JSON file would be in place) as I have 0 experience with tapping web APIs (so short of google results, I had no clue what I was doing).
In terms of my use for it, I was going to make a simple DPS/EHP calculator for my friends and I to use (mostly out of boredom, not necessity) with an item compare feature (manually plug in values for a slot and it shows differences in DPS/EHP).
I did notice that your dll in the test application you showed was MUCH larger than the separate DLL you have available, is this strictly because of the test data you use (practically everything we have been given up to this point along with extra functions to extract that data without using a URL), or is there some other stuff included?
If I were to use this API in my program, all I would need to do is include it and reference the methods I need to use and it would automatically store them in the right classes (so I could define d3Hero as getHeroProfile(bTag, heroID), then call d3Hero.name to fetch the passed bTag and heroID's name without any other code?
If so, that makes it much easier to use than the method I was using, which was basically writing my own C# wrapper for the D3 API (which I have NEVER done before).
EDIT: After a quick test, maybe I'm using it wrong or something, but when I try to run:
It fails when running getCareerProfile with "Invalid URI: The format of the URI could not be determined.", I don't know anything about loading web APIs, but looking at the code is webRes supposed to be a HttpWebRequest?
Edited by Nagisan#1870 on 8/8/2012 12:42 PM PDT
I have just released a new version of D3API.Net. This version works as intended. Your usage in the code block is correct. Although, with the last version, the format was wrong due to Blizzard changing the request format (they changed "account" to "profile" in the request URI). This was why you were getting a URI exception.
In response to everyone wanting a WindowsPhone version; it could be in the near future. This would involve some nasty Async code, but I could put some time into it.
The reactive extensions are a nice way to tame the async, I've been doing some Silverlight and the default code for SL from svcUtil isn't too friendly.
With reactive, I've got it down to a fairly simple pattern something like this:
The "helper method" signature
IObservable<TResponseMessageType> observable = ReactiveFuncFactory.Current.ServiceMethodName(TRequestMessageType req);
An a service action
var req = new GetUserByIdRequest
ProcessUser(response.User);//Do what you need to with the data
MakeUIReady(); //depending on the error
Threats of violence. We take these seriously and will alert the proper authorities.
Posts containing personal information about other players. This includes physical addresses, e-mail addresses, phone numbers, and inappropriate photos and/or videos.
Harassing or discriminatory language. This will not be tolerated.