Chi tiết Key
Lấy thông tin và danh sách thiết bị của key.
Chi tiết Key & Devices
Lấy thông tin chi tiết về key: thời hạn, trạng thái, và danh sách các thiết bị (UUID) đang sử dụng.
GET /public/v1/key/{key}/detail
X-API-Key: YOUR_API_KEY
Path Parameters
| Tham số | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
key | String | ✅ | Mã key cần tra cứu chi tiết. |
Ví dụ Response
200 OK - Key kích hoạt nhiều lần (multiple-activate)
json
{
"key": {
"activateCount": 2,
"activateLimit": 5,
"unit": "hour",
"duration": 720,
"expiredAt": "2024-12-31 23:59:59",
"isExpired": false,
"keystatus": 0,
"keytype": 1
},
"devices": [
{
"uid": "DEVICE-UUID-1234",
"expireAt": "2024-12-31 23:59:59",
"activeAt": null,
"isExpired": false,
"status": 1
}
]
}
200 OK - Key kích hoạt một lần (single-activate)
json
{
"key": {
"activateCount": 0,
"activateLimit": 1,
"unit": "second",
"duration": 2592000,
"expiredAt": null,
"isExpired": false,
"keytype": "once"
},
"devices": []
}
403 Forbidden - Không có quyền
json
{
"message": "You don't have permission to access this key"
}
Ví dụ PHP (cURL)
php
<?php
$apiKey = 'YOUR_API_KEY';
$keyToCheck = 'DEMO-ONCE-30D-ABCD';
$url = 'http://' . $_SERVER['HTTP_HOST'] . '/public/v1/key/' . $keyToCheck . '/detail';
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'X-API-Key: ' . $apiKey
],
]);
$response = curl_exec($curl);
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);
echo "HTTP Code: " . $httpCode . "\n";
echo "Response: " . $response . "\n";
?>
© 2026 CTDOAPIKEY Documentation