Integre o sistema CryptSystem em suas aplicações com nossa API RESTful completa
A API CryptSystem v1 é uma API RESTful que permite desenvolvedores integrarem o sistema de autenticação e licenciamento.
Todas as requisições devem ser feitas para esta URL base.
Todas as respostas são retornadas em formato JSON com a seguinte estrutura:
{
"success": true,
"message": "Operação realizada com sucesso",
"data": { ... },
"timestamp": 1234567890,
"datetime": "2024-01-01 12:00:00"
}
A API utiliza API Keys para autenticação. Obtenha sua API Key fazendo login:
Autenticar e obter API Key
username (string, obrigatório) - Nome de usuário ou emailpassword (string, obrigatório) - Senhacurl -X POST https://authluraph.com/api/v1/auth/login \
-H "Content-Type: application/json" \
-d '{
"username": "seu_usuario",
"password": "sua_senha"
}'
{
"success": true,
"message": "Autenticação realizada com sucesso",
"data": {
"api_key": "crypt_abc123...",
"user": {
"id": 1,
"username": "usuario",
"email": "email@exemplo.com",
"role": "reseller"
}
}
}
Após obter sua API Key, inclua-a em todas as requisições:
curl -X GET https://authluraph.com/api/v1/licenses \ -H "X-API-Key: crypt_abc123..."
| Método | Endpoint | Descrição |
|---|---|---|
| POST | /auth/login |
Autenticar e obter API Key |
| GET | /licenses |
Listar todas as licenças |
| GET | /licenses/{id} |
Obter detalhes de uma licença |
| POST | /licenses/{id}/verify |
Verificar status de uma licença |
| GET | /clients |
Listar clientes (revendedores/admins) |
| GET | /stats |
Obter estatísticas do sistema |
Listar todas as licenças do usuário autenticado
page (int, opcional) - Número da página (padrão: 1)limit (int, opcional) - Itens por página (padrão: 20, máximo: 100)status (string, opcional) - Filtrar por status (active, expired, banned)curl -X GET "https://authluraph.com/api/v1/licenses?page=1&limit=20" \ -H "X-API-Key: crypt_abc123..."
Obter detalhes de uma licença específica
curl -X GET https://authluraph.com/api/v1/licenses/1 \ -H "X-API-Key: crypt_abc123..."
Verificar status de uma licença
curl -X POST https://authluraph.com/api/v1/licenses/1/verify \ -H "X-API-Key: crypt_abc123..."
<?php
$apiKey = 'crypt_abc123...';
$baseUrl = 'https://authluraph.com/api/v1';
$ch = curl_init($baseUrl . '/licenses');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'X-API-Key: ' . $apiKey
]);
$response = curl_exec($ch);
$data = json_decode($response, true);
if ($data['success']) {
foreach ($data['data'] as $license) {
echo "Licença: " . $license['key_preview'] . "\n";
}
}
?>
import requests
api_key = 'crypt_abc123...'
base_url = 'https://authluraph.com/api/v1'
headers = {'X-API-Key': api_key}
response = requests.get(
f'{base_url}/licenses',
headers=headers
)
data = response.json()
if data['success']:
for license in data['data']:
print(f"Licença: {license['key_preview']}")
Todos os erros seguem o mesmo formato:
{
"success": false,
"message": "Mensagem de erro",
"data": {
"error_code": "ERROR_CODE"
}
}