Athonet.Api 1.0.34

dotnet add package Athonet.Api --version 1.0.34
                    
NuGet\Install-Package Athonet.Api -Version 1.0.34
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Athonet.Api" Version="1.0.34" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Athonet.Api" Version="1.0.34" />
                    
Directory.Packages.props
<PackageReference Include="Athonet.Api" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Athonet.Api --version 1.0.34
                    
#r "nuget: Athonet.Api, 1.0.34"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Athonet.Api@1.0.34
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Athonet.Api&version=1.0.34
                    
Install as a Cake Addin
#tool nuget:?package=Athonet.Api&version=1.0.34
                    
Install as a Cake Tool

Athonet.Api

A .NET client library for the Athonet API, providing access to HSS and MOGW endpoints.

License: MIT Nuget Nuget GitHub Codacy Badge

Installation

Install via NuGet Package Manager:

dotnet add package Athonet.Api

Or via Package Manager Console:

Install-Package Athonet.Api

Features

  • HSS (Home Subscriber Server) API support
  • MOGW (Mobile Gateway) API support
  • Certificate-based authentication
  • Configurable SSL certificate validation
  • Request/response logging support
  • Built on Refit for type-safe HTTP operations

Usage

Basic Setup

using Athonet.Api;
using System.Security.Cryptography.X509Certificates;

// Configure the client
var options = new AthonetClientOptions
{
    Username = "your-username",
    Password = "your-password",
    Certificate = new X509Certificate2("path/to/certificate.pfx", "password"),
    Hostname = "your-athonet-host.com",
    Port = 446, // Default port
    IgnoreSslCertificateErrors = false,
    StoreLastRequestAndResponse = true // Enable for debugging
};

// Create the client
using var client = new AthonetClient(options);

// Access HSS API
var hssData = await client.Hss.GetSubscribersAsync();

// Access MOGW API
var events = await client.Mogw.GetEventsAsync(...);

Configuration Options

Property Type Required Default Description
Username string Yes - API username
Password string Yes - API password
Certificate X509Certificate2 Yes - Client certificate for authentication
Hostname string Yes - Athonet server hostname
Port int No 446 API port
IgnoreSslCertificateErrors bool No false Bypass SSL certificate validation
StoreLastRequestAndResponse bool No false Store last HTTP request/response for debugging
UserAgent string No "Athonet.Api-nuget-package" Custom User-Agent header

Debugging

When StoreLastRequestAndResponse is enabled, you can access the raw HTTP data:

var options = new AthonetClientOptions
{
    // ... other settings
    StoreLastRequestAndResponse = true
};

using var client = new AthonetClient(options);

await client.Hss.SomeMethodAsync();

// Access raw HTTP data
var lastRequest = client.LastHttpRequest;
var lastResponse = client.LastHttpResponse;

Exception Handling

using Athonet.Api.Exceptions;

try
{
    await client.Hss.GetSubscribersAsync();
}
catch (AthonetApiException ex)
{
    Console.WriteLine($"HTTP Status: {ex.HttpStatusCode}");
    Console.WriteLine($"Response: {ex.ResponseBody}");
}

Requirements

  • .NET 10 or later
  • Valid Athonet API credentials
  • X.509 client certificate

License

See the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Support

For issues and questions, please use the GitHub Issues page.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.34 123 6/6/2026
1.0.33 123 4/29/2026
1.0.32 110 4/17/2026
1.0.31 124 4/16/2026
1.0.23 278 11/16/2025
1.0.17 598 11/8/2022
1.0.11 646 4/19/2022
1.0.5 630 2/4/2022
1.0.3 627 2/4/2022
1.0.1 557 2/25/2021
0.1.26-pre-gdb243c9373 574 11/18/2020
0.1.25-pre-gf60a78186a 487 11/13/2020
0.1.24-pre-gced720ea2e 486 11/10/2020
0.1.20-pre-g834368296f 521 10/23/2020
0.1.19-pre-g29527fa035 478 10/22/2020
0.1.18-pre 506 9/22/2020
0.1.16-pre 574 7/20/2020
0.1.15-pre 529 7/17/2020
0.1.14-pre 533 7/15/2020
0.1.7-pre 597 7/9/2020
Loading failed

Code quality improvements.
Updated nuget packages.
Added symbols.