ArgentPonyWarcraftClient 3.0.1

Argent Pony Warcraft Client

The Argent Pony .NET client for the Blizzard World of Warcraft Community Web APIs

Install-Package ArgentPonyWarcraftClient -Version 3.0.1
dotnet add package ArgentPonyWarcraftClient --version 3.0.1
<PackageReference Include="ArgentPonyWarcraftClient" Version="3.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ArgentPonyWarcraftClient --version 3.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Argent Pony Warcraft Client

The Argent Pony Warcraft Client is a .NET client for the Blizzard World of Warcraft Community APIs. It lets .NET applications easily access information about World of Warcraft characters, guilds, items, spells, and more. It is a .NET Standard 1.1 library, which means it supports a broad range of platforms, including .NET Core 1.0+ and .NET Framework 4.5+.

NuGet version
Build status

Prerequisites

All users of the Blizzard World of Warcraft Community Web APIs must have a Battle.net account and a client ID. Follow Blizzard's Getting Started instructions.

Installing via NuGet

You can install the ArgentPonyWarcraftClient package from the NuGet Package Manager in Visual Studio or by running the following command from the Package Manager Console:

Install-Package ArgentPonyWarcraftClient

Using the Argent Pony Warcraft Client

Assuming you're working in C#, add the appropriate using statement to reference the library:

using ArgentPonyWarcraftClient;

Instantiate a WarcraftClient with the the client ID and client secret that you registered for in the Prerequisites step. For simplicity, these values are stored in the source code in the example below. You should instead use the configuration API for your .NET platform to store the key securely. For example, ASP.NET Core developers should read Configuration in ASP.NET Core.

string clientId = "MY-CLIENT-ID-GOES-HERE";
string clientSecret = "MY-CLIENT-SECRET-GOES-HERE";
var warcraftClient = new WarcraftClient(clientId, clientSecret);

You can optionally specify the region and locale to use when calling the WarcraftClient constructor. If you omit these parameters, it will default to Region.US and &quot;Locale.en_US&quot;. Each method on WarcraftClient also has an overload that allows you to override these default values for the current call.

var warcraftClient = new WarcraftClient(clientId, clientSecret, Region.US, "Locale.en_US");

Once you have your WarcraftClient instance, you can start asking for data. All methods are asynchronous. Here's an example for retrieving a character:

RequestResult<Character> result = await warcraftClient.GetCharacterAsync("Norgannon", "Drinian", CharacterFields.All);

This will retrieve a character named Drinian from the realm Norgannon. The CharacterFields enumeration allows you to specify which portions of character-related data the Blizzard API should return. If you only want to retrieve information about the character's talents and mounts, for instance, you can ask for only those portions of the Character object to be populated.

CharacterFields fields = CharacterFields.Talents | CharacterFields.Mounts;
RequestResult<Character> result = await warcraftClient.GetCharacterAsync("Norgannon", "Drinian", fields);

Each request is wrapped in the RequestResult&lt;T&gt; class. Which has the following properties.

  • Value (The generic type argument)
  • Error (RequestError class)
    • Code (The HTTP status code)
    • Type (The HTTP status code description)
    • Detail (The details of why the request failed)
  • Success (bool)

A proper method call could look like this.

RequestResult<Character> result = await warcraftClient.GetCharacterAsync("Norgannon", "Drinian", CharacterFields.All);

if (result.Success)
{
    Console.WriteLine("Character Name: " + result.Value.Name);
    Console.WriteLine("Character Level: " + result.Value.Level);
}
else
{
    Console.WriteLine("HTTP Status Code: " + result.Error.Code);
    Console.WriteLine("HTTP Status Description: " + result.Error.Type);
    Console.WriteLine("Details: " + result.Error.Detail);
}

Take a look at the WarcraftClientTests class and the Blizzard World of Warcraft Community APIs documentation to learn more about what else you can do.

Argent Pony Warcraft Client

The Argent Pony Warcraft Client is a .NET client for the Blizzard World of Warcraft Community APIs. It lets .NET applications easily access information about World of Warcraft characters, guilds, items, spells, and more. It is a .NET Standard 1.1 library, which means it supports a broad range of platforms, including .NET Core 1.0+ and .NET Framework 4.5+.

NuGet version
Build status

Prerequisites

All users of the Blizzard World of Warcraft Community Web APIs must have a Battle.net account and a client ID. Follow Blizzard's Getting Started instructions.

Installing via NuGet

You can install the ArgentPonyWarcraftClient package from the NuGet Package Manager in Visual Studio or by running the following command from the Package Manager Console:

Install-Package ArgentPonyWarcraftClient

Using the Argent Pony Warcraft Client

Assuming you're working in C#, add the appropriate using statement to reference the library:

using ArgentPonyWarcraftClient;

Instantiate a WarcraftClient with the the client ID and client secret that you registered for in the Prerequisites step. For simplicity, these values are stored in the source code in the example below. You should instead use the configuration API for your .NET platform to store the key securely. For example, ASP.NET Core developers should read Configuration in ASP.NET Core.

string clientId = "MY-CLIENT-ID-GOES-HERE";
string clientSecret = "MY-CLIENT-SECRET-GOES-HERE";
var warcraftClient = new WarcraftClient(clientId, clientSecret);

You can optionally specify the region and locale to use when calling the WarcraftClient constructor. If you omit these parameters, it will default to Region.US and &quot;Locale.en_US&quot;. Each method on WarcraftClient also has an overload that allows you to override these default values for the current call.

var warcraftClient = new WarcraftClient(clientId, clientSecret, Region.US, "Locale.en_US");

Once you have your WarcraftClient instance, you can start asking for data. All methods are asynchronous. Here's an example for retrieving a character:

RequestResult<Character> result = await warcraftClient.GetCharacterAsync("Norgannon", "Drinian", CharacterFields.All);

This will retrieve a character named Drinian from the realm Norgannon. The CharacterFields enumeration allows you to specify which portions of character-related data the Blizzard API should return. If you only want to retrieve information about the character's talents and mounts, for instance, you can ask for only those portions of the Character object to be populated.

CharacterFields fields = CharacterFields.Talents | CharacterFields.Mounts;
RequestResult<Character> result = await warcraftClient.GetCharacterAsync("Norgannon", "Drinian", fields);

Each request is wrapped in the RequestResult&lt;T&gt; class. Which has the following properties.

  • Value (The generic type argument)
  • Error (RequestError class)
    • Code (The HTTP status code)
    • Type (The HTTP status code description)
    • Detail (The details of why the request failed)
  • Success (bool)

A proper method call could look like this.

RequestResult<Character> result = await warcraftClient.GetCharacterAsync("Norgannon", "Drinian", CharacterFields.All);

if (result.Success)
{
    Console.WriteLine("Character Name: " + result.Value.Name);
    Console.WriteLine("Character Level: " + result.Value.Level);
}
else
{
    Console.WriteLine("HTTP Status Code: " + result.Error.Code);
    Console.WriteLine("HTTP Status Description: " + result.Error.Type);
    Console.WriteLine("Details: " + result.Error.Detail);
}

Take a look at the WarcraftClientTests class and the Blizzard World of Warcraft Community APIs documentation to learn more about what else you can do.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
3.0.1 132 2/6/2019
3.0.0 171 1/15/2019
2.1.0 177 8/26/2018
2.0.0 219 7/18/2018
1.0.1 240 3/26/2018
1.0.0 236 2/21/2018
0.9.2 222 12/14/2017
0.9.1 282 12/7/2017
0.9.0 337 9/24/2017