Skip to content

clv/vectorizer-ai-dotnet

Repository files navigation

Vectorizer.AI - the C# library for the Vectorizer.AI API

OpenAPI 3.0 specification for the Vectorizer.AI image vectorization API. Authenticate with HTTP Basic auth, using your API Id as the username and your API Secret as the password.

This C# SDK is automatically generated by the OpenAPI Generator project:

  • API version: 1.0.0
  • SDK version: 1.0.0
  • Generator version: 7.6.0
  • Build package: org.openapitools.codegen.languages.CSharpClientCodegen For more information, please visit https://vectorizer.ai/support

Frameworks supported

  • .NET Core >=1.0
  • .NET Framework >=4.6
  • Mono/Xamarin >=vNext

Dependencies

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
Install-Package System.ComponentModel.Annotations

NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742. NOTE: RestSharp for .Net Core creates a new socket for each api call, which can lead to a socket exhaustion problem. See RestSharp#1406.

Installation

Generate the DLL using your preferred tool (e.g. dotnet build)

Then include the DLL (under the bin folder) in the C# project, and use the namespaces:

using Vectorizer.AI.Api;
using Vectorizer.AI.Client;
using Vectorizer.AI.Model;

Usage

To use the API client with a HTTP proxy, setup a System.Net.WebProxy

Configuration c = new Configuration();
System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/");
webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
c.Proxy = webProxy;

Getting Started

using System.Collections.Generic;
using System.Diagnostics;
using Vectorizer.AI.Api;
using Vectorizer.AI.Client;
using Vectorizer.AI.Model;

namespace Example
{
    public class Example
    {
        public static void Main()
        {

            Configuration config = new Configuration();
            config.BasePath = "https://api.vectorizer.ai/api/v1";
            // Configure HTTP basic authorization: basicAuth
            config.Username = "YOUR_USERNAME";
            config.Password = "YOUR_PASSWORD";

            var apiInstance = new AccountApi(config);

            try
            {
                // Get account status
                AccountStatusResponse result = apiInstance.GetAccountStatus();
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling AccountApi.GetAccountStatus: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }

        }
    }
}

Documentation for API Endpoints

All URIs are relative to https://api.vectorizer.ai/api/v1

Class Method HTTP request Description
AccountApi GetAccountStatus GET /account Get account status
VectorizationApi PostDelete POST /delete Delete a retained image
VectorizationApi PostDownload POST /download Download a retained result
VectorizationApi PostVectorize POST /vectorize Vectorize an image

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

basicAuth

  • Type: HTTP basic authentication

About

Official .NET SDK for the Vectorizer.AI image vectorization API.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages