Product Version Check
Use the product version endpoint to query the latest published version of your product. This allows your application to check for updates and notify users when a new version is available.
This endpoint is separate from license validation. Use Login Validation or Secret Key Validation to determine whether a customer has usage rights, and use Product Version Check when your app wants to detect newer published releases.
This endpoint only returns data when Version Management is enabled in your product’s App Licensing Branch settings.
How This Differs from Validation
api/v1/loginchecks rights for authenticated users.api/v1/keychecks rights for a customer-provided secret key.api/v1/product/app-versionchecks the latest published version metadata for a product.
You can call the version endpoint independently, or alongside validation, depending on how your application handles update checks.
Endpoint
POST api/v1/product/app-versionAuthentication: None required — this endpoint is anonymous.
Request
Headers
| Header | Value |
|---|---|
Content-Type |
application/json |
Body — ProductInfoRequest
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
ProductKey |
string |
Yes | 20–100 characters | The unique product key identifying your application. |
{
"ProductKey": "your-product-key-here"
}Response — ProductVersion
| Property | Type | Description |
|---|---|---|
Version |
string? |
The latest published version string (e.g., "2.1.0"). null if version management is not enabled. |
Data |
string? |
Optional metadata associated with the version (e.g., release notes, download URL, changelog). null if not set. |
Example Response
{
"Version": "2.1.0",
"Data": "Bug fixes and performance improvements."
}If version management is not enabled or the product key is invalid, the response returns empty values:
{
"Version": null,
"Data": null
}.NET Integration Example
Define the Models
public class ProductInfoRequest
{
public string ProductKey { get; set; } = string.Empty;
}
public class ProductVersion
{
public string? Data { get; set; }
public string? Version { get; set; }
}Call the Endpoint
using System.Net.Http.Json;
public class DistancerVersionClient
{
private readonly HttpClient _httpClient;
private const string BaseUrl = "https://appstore.distancer.ai/";
public DistancerVersionClient(HttpClient httpClient)
{
_httpClient = httpClient;
_httpClient.BaseAddress = new Uri(BaseUrl);
}
public async Task<ProductVersion?> CheckVersionAsync(
string productKey, CancellationToken ct = default)
{
var request = new ProductInfoRequest
{
ProductKey = productKey
};
var response = await _httpClient.PostAsJsonAsync(
"api/v1/product/app-version", request, ct);
response.EnsureSuccessStatusCode();
return await response.Content.ReadFromJsonAsync<ProductVersion>(ct);
}
}Implement an Update Check
var client = new DistancerVersionClient(new HttpClient());
var currentVersion = new Version("2.0.0");
var latest = await client.CheckVersionAsync("your-product-key");
if (latest?.Version != null && Version.TryParse(latest.Version, out var latestVersion))
{
if (latestVersion > currentVersion)
{
Console.WriteLine($"Update available: v{latest.Version}");
if (!string.IsNullOrEmpty(latest.Data))
{
Console.WriteLine($"Release notes: {latest.Data}");
}
}
else
{
Console.WriteLine("You are running the latest version.");
}
}When to Use This Endpoint
- You want to notify users about available updates inside your application.
- You maintain version metadata (release notes, download links) in the Distancer.ai dashboard and want your app to fetch it automatically.
- You have Version Management enabled in your App Licensing Branch settings.
Error Handling
| Scenario | Behavior |
|---|---|
| Invalid product key | 200 OK with null values for Version and Data |
| Version management not enabled | 200 OK with null values for Version and Data |
| Server error | Returns empty ProductVersion object |
Related
- Login Validation — Validate usage rights for authenticated users.
- Secret Key Validation — Validate usage rights with a customer secret key.