After 5 failed attempts, your IP will be temporarily blocked for 15 minutes.
403 - IP Blocked
Copy
{ "success": false, "error": { "code": "IP_BLOCKED", "message": "Your IP has been temporarily blocked due to too many invalid attempts" }, "requestId": "req_abc123"}
const data = await validateApiKey();const isProduction = process.env.NODE_ENV === 'production';const keyType = data.apiKey.type;if (isProduction && keyType === 'SANDBOX') { throw new Error('⚠️ Using SANDBOX key in production environment!');}if (!isProduction && keyType === 'PRODUCTION') { console.warn('⚠️ Using PRODUCTION key in development environment!');}
Handle Gracefully
Implement proper error handling
Copy
async function validateWithRetry(maxRetries = 3) { for (let i = 0; i < maxRetries; i++) { try { const response = await fetch('https://api.oneclickdz.com/v3/validate', { headers: { 'X-Access-Token': API_KEY } }); const data = await response.json(); if (data.success) { return data.data; } if (data.error.code === 'INVALID_ACCESS_TOKEN') { throw new Error('Invalid API key - check your configuration'); } if (data.error.code === 'IP_BLOCKED') { throw new Error('IP blocked - too many failed attempts'); } } catch (error) { if (i === maxRetries - 1) throw error; await new Promise(resolve => setTimeout(resolve, 1000 * (i + 1))); } }}