DeviantArtFs 12.0.0
dotnet add package DeviantArtFs --version 12.0.0
NuGet\Install-Package DeviantArtFs -Version 12.0.0
<PackageReference Include="DeviantArtFs" Version="12.0.0" />
<PackageVersion Include="DeviantArtFs" Version="12.0.0" />
<PackageReference Include="DeviantArtFs" />
paket add DeviantArtFs --version 12.0.0
#r "nuget: DeviantArtFs, 12.0.0"
#:package DeviantArtFs@12.0.0
#addin nuget:?package=DeviantArtFs&version=12.0.0
#tool nuget:?package=DeviantArtFs&version=12.0.0
DeviantArtFs
An unoffical F# library to interact with the DeviantArt API.
Design
Each request that can be made to DeviantArt is represented by a function
in one of the modules (static classes) in the DeviantArtFs.Api namespace.
Each static method takes an IDeviantArtAccessToken as its first parameter.
Most methods have additional parameters, many of which are discriminated
unions; hopefully this makes it easy to see exactly what your code is doing
and ensures that parameters can't get mixed up.
In some cases, two methods are available for an API call. Functions whose
names containing Page will return a single page of results, while the
corresponding Get function will return an asynchronous sequence which
begins at the offset you specify. (Keep API usage limits in mind!)
Interoperability
The response objects in this library are F# records which use F# option
types for optional fields. You can interact with option types from C# or
VB.NET using FSharpOption<T> and/or OptionModule, for example:
string title = OptionModule.ToObj(d.title);
DateTimeOffset? time = OptionModule.ToNullable(d.published_time);
FSharpList<T>, an immutable linked list that is part of the F# core library,
implements IReadOnlyList<T> and IEnumerable<T>.
IAsyncEnumerable<T> is now the same interface between F# and other .NET
languages, and you can interact with it using await foreach or extension
methods like ToListAsync in .NET's System.Linq.AsyncEnumerable namespace.
Optional parameters
Optional parameters for object expansion, ext_params, and mature content
filtering must be included through the token object. Use the interface
IDeviantArtAccessTokenWithOptionalParameters and include the optional
parameters in the OptionalParameters property; for example:
member _.OptionalParameters = [
OptionalParameter.Expansion [Expansion.UserProfile]
OptionalParameter.ExtParam ExtParam.Collection
OptionalParameter.MatureContent true
]
or:
public IEnumerable<OptionalParameter> OptionalParameters => new OptionalParameter[] {
OptionalParameter.NewExpansion(Expansion.UserProfile),
OptionalParameter.NewExtParam(ExtParam.Gallery),
OptionalParameter.NewMatureContent(true)
}
Deleted deviations and status updates
Deviation and DeviantArtStatus objects can represent a deviation or status
update that has been deleted; this is why most of the fields on those two
types are marked optional. Check the is_deleted field before attempting to
access any of the other fields.
Known issues
- The
profile_picfield in theuser.profileexpansion is not supported due to circular type definitions. Get it from the full profile object instead. - The
tier.statsfield is not supported due to serialization issues on DeviantArt's end (the empty object{}can be rendered as[]by the server). - The
api_sessionreturn object is not supported.
Authentication
See also: https://www.deviantart.com/developers/authentication
The DeviantArtAuth module provides methods to support the Authorization Code grant type (getting tokens from an authorization code and refreshing tokens).
If you need to store the access token somewhere (such as in a database or
file), you may want to create your own class that implements the
IDeviantArtAccessToken or IDeviantArtRefreshableAccessToken interface.
Using the latter will allow DeviantArtFs to automatically refresh the token
and store the new value when it recieves an HTTP 401 response.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Framework | net48 is compatible. net481 was computed. |
-
.NETFramework 4.8
- FSharp.Control.AsyncSeq (>= 4.15.0)
- FSharp.Core (>= 10.1.300)
- FSharp.Json (>= 0.4.1)
- Microsoft.Bcl.AsyncInterfaces (>= 10.0.8)
- System.Net.Http (>= 4.3.4)
-
net10.0
- FSharp.Control.AsyncSeq (>= 4.15.0)
- FSharp.Core (>= 10.1.300)
- FSharp.Json (>= 0.4.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on DeviantArtFs:
| Package | Downloads |
|---|---|
|
DeviantArtFs.Stash.Marshal
An F#/.NET library to interact with the Sta.sh API and manage state (.NET Standard 2.0) |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 12.0.0 | 44 | 5/22/2026 |
| 11.0.0 | 337 | 10/28/2024 |
| 11.0.0-beta2 | 187 | 10/28/2024 |
| 10.1.0-beta2 | 171 | 10/20/2024 |
| 10.1.0-beta1 | 172 | 9/21/2024 |
| 10.0.0 | 263 | 8/8/2024 |
| 10.0.0-rc1 | 178 | 8/8/2024 |
| 9.2.1-rc1 | 181 | 8/7/2024 |
| 9.2.0 | 264 | 6/19/2024 |
| 9.2.0-beta1 | 199 | 6/19/2024 |
| 9.1.1 | 256 | 4/27/2024 |
| 9.1.0-rc1 | 283 | 11/27/2023 |
| 9.0.0 | 369 | 11/22/2023 |
| 9.0.0-beta4 | 294 | 5/30/2023 |
| 9.0.0-beta2 | 250 | 5/28/2023 |
| 8.0.0 | 679 | 5/30/2021 |
| 8.0.0-beta4 | 442 | 5/30/2021 |
| 8.0.0-beta3 | 525 | 5/30/2021 |
| 8.0.0-beta2 | 445 | 5/30/2021 |
| 7.0.1 | 630 | 1/11/2021 |