This client library make communication with FIO API much easier.
Examples of how to use Fio Client can be found in the sample project samples/FioSampleConsoleApp
Please note that FIO only allows one API call per 30 seconds.
At the beginning you must obtain your access token. You can obtain it in your FIO internetbanking. Your token must have read access (writing is not required at this moment).
Install client via NuGet package
PM> Install-Package FioSdk
Alternatively, you can use integration package for Microsoft DI
PM> Install-Package FioSdk.Extensions.DependencyInjection
Once you have your token and client installed, you can use SDK and get information about your statement
// create FioClient directly
using(HttpClient httpClient = new HttpClient())
{
IFioClient simpleClient = FioClient.Create(httpClient, new FioClientConfiguration()
{
AuthToken = "AUTH_TOKEN"
});
}
// OR create FioClient using MSDI
services.AddFioClient("AUTH_TOKEN");
// get account statement
AccountStatement statement = client.Periods(TransactionFilter.LastMonth());
// browse transactions
foreach (var transaction in statement.TransactionList.Transactions)
{
Console.WriteLine(transaction + " - " + transaction.Amount.Value);
}
var statement = client.Periods(TransactionFilter.LastDay());
var statement = client.Periods(TransactionFilter.LastMonth());
var statement = client.Periods(TransactionFilter.LastDays(14));
var statement = client.Periods(TransactionFilter.LastWeeks(8));
string html = client.Periods(TransactionFilter.LastDays(10), Format.Html);
string xml = client.Periods(TransactionFilter.LastDays(10), Format.Xml);
string csv = client.Periods(TransactionFilter.LastDays(10), Format.Csv);
var statement = client.Last();
You can change last download date also:
client.SetLastDownloadDate(DateTime.UtcNow.AddMonths(-1));
- .NET Standard 2.1 + (for version > 3.0)
- .NET Standard 2.0 + (for version < 3.0)
Version 3.1.0 contains new FIO base URL.
Version 3.0.0 contains important breaking changes. Due to using System.Text.Json library target framework has been changed to NET Standard 2.0.
- changed ApiExplorer to IFioClient (and FioClient implementation)
- all methods support async calls only
- cancellation tokens support
- implemented System.Text.Json with internal serializer config
- possibility to pass own HttpClient to FioClient
- common code cleanup
- all methods support async calls
- added support for .NET Standard 1.3