API Documentation

Integrate NovaLicense into your applications.

Getting Started

All requests must be made as a POST request to the respective endpoints.

Data should be sent in JSON format or standard Form-Data.

Every request requires your application's app_secret.

Base URL: http://mail.nlicence.com/api/

Initialize /api/init

Verify your application is connected and fetch basic settings.

JSON Payload
{
    "app_secret": "YOUR_APP_SECRET",
    "hwid": "USER_HARDWARE_ID"
}

Register User /api/register

Register a new user to your application.

JSON Payload
{
    "app_secret": "YOUR_APP_SECRET",
    "username": "DesiredUsername",
    "password": "SecurePassword123",
    "email": "user@email.com",
    "license_key": "XXXX-XXXX-XXXX" // Optional depending on auth type
}

Login User /api/login

Authenticate a registered user.

JSON Payload
{
    "app_secret": "YOUR_APP_SECRET",
    "username": "DesiredUsername",
    "password": "SecurePassword123",
    "hwid": "USER_HARDWARE_ID"
}

Verify License /api/license

Authenticate a user using just a license key (Key-Only Auth Mode).

JSON Payload
{
    "app_secret": "YOUR_APP_SECRET",
    "license_key": "XXXX-XXXX-XXXX",
    "hwid": "USER_HARDWARE_ID"
}

Custom Webhook /api/custom_webhook

Trigger a custom webhook event for your application.

JSON Payload
{
    "app_secret": "YOUR_APP_SECRET",
    "message": "User reached level 10!"
}

Get App Stats /api/stats

Fetch live statistics for your application (Total Users, Total Licenses, Active Licenses).

JSON Payload
{
    "app_secret": "YOUR_APP_SECRET"
}

Code Examples

C# Example

Code
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

class Program {
    static async Task Main() {
        using var client = new HttpClient();
        string json = "{\"app_secret\": \"YOUR_SECRET\", \"username\": \"test\", \"password\": \"pass\"}";
        var content = new StringContent(json, Encoding.UTF8, "application/json");
        
        var response = await client.PostAsync("http://mail.nlicence.com/api/login", content);
        string result = await response.Content.ReadAsStringAsync();
        
        Console.WriteLine(result);
    }
}

C++ (cURL) Example

Code
#include <iostream>
#include <string>
#include <curl/curl.h>

int main() {
    CURL *curl = curl_easy_init();
    if(curl) {
        std::string json = "{\"app_secret\": \"YOUR_SECRET\", \"license_key\": \"XXXX\"}";
        struct curl_slist *headers = NULL;
        headers = curl_slist_append(headers, "Content-Type: application/json");
        
        curl_easy_setopt(curl, CURLOPT_URL, "http://mail.nlicence.com/api/license");
        curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
        curl_easy_setopt(curl, CURLOPT_POSTFIELDS, json.c_str());
        
        curl_easy_perform(curl);
        curl_easy_cleanup(curl);
    }
    return 0;
}

Python Example

Code
import requests

url = "http://mail.nlicence.com/api/login"
data = {
    "app_secret": "YOUR_SECRET",
    "username": "test_user",
    "password": "test_password"
}

response = requests.post(url, json=data)
print(response.json())

PHP Example

Code
<?php
$url = 'http://mail.nlicence.com/api/init';
$data = json_encode(['app_secret' => 'YOUR_SECRET']);

$options = [
    'http' => [
        'header'  => "Content-type: application/json\r\n",
        'method'  => 'POST',
        'content' => $data
    ]
];
$context  = stream_context_create($options);
$result = file_get_contents($url, false, $context);

var_dump(json_decode($result, true));
?>