/evapi-csharp

ExaVault's C# API Client

Primary LanguageC#MIT LicenseMIT

ExaVault C# API Library - v2 API

Introduction

Welcome to ExaVault's C# code library for our v2 API. Our v2 API will allow you to interact with all aspects of the service the same way our web portal would. The library is generated from our API's public swagger YAML file.

Requirements

To use the SDK, you'll need Visual Studio installed as well as .NET Framework 4.0 or later.

You will also need an ExaVault account, as well as an API key and access token.

Installing the Code Library

Option 1 - Adding the code to your project

  • Clone the repository to your local machine

    $ git clone git@github.com:ExaVault/evapi-csharp.git
  • Add this repository to your project to debug/check the source code.

Option 2 - Direct .dll Installation

Alternatively, you can include the dlls generated by this project by copying lib folder onto your computer. Then you can add ExaVault.dll, JsonSubTypes.dll, Newtonsoft.Json.dll and RestSharp.dll as a reference into your own project. To do this, you need to right-click the References folder into the Solution Explorer and add all of them by using the Browse tab.

Sample Code

For a gentle introduction to using C# code with ExaVault's API, check out our code samples. Follow the instructions in that repository's README to run the sample scripts, which will demonstrate how to use several of the generated C# classes to interact with your ExaVault account.

Writing Your Own Code

When you're ready to write your own code using this library, you'll need to:

  1. Install our code library in your project, either with Clone this repository or by downloading the dll files from lib folder onto your local computer.
  2. Provide your API key and access token with every function method on the Api classes, which are in the ExaVault\Api namespace.
  3. Whenever you instantiate an Api object (ResourcesApi, UsersApi, etc.), override the configuration to point the code at the correct API URL:
var evAccountUrl  = "https://YOUR_ACCOUNT_NAME_HERE.exavault.com/api/v2/";
var accountApi = new AccountApi(evAccountUrl);
var evAccountUrl  = "https://YOUR_ACCOUNT_NAME_HERE.exavault.com/api/v2/";
var resourcesApi = new ResourcesApi(evAccountUrl);
var evAccountUrl  = "https://YOUR_ACCOUNT_NAME_HERE.exavault.com/api/v2/";
var usersApi = new UsersApi(evAccountUrl);

If you'd like to see this done in sample code, please take a look at our code samples.

Author

support@exavault.com