{"id":25663364,"url":"https://github.com/mr1penguin/deviantartapi","last_synced_at":"2025-04-22T11:34:12.336Z","repository":{"id":9568815,"uuid":"62622219","full_name":"Mr1Penguin/DeviantartApi","owner":"Mr1Penguin","description":"DeviantartApi Library in C# (netstandard 2)","archived":false,"fork":false,"pushed_at":"2022-12-07T23:48:09.000Z","size":327,"stargazers_count":6,"open_issues_count":4,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T03:03:25.916Z","etag":null,"topics":["api","deviantart","nuget","rest","uwp","winrt"],"latest_commit_sha":null,"homepage":"","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/Mr1Penguin.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-05T09:09:21.000Z","updated_at":"2024-06-04T02:34:34.000Z","dependencies_parsed_at":"2023-01-11T17:38:49.402Z","dependency_job_id":null,"html_url":"https://github.com/Mr1Penguin/DeviantartApi","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mr1Penguin%2FDeviantartApi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mr1Penguin%2FDeviantartApi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mr1Penguin%2FDeviantartApi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mr1Penguin%2FDeviantartApi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mr1Penguin","download_url":"https://codeload.github.com/Mr1Penguin/DeviantartApi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250232846,"owners_count":21396718,"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":["api","deviantart","nuget","rest","uwp","winrt"],"created_at":"2025-02-24T05:14:50.564Z","updated_at":"2025-04-22T11:34:12.291Z","avatar_url":"https://github.com/Mr1Penguin.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DeviantartApi Library in C# (netstandard 2) \n\nLibrary for using [Deviantart API](https://www.deviantart.com/developers/http/v1/20160316) from .NET.\n\n### Acquiring\n\n#### nuget (outdated)\n[![NuGet](https://img.shields.io/badge/nuget.Core-2.0.2-brightgreen.svg?maxAge=2592000?style=flat-square)](https://www.nuget.org/packages/DeviantartApi/)\n\n#### git\nprefered for now\n\n### Usage\n\nIf you use platform with implemented login process:\n\n```cs\n\nvoid RefreshTokenUpdated(string newRefreshToken)\n{\n\tif(SavedToken != newRefreshToken)\n\t\tSaveToken(newRefreshToken, DateTime.Now.AddMonths(3));\n}\n...\n// There is no valid RefreshToken\nvar result = await DeviantartApiLogin.Platform.Login.SignInAsync(ClientId, Secret, CallbackUrl, RefreshTokenUpdated, \n\t\t\t\t\t\t\t\t\t\t\t\t   new[]\n\t\t\t\t\t\t\t\t\t\t\t\t   {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tDeviantartApi.Login.Scope.Browse,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tDeviantartApi.Login.Scope.User,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tDeviantartApi.Login.Scope.Feed\n\t\t\t\t\t\t\t\t\t\t\t\t   }));\nif(result.IsLoginError) \n{\n\tShowError(result.LoginErrorText);\n\treturn;\n}\n\nSaveToken(result.RefreshToken, DateTime.Now.AddMonths(3));\nreturn;\n...\n// You have valid RefreshToken\nDeviantartApiLogin.Platform.Login.AttachLogin(); //So TokenChecker know what must be called if refreshtoken invalid\nvar result = await DeviantartApi.Login.SetAccessTokenByRefreshAsync(ClientId, Secret, CallbackUrl, RefreshToken, RefreshTokenUpdated, new[]\n\t\t\t\t\t\t\t\t\t\t\t\t   {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tDeviantartApi.Login.Scope.Browse,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tDeviantartApi.Login.Scope.User,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tDeviantartApi.Login.Scope.Feed\n\t\t\t\t\t\t\t\t\t\t\t\t   });\nif(result.IsLoginError) \n{\n\tShowError(result.LoginErrorText);\n\treturn;\n}\nSaveToken(result.RefreshToken, DateTime.Now.AddMonths(3));\nreturn;\n\n```\n\nOtherwise:\n\n```cs\n\nvoid RefreshTokenUpdated(string newRefreshToken)\n{\n\tif(SavedToken != newRefreshToken)\n\t\tSaveToken(newRefreshToken, DateTime.Now.AddMonths(3));\n}\n...\n// There is no valid RefreshToken\nDeviantartApi.Login.CustomSignInAsync = MySignInAsync;\nvar result = await DeviantartApi.Login.SignInAsync(ClientId, Secret, CallbackUrl, RefreshTokenUpdated, \n\t\t\t\t\t\t\t\t\t\t\t\t   new[]\n\t\t\t\t\t\t\t\t\t\t\t\t   {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tDeviantartApi.Login.Scope.Browse,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tDeviantartApi.Login.Scope.User,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tDeviantartApi.Login.Scope.Feed\n\t\t\t\t\t\t\t\t\t\t\t\t   }));\nif(result.IsLoginError) \n{\n\tShowError(result.LoginErrorText);\n\treturn;\n}\n\nSaveToken(result.RefreshToken, DateTime.Now.AddMonths(3));\nreturn;\n...\n// You have valid RefreshToken\nDeviantartApi.Login.CustomSignInAsync = MySignInAsync; //So TokenChecker know what must be called if refreshtoken invalid\nvar result = await DeviantartApi.Login.SetAccessTokenByRefreshAsync(ClientId, Secret, CallbackUrl, RefreshToken, RefreshTokenUpdated, new[]\n\t\t\t\t\t\t\t\t\t\t\t\t   {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tDeviantartApi.Login.Scope.Browse,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tDeviantartApi.Login.Scope.User,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tDeviantartApi.Login.Scope.Feed\n\t\t\t\t\t\t\t\t\t\t\t\t   });\nif(result.IsLoginError) \n{\n\tShowError(result.LoginErrorText);\n\treturn;\n}\nSaveToken(result.RefreshToken, DateTime.Now.AddMonths(3));\nreturn;\n\n\n```\n\nRequests example\n\n```cs\n\nvar result = await new DeviantartApi.Requests.User.WhoAmIRequest().ExecuteAsync();\nif (result.IsError)\n{\n    ShowError(result.ErrorText);\n    return;\n}\nUserName = result.Object.Username;\nUserAvatarUri = new Uri(result.Object.UserIcon);\n\n//or \nvar Feed = new HomeRequest();\nFeed.LoadMature = true;\nvar result = await Feed.GetNextPageAsync();\nif(result.IsError)\n{\n\tShowError(result.ErrorText);\n\treturn;\n}\n//use data\n...\n//get next page\n\nresult = await Feed.GetNextPageAsync();\n\n//start from beginning\nFeed.Cursor = \"\";\n\nresult = await Feed.GetNextPageAsync();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmr1penguin%2Fdeviantartapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmr1penguin%2Fdeviantartapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmr1penguin%2Fdeviantartapi/lists"}