Monobank.API.Core 1.2.0

dotnet add package Monobank.API.Core --version 1.2.0                
NuGet\Install-Package Monobank.API.Core -Version 1.2.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Monobank.API.Core" Version="1.2.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Monobank.API.Core --version 1.2.0                
#r "nuget: Monobank.API.Core, 1.2.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Monobank.API.Core as a Cake Addin
#addin nuget:?package=Monobank.API.Core&version=1.2.0

// Install Monobank.API.Core as a Cake Tool
#tool nuget:?package=Monobank.API.Core&version=1.2.0                

Monobank API library

NuGet version (Monobank.API.Core)

This library is a wrapper on Monobank open API. To use it you will need to get a personal token at https://api.monobank.ua/.

How to use:

Public API:

Available without a personal token. Just intitialize MonoClient with it's default constructor.

static async Task Main(string[] args)
{
    var mono = new MonoClient();
    var currencies = await mono.Currency.GetCurrencies();
}

Client API:

Available only with a personal token.

User information
static async Task Main(string[] args)
{
    var mono = new MonoClient("YOUR_TOKEN");
    var userInfo = await mono.Client.GetClientInfo();
}
Statements
static async Task Main(string[] args)
{
    var mono = new MonoClient("YOUR_TOKEN");
    var statements = await mono.Client.GetStatements(from: new DateTime(2019, 6, 1), 
                                                     to: new DateTime(2019, 6, 30));
}
Webhook

Allows to be notified when there are transactions on user account.

According to documentation, you need a POST endpoint to listen to webhook and the same GET endpoint for backing services to check availability. If you set webhook at https:\\example.com\webhook\test url - you will actually need two endpoints:
GET https:\example.com\webhook\test
POST https:\example.com\webhook\test

static async Task Main(string[] args)
{
    var mono = new MonoClient("YOUR_TOKEN");
    bool success = await mono.Client.SetWebhook("https:\\example.com\webhook\test");
}

To check webhook url - query user information and refer to webHookUrl property:

static async Task Main(string[] args)
{
    var mono = new MonoClient("YOUR_TOKEN");
    var userInfo = await mono.Client.GetClientInfo();
    var webHookUrl = userInfo.WebHookUrl;
}

How to test:

In a test project create appsettings.test.json file. Set its Copy to output directory property to Copy if newer. Fill in the ApiKey field and enjoy safe testing 😃

{
    "ApiKey": "<your-api-key>"
}

Note: appsettings.test.json added to .gitignore, so it won't be commited and pushed to the repository.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.0 118 9/10/2024
1.1.0 119 9/10/2024
1.0.9 4,914 12/8/2021
1.0.8 377 7/4/2021
1.0.7 551 1/8/2020
1.0.6 530 1/8/2020
1.0.5 576 7/17/2019
1.0.4 545 7/9/2019
1.0.3 535 6/30/2019
1.0.2 529 6/29/2019
1.0.1 532 6/29/2019
1.0.0 544 6/29/2019

Updated code to reflect API changes.