Validate a licence key
One POST to /apps/{appId}/licenses/authenticate. .NET 6+. No packages beyond the BCL.
using System.Net.Http.Json;
var http = new HttpClient { BaseAddress = new Uri("https://api.evora.lol/api/developer-api/") };
http.DefaultRequestHeaders.Authorization =
new("Bearer", Environment.GetEnvironmentVariable("EVORA_API_KEY"));
var appId = Environment.GetEnvironmentVariable("EVORA_APP_ID");
var res = await http.PostAsJsonAsync(
$"apps/{appId}/licenses/authenticate",
new { licenseKey });
res.EnsureSuccessStatusCode();
var data = await res.Content.ReadFromJsonAsync<AuthResult>();
record AuthResult(bool Authenticated, Subscription? Subscription);
record Subscription(int Level, string? Name, DateTime? ExpiresAt, bool Active);