Docs • ZentryAuth

Guía de integración

Activación y validación por HWID, con ejemplos listos para copiar y pegar.

✔ Respuestas estándar ✔ HWID + Token ✔ C++ / C#
Antes de empezar
Necesitas: APP_KEY de tu panel, una forma de obtener el HWID real del equipo y usar HTTPS en producción.

🚀 Quickstart

Lo mínimo para integrar ZentryAuth.

3 pasos
  1. Define BASE_URL y APP_KEY.
  2. Envía key + hwid + version a Activate.
  3. Guarda el token y valida con Validate durante el uso.
Variables
BASE_URL = https://www.zentryauth.com
APP_KEY  = tu_app_key
VERSION  = 1.0.0
HWID     = PC-123
Nota: el HWID debe venir de tu aplicación cliente (PC real). Evita hardcodearlo en producción.

🧭 Flujo recomendado

1) Init (opcional)

Valida mantenimiento/versión antes de activar.

2) Activate

Activa licencia por HWID y devuelve token.

3) Validate

Valida token + HWID durante la sesión.

🔗 Endpoints

POST
opcional
/api/v1/{app_key}/init

Devuelve estado/version. Útil para bloquear mantenimiento o versiones no permitidas.

POST
/api/v1/{app_key}/license/activate

Input: key, hwid, version. Output: token.

Request JSON
{
  "key": "XXXX-XXXX-XXXX",
  "hwid": "PC-123",
  "version": "1.0.0"
}
Response (ejemplo)
{
  "success": true,
  "code": "OK",
  "message": "Activated",
  "data": { "token": "..." }
}
POST
/api/v1/{app_key}/license/validate

Input: token, hwid, version. Responde OK o error.

🧪 Ejemplos cURL

Activate
curl -X POST "https://www.zentryauth.com/api/v1/{app_key}/license/activate" \
  -H "Content-Type: application/json" \
  -d '{
    "key": "XXXX-XXXX-XXXX",
    "hwid": "PC-123",
    "version": "1.0.0"
  }'
Validate
curl -X POST "https://www.zentryauth.com/api/v1/{app_key}/license/validate" \
  -H "Content-Type: application/json" \
  -d '{
    "token": "TOKEN_AQUI",
    "hwid": "PC-123",
    "version": "1.0.0"
  }'

💻 Ejemplo C++

Ojo: en JSON las claves deben ir entre comillas y los valores string también.

#include <iostream>
#include <string>

std::string BuildActivateBody(const std::string& key, const std::string& hwid, const std::string& version) {
    return std::string("{")
        + "\"key\":\"" + key + "\","
        + "\"hwid\":\"" + hwid + "\","
        + "\"version\":\"" + version + "\""
        + "}";
}

int main() {
    std::string BASE_URL = "https://www.zentryauth.com";
    std::string APP_KEY  = "TU_APP_KEY";
    std::string VERSION  = "1.0.0";

    std::string key;
    std::cout << "key: ";
    std::getline(std::cin, key);

    std::string hwid = "PC-123";

    std::string url  = BASE_URL + "/api/v1/" + APP_KEY + "/license/activate";
    std::string body = BuildActivateBody(key, hwid, VERSION);

    auto res = Request(body, url);
    std::cout << res << std::endl;
}

🧩 Ejemplo C#

using System.Net.Http;
using System.Text;
using System.Text.Json;

var BASE_URL = "https://www.zentryauth.com";
var APP_KEY  = "TU_APP_KEY";
var VERSION  = "1.0.0";

var url = $"{BASE_URL}/api/v1/{APP_KEY}/license/activate";

var payload = new {
    key = "XXXX-XXXX-XXXX",
    hwid = "PC-123",
    version = VERSION
};

using var http = new HttpClient();
var json = JsonSerializer.Serialize(payload);
var content = new StringContent(json, Encoding.UTF8, "application/json");

var resp = await http.PostAsync(url, content);
var body = await resp.Content.ReadAsStringAsync();

Console.WriteLine(body);

⚠️ Códigos de error

INVALID_LICENSE

Clave inválida, expirada o HWID no coincide (respuesta genérica).

EXPIRED

Licencia expirada o token vencido (según endpoint).

MAINTENANCE

La app está en mantenimiento.

VERSION_BLOCKED

Versión no permitida por política de actualización.

🛡️ Recomendaciones de seguridad

  • • No muestres mensajes detallados al usuario final (usa mensaje genérico).
  • • Usa TLS (https) siempre en producción.
  • • Implementa rate-limit y logs de intentos fallidos.
  • • Guarda el token en memoria o almacenamiento seguro; no lo expongas en logs del cliente.

📩 Contacto

¿Te trabaste integrando? Escríbenos y te ayudamos.