LoginSignup
10

More than 5 years have passed since last update.

C# Mastodon APIクライアントライブラリを作った

Last updated at Posted at 2017-04-22

急に気持ちが高まって書いてしまったけどエンドポイントがめっちゃ多くて途中で十二回くらい着手したことを後悔した。レポジトリは以下。

導入方法

NuGet: Mastodon.API

Install-Package Mastodon.API

使い方

使い方はとっても簡単。

var accessToken = "himitsu";
var instanceUrl = new Uri("https://friends.nico");
var config = new MastodonApiConfig(instanceUrl, accessToken);
var api = new MastodonApi(config, http);

// GET /api/v1/accounts/verify_credentials 
var account = await api.GetCurrentAccount();
var displayName = account.DisplayName; // 設定しいるユーザー名が取れる

雑にざっくり書いたので皆様のあたたかいプルリクエストとバグ報告をお待ちしております。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10