C#
Instructions on how to install and use the MetaCopier API Client package
Last updated
dotnet add package MetaCopier.Api --version 1.2.6openapi-generator-cli generate -i https://api.metacopier.io/rest/api/documentation/v3/api-docs -g csharp<OutputType>Exe</OutputType>dotnet restoredotnet list packageProject 'Org.OpenAPITools' has the following package references
[net8.0]:
Top-level Package Requested Resolved
> JsonSubTypes 2.0.1 2.0.1
> Newtonsoft.Json 13.0.3 13.0.3
> Polly 8.1.0 8.1.0
> RestSharp 110.2.0 110.2.0
Project 'Org.OpenAPITools.Test' has the following package references
[net8.0]:
Top-level Package Requested Resolved
> Microsoft.NET.Test.Sdk 17.9.0 17.9.0
> xunit 2.7.0 2.7.0
> xunit.runner.visualstudio 2.5.7 2.5.7 dotnet add package JsonSubTypes --version 2.0.1
dotnet add package Newtonsoft.Json --version 13.0.3
dotnet add package RestSharp --version 112.0.0
dotnet add package System.ComponentModel.Annotations --version 5.0.0Project 'Org.OpenAPITools' has the following package references
[net8.0]:
Top-level Package Requested Resolved
> JsonSubTypes 2.0.1 2.0.1
> Newtonsoft.Json 13.0.3 13.0.3
> Polly 8.1.0 8.1.0
> RestSharp 112.0.0 112.0.0
> System.ComponentModel.Annotations 5.0.0 5.0.0internal class Program
{
public static void Main(string[] args)
{
Configuration config = new Configuration();
config.BasePath = "https://api.metacopier.io";
// Configure API key authorization: ApiKeyAuth
config.ApiKey.Add("X-API-KEY", "YOUR-API-KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.ApiKeyPrefix.Add("X-API-KEY", "Bearer");
var apiInstance = new AccountAPIApi(config);
try
{
var accounts = apiInstance.GetAccounts();
Console.WriteLine(JsonConvert.SerializeObject(accounts));
}
catch (ApiException e)
{
Debug.Print("Exception when calling AccountAPIApi: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
}
}
}