Endpoint REST API

GET /api/me

Contesto dell'account associato alla chiave API: tracker corrente e tutti i tracker a cui il token consente l'accesso.

Richiesta

GET https://api.nowmetrix.com/api/me

Utilizzare questo endpoint quando un'integrazione deve individuare i tracker accessibili con la chiave API prima di effettuare richieste specifiche per tracker.

Autenticazione

Richiede una chiave API nell'header Authorization, nel formato Authorization: Bearer nm_YOUR_KEY.

Parametri di query

Questo endpoint non accetta parametri di query.

Esempio cURL

curl -H "Authorization: Bearer nm_YOUR_KEY" \
  "https://api.nowmetrix.com/api/me"

Esempio di risposta

{
  "authenticated": true,
  "current_tracker": "TRACKER_ID",
  "trackers": [
    {
      "tracker": "TRACKER_ID",
      "host": "example-media.test"
    },
    {
      "tracker": "SECOND_TRACKER_ID",
      "host": "example-studio.test"
    }
  ]
}

Campi della risposta

Campo Tipo Descrizione
authenticated boolean Indica se il token Bearer è valido.
current_tracker string Primo tracker disponibile per la chiave API. Utilizzare gli ID dei tracker dell'array trackers per le richieste specifiche per tracker.
trackers[] array<object> Tracker disponibili per l'utente corrente.
trackers[].tracker string ID del tracker.
trackers[].host string Nome host normalizzato del tracker.

Aggiornamento e caching

Le risposte non vengono memorizzate nella cache. L'endpoint invia Cache-Control: no-store, no-cache, must-revalidate, max-age=0.

Errori

HTTP Codice Descrizione
401 missing_token L'header Authorization è assente.
401 invalid_token Il token non è valido o è stato revocato.
{
  "error": {
    "code": "invalid_token",
    "message": "Bearer token is invalid or revoked."
  }
}