.net SDK for figo Connect
Switch branches/tags
Clone or download
makst Merge pull request #4 from figo-connect/develop
Update SDK to correspond to the new version of API
Latest commit 2201e79 Aug 18, 2016


figo.net NuGet Version

.net bindings for the figo connect API: http://figo.io

Simply add figo.net from NuGet. In the Package Manager Console run the following command:

PM> Install-Package figo

And just as easy to use:

using figo;
using System;
using System.Security.Cryptography.X509Certificates;
using System.Net;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace figo.ConsoleDemo {
    class Program {
        static void WaitTask(Task task)
            catch (AggregateException ae)
                foreach (var e in ae.InnerExceptions)
                    // Handle only WebException
                    if (e is WebException)
                        Console.WriteLine("Message: {0}\nSource: {1}\nStackTrace: {2}", e.Message, e.Source, e.StackTrace);

        static void Main(string[] args)  {
            var validCertificates = new string[]
            FigoSession session = new FigoSession {
                AccessToken = "ASHWLIkouP2O6_bgA2wWReRhletgWKHYjLqDaqb0LFfamim9RjexTo22ujRIP_cjLiRiSyQXyt2kM1eXU2XLFZQ0Hro15HikJQT_eNeT_9XQ",
                // the same as default one here, but can be modified for testing purposes
                ApiEndpoint = "https://api.figo.me",
                OnRequestInitialize = (request) =>
                    // figo.net is portable, not all of the platforms have a support for ServerCertificateValidationCallback
                    // that's why check certificate on the client side 
                    request.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => {
                        X509Certificate x509Certificate = cert;
                        return validCertificates.Contains(x509Certificate.GetCertHashString());
            // print out a list of accounts including its balance
            var task_accounts = session.GetAccounts();
            foreach(FigoAccount account in task_accounts.Result) {

                var task_balance = session.GetAccountBalance(account);

		    // print out the list of all transactions on a specific account
            var task_transactions = session.GetTransactions("A1.2");
		    foreach(FigoTransaction transaction in task_transactions.Result) {

A more detailed documentation of the figo connect API can be found at http://docs.figo.io.


In this repository you can also have a look at a simple console and web demo in the folders ConsoleDemo and WebDemo respectively. While the console demo simply accesses the figo API, the web demo implements the full OAuth flow.

Building the NuGet package

It might be neccessary to call nuget like this to build the package:

nuget pack figo.net.csproj -Prop Platform=AnyCPU -Prop Configuration=Release