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.
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.
-
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.
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.
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.
When you're ready to write your own code using this library, you'll need to:
- 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. - Provide your API key and access token with every function method on the Api classes, which are in the ExaVault\Api namespace.
- 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.