C# SDK

Install and start using the C# SDK.

Intro

The Axiom Cloud API SDK provides access to the Axiom Cloud API REST APIs.

API documentation for Axiom Cloud platform services.

Authentication: All endpoints require a Bearer token (API key) passed via the Authorization header.

Installation

Add the SDK as a project reference into your solution:

Terminal
dotnet add reference <path-to-sdk>/src/AxiomCloudApi/AxiomCloudApi.csproj

The project takes its build settings from the files around it, so reference it in place.

Quick Start

Dependency Injection

Register the client with IServiceCollection and resolve it from the container. The HttpClient is managed by IHttpClientFactory. Configure the client's behavior through AxiomCloudApiClientOptions.

C#
services.AddAxiomCloudApiClient(options =>
{
    options.BearerAuth = "YOUR_BEARER_TOKEN";
    options.Environment = ServerEnvironment.Production;
    // TODO: configure more client options here
});

Direct Instantiation

Create the client by passing an HttpClient you manage yourself. Configure the client's behavior through AxiomCloudApiClientOptions.

C#
var httpClient = new HttpClient();
// TODO: configure more client options here
var options = new AxiomCloudApiClientOptions
{
    BearerAuth = "YOUR_BEARER_TOKEN",
    Environment = ServerEnvironment.Production,
};
var client = new AxiomCloudApiClient(httpClient, options);

On this page