Skip to main content

Installation

Install the package using NuGet:
Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes
Install-Package System.ComponentModel.Annotations
Run the following command to generate the DLL:
  • [Mac/Linux] /bin/sh build.sh
  • [Windows] build.bat
Then include the DLL (under the bin folder) in the C# project, and use the namespaces:
using Tradewatch.Api;
using Tradewatch.Client;
using Tradewatch.Model;

Usage

using System;
using System.Diagnostics;
using Tradewatch.Api;
using Tradewatch.Client;
using Tradewatch.Model;

namespace Example
{
    public class Example
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.tradewatch.io";
            // Configure API key authorization: api_key_query
            config.ApiKey.Add("api-key", "YOUR_API_KEY");

            var apiInstance = new AccountApi(config);
            var limit = 56;  // int? |  (optional) 
            var interval = new AccountUsageStatisticsInterval(); // AccountUsageStatisticsInterval |  (optional) 

            try
            {
                // Usage statistics
                AccountUsageStatistics result = apiInstance.getUsage(limit, interval);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling AccountApi.getUsage: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

More Examples

Find more examples in our GitHub repository.