Integrações — SmartGPS

Ref: smartgps.stoplight.io/docs/smartgps-api

Verificando...
Credenciais OAuth2
Client Credentials Flow
MOCK
Como obter as credenciais:
  1. Acesse o painel SmartGPS como administrador
  2. Menu: Configurações → Integrações → API
  3. Clique em "Gerar Credenciais"
  4. Copie o Client ID e Client Secret
Health Check
GET /account/me
Verificando conexão...
Ativação Pós-Instalação
Registra tracker + veículo e faz o binding na SmartGPS
POST /api/integrations/smartgps/activate
registerTracker
POST /trackers
createObject
POST /objects
assignTracker
POST /trackers/{id}/assign
ATIVO
Rastreamento live
Bloqueio de Partida
POST /trackers/{id}/commands
Última Posição
GET /objects/{id}/position/last
Selecione um IMEI para ver a posição
Referência dos Endpoints SmartGPS
Baseado em smartgps.stoplight.io
🔐 Autenticação
POST/auth/token
grant_type=client_credentials
📡 Trackers (Hardware)
GET/trackers?imei= &status= &groupId=
POST/trackers
GET/trackers/{id}
PATCH/trackers/{id}
POST/trackers/{id}/assign→ bind
POST/trackers/{id}/unassign
POST/trackers/{id}/commandsBLOCK/UNBLOCK
DELETE/trackers/{id}
🚛 Objects (Veículos)
GET/objects?plate= &status= &groupId=
POST/objects
GET/objects/{id}
PATCH/objects/{id}
GET/objects/{id}/position/last
GET/objects/{id}/positions?from= &to=
GET/objects/{id}/events?type= &severity=
🛡️ Geofences · Motoristas · Eventos
GET/geofences
POST/geofencesCIRCLE | POLYGON
DELETE/geofences/{id}
GET/drivers
POST/driversiButton / RFID
POST/events/{id}/ack
GET/account/mehealthCheck
Webhook de Eventos (recebimento)

Configure no painel SmartGPS para receber eventos em tempo real (excesso de velocidade, fadiga, geofence, etc.):

POST https://sua-instancia.gestrack.io/api/webhooks/smartgps/events Content-Type: application/json X-SmartGPS-Signature: sha256={hmac} { "event": "SPEEDING", "severity": "WARNING", "objectId": "SGO-ABC1234", "plate": "ABC-1234", "speed": 95, "limit": 80, "lat": -19.9167, "lng": -43.9333, "timestamp": "2026-03-03T10:32:00Z" }
Tipos de Eventos SmartGPS
${[ ['SPEEDING','#f87171','Excesso veloc.'],['HARSH_BRAKE','#fbbf24','Frenagem brusca'], ['HARSH_ACCEL','#fb923c','Aceler. brusca'],['HARSH_TURN','#a78bfa','Curva brusca'], ['GEOFENCE_ENTER','#34d399','Entrada geofence'],['GEOFENCE_EXIT','#f87171','Saída geofence'], ['FATIGUE','#f43f5e','Fadiga'],['DISTRACTION','#fb923c','Distração'], ['SMOKING','#94a3b8','Cigarro'],['PHONE_USE','#60a5fa','Celular ao volante'], ['SEAT_BELT','#facc15','Sem cinto'],['TAMPER','#f87171','Adulteração'], ['POWER_CUT','#ef4444','Corte energia'],['SOS','#f43f5e','Botão pânico'], ['BLOCKED','#64748b','Bloqueado'],['ACCIDENT','#dc2626','Colisão'], ['IGNITION_ON','#34d399','Chave ligada'],['IGNITION_OFF','#94a3b8','Chave desligada'], ['OFFLINE','#6b7280','Offline'],['DRIVER_CHANGE','#818cf8','Troca motorista'], ].map(([type, color, label]) => `${type}` ).join('')}