.NET API Wrapper for the Closelink API (http://developer.closelink.com)
Install-Package CloselinkAPI
dotnet add package CloselinkAPI
Import the following namespaces:
using CloselinkAPI.Api;
using CloselinkAPI.Client;
using CloselinkAPI.Model;
using System;
using System.Collections.Generic;
using CloselinkAPI.Api;
using CloselinkAPI.Client;
using CloselinkAPI.Model;
namespace Example
{
class Program
{
static void Main(string[] args)
{
// Configure API key authorization
Configuration.Default.ApiKey = "YOUR_API_KEY";
var apiInstance = new StockApi();
var stocks = new List<Stock>
{
new Stock(
"imo1",
DateTime.Parse("2020-08-01T00:00:00.000Z"),
5000,
Stock.OilTypeEnum.AeCirc
),
new Stock(
"imo1",
DateTime.Parse("2020-08-01T00:00:00.000Z"),
7000,
Stock.OilTypeEnum.MeCylHs
)
};
try
{
// Creates new Stock data
ApiResponse<List<Stock>> response = apiInstance.Create(stocks);
Console.WriteLine("StatusCode: " + response.StatusCode);
var stockResult = response.Data;
stockResult.ForEach(Console.WriteLine);
}
catch (Exception e)
{
Console.WriteLine("Exception when calling StockApi.Create: " + e.Message);
}
}
}
}
- Type: API key
- API key parameter name: apikey
- Location: HTTP header
The code is mainly generated by https://github.com/swagger-api/swagger-codegen.git and then simplified for this usecase.