Guía de integración
Activación y validación por HWID, con ejemplos listos para copiar y pegar.
🚀 Quickstart
Lo mínimo para integrar ZentryAuth.
- Define BASE_URL y APP_KEY.
- Envía key + hwid + version a Activate.
- Guarda el token y valida con Validate durante el uso.
BASE_URL = https://www.zentryauth.com
APP_KEY = tu_app_key
VERSION = 1.0.0
HWID = PC-123
🧭 Flujo recomendado
Valida mantenimiento/versión antes de activar.
Activa licencia por HWID y devuelve token.
Valida token + HWID durante la sesión.
🔗 Endpoints
Devuelve estado/version. Útil para bloquear mantenimiento o versiones no permitidas.
Input: key, hwid, version. Output: token.
{
"key": "XXXX-XXXX-XXXX",
"hwid": "PC-123",
"version": "1.0.0"
}
{
"success": true,
"code": "OK",
"message": "Activated",
"data": { "token": "..." }
}
Input: token, hwid, version. Responde OK o error.
🧪 Ejemplos cURL
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"
}'
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
Clave inválida, expirada o HWID no coincide (respuesta genérica).
Licencia expirada o token vencido (según endpoint).
La app está en mantenimiento.
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.