Skip to content

dofusdude/dofusdude-csharp

Repository files navigation

Dofusdude.Api - the C# library for the dofusdude

A project for you - the developer.

The all-in-one toolbelt for your next Ankama related project.

Client SDKs

  • Javascript npm i dofusdude-js - -save
  • Typescript npm i dofusdude-ts - -save
  • Go go get -u github.com/dofusdude/dodugo
  • Python pip install dofusdude
  • PHP
  • Java Maven with GitHub packages setup

Everything, including this site, is generated out of the Docs Repo. Consider it the Single Source of Truth. If there is a problem with the SDKs, create an issue there.

Your favorite language is missing? Please let me know!

Main Features

  • 🥷 Seamless Auto-Update load data in the background when a new Dofus version is released and serving it within 10 minutes with atomic data source switching. No downtime and no effects for the user, just always up-to-date.

  • Blazingly Fast all data in-memory, aggressive caching over short time spans, HTTP/2 multiplexing, written in Go, optimized for low latency, hosted on bare metal in 🇩🇪.

  • 📨 Discord Integration Ankama related RSS and Almanax feeds to post to Discord servers with advanced features like filters or mentions. Use the endpoints as a dev or the official Web Client as a user.

  • 🩸 Dofus 2 Beta from stable to bleeding edge by replacing /dofus2 with /dofus2beta.

  • 🗣️ Multilingual supporting en, fr, es, pt including the dropped languages from the Dofus website de and it.

  • 🧠 Search by Relevance allowing typos in name and description, handled by language specific text analysis and indexing.

  • 🕵️ Complete actual data from the game including items invisible to the encyclopedia like quest items.

  • 🖼️ HD Images rendering game assets to high-res images with up to 800x800 px.

... and much more on the Roadmap on my Discord.

This C# SDK is automatically generated by the OpenAPI Generator project:

  • API version: 0.9.0
  • SDK version: 0.9.0
  • Generator version: 7.6.0-SNAPSHOT
  • Build package: org.openapitools.codegen.languages.CSharpClientCodegen For more information, please visit https://discord.gg/3EtHskZD8h

Frameworks supported

Dependencies

The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:

Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes
Install-Package System.ComponentModel.Annotations

NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742. NOTE: RestSharp for .Net Core creates a new socket for each api call, which can lead to a socket exhaustion problem. See RestSharp#1406.

Installation

Run the following command to generate the DLL

  • [Mac/Linux] /bin/sh build.sh
  • [Windows] build.bat

Then include the DLL (under the bin folder) in the C# project, and use the namespaces:

using Dofusdude.Api.Api;
using Dofusdude.Api.Client;
using Dofusdude.Api.Model;

Packaging

A .nuspec is included with the project. You can follow the Nuget quickstart to create and publish packages.

This .nuspec uses placeholders from the .csproj, so build the .csproj directly:

nuget pack -Build -OutputDirectory out Dofusdude.Api.csproj

Then, publish to a local feed or other host and consume the new package via Nuget as usual.

Usage

To use the API client with a HTTP proxy, setup a System.Net.WebProxy

Configuration c = new Configuration();
System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/");
webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
c.Proxy = webProxy;

Getting Started

using System.Collections.Generic;
using System.Diagnostics;
using Dofusdude.Api.Api;
using Dofusdude.Api.Client;
using Dofusdude.Api.Model;

namespace Example
{
    public class Example
    {
        public static void Main()
        {

            Configuration config = new Configuration();
            config.BasePath = "https://api.dofusdu.de";
            var apiInstance = new AlmanaxApi(config);
            var language = fr;  // string | code
            var date = Tue Jul 14 00:00:00 UTC 2020;  // DateOnly | yyyy-mm-dd

            try
            {
                // Single Almanax Date
                AlmanaxEntry result = apiInstance.GetAlmanaxDate(language, date);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling AlmanaxApi.GetAlmanaxDate: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }

        }
    }
}

Documentation for API Endpoints

All URIs are relative to https://api.dofusdu.de

Class Method HTTP request Description
AlmanaxApi GetAlmanaxDate GET /dofus2/{language}/almanax/{date} Single Almanax Date
AlmanaxApi GetAlmanaxRange GET /dofus2/{language}/almanax Almanax Range
ConsumablesApi GetAllItemsConsumablesList GET /{game}/{language}/items/consumables/all List All Consumables
ConsumablesApi GetItemsConsumablesList GET /{game}/{language}/items/consumables List Consumables
ConsumablesApi GetItemsConsumablesSearch GET /{game}/{language}/items/consumables/search Search Consumables
ConsumablesApi GetItemsConsumablesSingle GET /{game}/{language}/items/consumables/{ankama_id} Single Consumables
CosmeticsApi GetAllCosmeticsList GET /{game}/{language}/items/cosmetics/all List All Cosmetics
CosmeticsApi GetCosmeticsList GET /{game}/{language}/items/cosmetics List Cosmetics
CosmeticsApi GetCosmeticsSearch GET /{game}/{language}/items/cosmetics/search Search Cosmetics
CosmeticsApi GetCosmeticsSingle GET /{game}/{language}/items/cosmetics/{ankama_id} Single Cosmetics
EquipmentApi GetAllItemsEquipmentList GET /{game}/{language}/items/equipment/all List All Equipment
EquipmentApi GetItemsEquipmentList GET /{game}/{language}/items/equipment List Equipment
EquipmentApi GetItemsEquipmentSearch GET /{game}/{language}/items/equipment/search Search Equipment
EquipmentApi GetItemsEquipmentSingle GET /{game}/{language}/items/equipment/{ankama_id} Single Equipment
GameApi GetGameSearch GET /{game}/{language}/search Game Search
GameApi GetItemsAllSearch GET /{game}/{language}/items/search Search All Items
MetaApi GetGameSearchTypes GET /dofus2/meta/search/types Available Game Search Types
MetaApi GetMetaAlmanaxBonuses GET /dofus2/meta/{language}/almanax/bonuses Available Almanax Bonuses
MetaApi GetMetaAlmanaxBonusesSearch GET /dofus2/meta/{language}/almanax/bonuses/search Search Available Almanax Bonuses
MetaApi GetMetaElements GET /dofus2/meta/elements Effects and Condition Elements
MountsApi GetAllMountsList GET /{game}/{language}/mounts/all List All Mounts
MountsApi GetMountsList GET /{game}/{language}/mounts List Mounts
MountsApi GetMountsSearch GET /{game}/{language}/mounts/search Search Mounts
MountsApi GetMountsSingle GET /{game}/{language}/mounts/{ankama_id} Single Mounts
QuestItemsApi GetAllItemsQuestList GET /{game}/{language}/items/quest/all List All Quest Items
QuestItemsApi GetItemQuestSingle GET /{game}/{language}/items/quest/{ankama_id} Single Quest Items
QuestItemsApi GetItemsQuestList GET /{game}/{language}/items/quest List Quest Items
QuestItemsApi GetItemsQuestSearch GET /{game}/{language}/items/quest/search Search Quest Items
ResourcesApi GetAllItemsResourcesList GET /{game}/{language}/items/resources/all List All Resources
ResourcesApi GetItemsResourceSearch GET /{game}/{language}/items/resources/search Search Resources
ResourcesApi GetItemsResourcesList GET /{game}/{language}/items/resources List Resources
ResourcesApi GetItemsResourcesSingle GET /{game}/{language}/items/resources/{ankama_id} Single Resources
SetsApi GetAllSetsList GET /{game}/{language}/sets/all List All Sets
SetsApi GetSetsList GET /{game}/{language}/sets List Sets
SetsApi GetSetsSearch GET /{game}/{language}/sets/search Search Sets
SetsApi GetSetsSingle GET /{game}/{language}/sets/{ankama_id} Single Sets
WebhooksApi DeleteWebhooksAlmanaxId DELETE /webhooks/almanax/{id} Unregister Almanax Hook
WebhooksApi DeleteWebhooksRssId DELETE /webhooks/rss/{id} Unregister RSS Hook
WebhooksApi DeleteWebhooksTwitterId DELETE /webhooks/twitter/{id} Unregister Twitter Hook
WebhooksApi GetMetaWebhooksAlmanax GET /meta/webhooks/almanax Get Almanax Hook Metainfo
WebhooksApi GetMetaWebhooksRss GET /meta/webhooks/rss Get RSS Hook Metainfo
WebhooksApi GetMetaWebhooksTwitter GET /meta/webhooks/twitter Get Twitter Hook Metainfo
WebhooksApi GetWebhooksAlmanaxId GET /webhooks/almanax/{id} Get Almanax Hook
WebhooksApi GetWebhooksRssId GET /webhooks/rss/{id} Get RSS Hook
WebhooksApi GetWebhooksTwitterId GET /webhooks/twitter/{id} Get Twitter Hook
WebhooksApi PostWebhooksAlmanax POST /webhooks/almanax Register Almanax Hook
WebhooksApi PostWebhooksRss POST /webhooks/rss Register RSS Hook
WebhooksApi PostWebhooksTwitter POST /webhooks/twitter Register Twitter Hook
WebhooksApi PutWebhooksAlmanaxId PUT /webhooks/almanax/{id} Update Almanax Hook
WebhooksApi PutWebhooksRssId PUT /webhooks/rss/{id} Update RSS Hook
WebhooksApi PutWebhooksTwitterId PUT /webhooks/twitter/{id} Update Twitter Hook

Documentation for Models

Documentation for Authorization

Endpoints do not require authorization.