All Projects → pawotter → mastodon-api-cs

pawotter / mastodon-api-cs

Licence: MIT license
The Mastodon API Client Library for C#

Programming Languages

C#
18002 projects

Labels

Projects that are alternatives of or similar to mastodon-api-cs

Mastodon.el
Emacs client for Mastodon
Stars: ✭ 150 (+476.92%)
Mutual labels:  mastodon
TootNet
Yet Another .NET Mastodon Library
Stars: ✭ 32 (+23.08%)
Mutual labels:  mastodon
masto.js
🐘 Mastodon API client for JavaScript, TypeScript, Node.js, browsers
Stars: ✭ 518 (+1892.31%)
Mutual labels:  mastodon
Twidere Android
twidere.com
Stars: ✭ 2,486 (+9461.54%)
Mutual labels:  mastodon
mastomods
CSS tweaks and custom themes for Mastodon.
Stars: ✭ 95 (+265.38%)
Mutual labels:  mastodon
vue-socials
💬 Social media share buttons and counts for Vue.js
Stars: ✭ 32 (+23.08%)
Mutual labels:  mastodon
Mastodonkit
MastodonKit is a Swift Framework that wraps Mastodon's API
Stars: ✭ 134 (+415.38%)
Mutual labels:  mastodon
ligh7hau5
A Matrix (https://matrix.org/docs/spec/) to Fediverse / ActivityPub client / bridge. Also, some media proxying.
Stars: ✭ 26 (+0%)
Mutual labels:  mastodon
go-ostatus
An OStatus library written in Go
Stars: ✭ 32 (+23.08%)
Mutual labels:  mastodon
mastible
An Ansible playbook to install Mastodon
Stars: ✭ 17 (-34.62%)
Mutual labels:  mastodon
Tootstream
A command line interface for interacting with Mastodon instances
Stars: ✭ 231 (+788.46%)
Mutual labels:  mastodon
Self Hosted Docker Server Templates
Just some templates to get someone started with hosting various servers in Docker
Stars: ✭ 237 (+811.54%)
Mutual labels:  mastodon
MstdnTimelinePreviewCard
mastodonのTLにPreviewCardを表示するやつ
Stars: ✭ 12 (-53.85%)
Mutual labels:  mastodon
Mastodon Bot
a bot for mirroring Twitter/Tumblr accounts and RSS feeds on Mastodon
Stars: ✭ 158 (+507.69%)
Mutual labels:  mastodon
mastodon-to-twitter
Mas2tter - the Mastodon-to-Twitter Mirrorbot
Stars: ✭ 22 (-15.38%)
Mutual labels:  mastodon
Brutaldon
A brutalist web interface for Mastodon: moved to https://git.carcosa.net/jmcbray/brutaldon
Stars: ✭ 137 (+426.92%)
Mutual labels:  mastodon
madon
Golang Mastodon API library
Stars: ✭ 66 (+153.85%)
Mutual labels:  mastodon
omniauth-mastodon
OmniAuth strategy for Mastodon
Stars: ✭ 27 (+3.85%)
Mutual labels:  mastodon
indigenous-android
An open social app with support for IndieWeb, Mastodon, Pleroma and Pixelfed.
Stars: ✭ 89 (+242.31%)
Mutual labels:  mastodon
soundstorm
The Federated Social Audio Platform
Stars: ✭ 26 (+0%)
Mutual labels:  mastodon

NuGet License

Mastodon API client library for C#

The Mastodon API Client Library for C# (PCL 4.5, Profile 111)

Pull reqeusts are always welcome!

master branch

AppVeyor status Travis Status

develop branch

AppVeyor status Travis Status

Install

Install-Package Mastodon.API

Registering an app to Mastodon instance

var authClient = new MastodonAuthClient(new Uri("https://friends.nico"));
var redirectUri = new Uri("urn:ietf:wg:oauth:2.0:oob");
var scope = OAuthAccessScope.of(OAtuhAccessScopeType.Read);
var app = await authClient.CreateApp("client_name", redirectUri, scope);

A registered OAuth application is assigned a unique Client ID and Client Secret.

Login with email address and password

Not recommended to use in service. The Authorization Code Grant flow is recommended for applications.

var token = await authClient.GetOAuthToken(app.ClientId, app.ClientSecret, "username", "password", scope);

Making API Calls

var config = new MastodonApiConfig(instanceUrl, token.AccessToken);
var api = new MastodonApi(config);
var account = await api.GetCurrentAccount();

Error Handling

All error responses are thrown as the type MastodonApiException. Please be sure to catch this in your code and respond to any error condtions appropriately.

try
{
  // api calls here
}
catch (MastodonApiException e)
{
  // error handling here (i.e., no results found, login failed, server error, etc)
}

License

MIT

Author

gomi_ningen (@53ningen)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].