{"id":20184811,"url":"https://github.com/pawotter/mastodon-api-cs","last_synced_at":"2025-04-10T06:06:08.339Z","repository":{"id":144174567,"uuid":"88898027","full_name":"pawotter/mastodon-api-cs","owner":"pawotter","description":"The Mastodon API Client Library for C#","archived":false,"fork":false,"pushed_at":"2017-07-05T11:40:52.000Z","size":134,"stargazers_count":28,"open_issues_count":4,"forks_count":4,"subscribers_count":4,"default_branch":"develop","last_synced_at":"2025-04-10T06:05:46.399Z","etag":null,"topics":["csharp","mastodon"],"latest_commit_sha":null,"homepage":"https://github.com/tootsuite/mastodon","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pawotter.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-04-20T18:31:03.000Z","updated_at":"2025-02-23T14:50:42.000Z","dependencies_parsed_at":"2023-06-03T03:45:41.953Z","dependency_job_id":null,"html_url":"https://github.com/pawotter/mastodon-api-cs","commit_stats":{"total_commits":131,"total_committers":5,"mean_commits":26.2,"dds":"0.10687022900763354","last_synced_commit":"a2f479a3d57d49cdbf71c6c404a61cf82b461f71"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pawotter%2Fmastodon-api-cs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pawotter%2Fmastodon-api-cs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pawotter%2Fmastodon-api-cs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pawotter%2Fmastodon-api-cs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pawotter","download_url":"https://codeload.github.com/pawotter/mastodon-api-cs/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248166925,"owners_count":21058481,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","mastodon"],"created_at":"2024-11-14T03:09:09.863Z","updated_at":"2025-04-10T06:06:08.301Z","avatar_url":"https://github.com/pawotter.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NuGet](https://img.shields.io/nuget/v/Mastodon.API.svg)](https://www.nuget.org/packages/Mastodon.API) [![License](https://img.shields.io/cocoapods/l/BadgeSwift.svg?style=flat)](/LICENSE)\n\nMastodon API client library for C#\n======\n\nThe Mastodon API Client Library for C# (PCL 4.5, Profile 111)\n\nPull reqeusts are always welcome!\n\n#### master branch\n\n[![AppVeyor status](https://ci.appveyor.com/api/projects/status/qvfycjbddgbn2oxk?svg=true)](https://ci.appveyor.com/project/53ningen/mastodon-api-cs) [![Travis Status](https://travis-ci.org/pawotter/mastodon-api-cs.svg?branch=master)](https://travis-ci.org/pawotter/mastodon-api-cs) \n\n#### develop branch\n\n[![AppVeyor status](https://ci.appveyor.com/api/projects/status/qvfycjbddgbn2oxk/branch/develop?svg=true)](https://ci.appveyor.com/project/53ningen/mastodon-api-cs/branch/develop) [![Travis Status](https://travis-ci.org/pawotter/mastodon-api-cs.svg?branch=develop)](https://travis-ci.org/pawotter/mastodon-api-cs)\n\n\n# Install\n\n```\nInstall-Package Mastodon.API\n```\n\n# Registering an app to Mastodon instance\n\n```csharp\nvar authClient = new MastodonAuthClient(new Uri(\"https://friends.nico\"));\nvar redirectUri = new Uri(\"urn:ietf:wg:oauth:2.0:oob\");\nvar scope = OAuthAccessScope.of(OAtuhAccessScopeType.Read);\nvar app = await authClient.CreateApp(\"client_name\", redirectUri, scope);\n```\n\nA registered OAuth application is assigned a unique Client ID and Client Secret.\n\n# Login with email address and password\n\nNot recommended to use in service. The Authorization Code Grant flow is recommended for applications.\n\n```csharp\nvar token = await authClient.GetOAuthToken(app.ClientId, app.ClientSecret, \"username\", \"password\", scope);\n```\n\n# Making API Calls\n\n```csharp\nvar config = new MastodonApiConfig(instanceUrl, token.AccessToken);\nvar api = new MastodonApi(config);\nvar account = await api.GetCurrentAccount();\n```\n\n# Error Handling\n\nAll error responses are thrown as the type MastodonApiException.  Please be sure to catch this in your code and respond to any error condtions appropriately.\n\n```csharp\ntry\n{\n  // api calls here\n}\ncatch (MastodonApiException e)\n{\n  // error handling here (i.e., no results found, login failed, server error, etc)\n}\n```\n\n# License\n\nMIT\n\n# Author\n\ngomi_ningen (@53ningen)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpawotter%2Fmastodon-api-cs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpawotter%2Fmastodon-api-cs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpawotter%2Fmastodon-api-cs/lists"}