Autenticazione dell'API — Token JWT
L’API di OODA Intelligence usa l’autenticazione JWT (JSON Web Tokens) su tutte le richieste.
Come ottenere un token
Invia una richiesta POST all’endpoint di autenticazione:
curl -X POST https://dashboard.oodaintel.com/api/v1/auth/token/ \
-H "Content-Type: application/json" \
-d '{"username": "tuo_utente", "password": "tua_password"}'
Risposta
{
"access": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
"refresh": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9..."
}
Come usare il token
Inserisci il token di accesso nell’header Authorization di ogni richiesta:
curl -X GET https://dashboard.oodaintel.com/api/v1/monitoring/ \
-H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9..."
Come rinnovare il token
Quando il token di accesso scade, usa il refresh token:
curl -X POST https://dashboard.oodaintel.com/api/v1/auth/token/refresh/ \
-H "Content-Type: application/json" \
-d '{"refresh": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9..."}'
Rate limiting
I limiti di richieste dipendono dal piano sottoscritto:
| Piano | Limite |
|---|---|
| Starter | 100 req/min |
| Professional | 500 req/min |
| Enterprise | 2.000 req/min |
Errori comuni
| Codice | Descrizione |
|---|---|
| 401 | Token non valido o scaduto |
| 403 | Nessun permesso sulla risorsa |
| 429 | Rate limit superato |