This library is not supported anymore. If you need a C# SDK for Fozzy Windows VPS service, please register your interest with our support (support@fozzy.com) so we could let you know when we release a new version.
The API Client Library enables you to work with Fozzy Windows VPS APIs for creating or managing your machines.
- RestSharp - 105.1.0 or later
- Json.NET - 7.0.0 or later
- JsonSubTypes - 1.2.0 or later
The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:
Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes
NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742
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 FozzyHosting.WinVPS.Api;
using FozzyHosting.WinVPS.Client;
using FozzyHosting.WinVPS.Model;
To be able to send requests you need to get API key as described in API Documentation.
using System;
using System.Diagnostics;
using FozzyHosting.WinVPS.Api;
using FozzyHosting.WinVPS.Client;
using FozzyHosting.WinVPS.Model;
namespace Example
{
public class Example
{
public void main()
{
Configuration.Default.ApiKey.Add("Api-Key", "API key from WinVPS client area");
var apiInstance = new BrandsApi();
try
{
// Returns list of all available preinstalled software set.
BrandsListResponse result = apiInstance.BrandsGet();
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling BrandsApi.BrandsGet: " + e.Message );
}
}
}
}