FleetUp API Docs
  1. API Guides
FleetUp API Docs
  • Quick Start
    • Your First API Call
    • Token Expiration
    • Rate Limit
    • Error Codes
  • API Reference
    • Introduction
    • Authentication
      • /token
      • Obtain JWT Token
    • Account & User & Device
      • /account-info
      • /users
      • /drivers/list
      • /devices
      • /devices/status
      • /devices/unlock
      • /devices/driver-overview
      • /devices/engine-hours
      • /devices/fuel-level
      • /devices/odometer
      • /devices/latest-ecu-data
      • /devices/{device-id}
      • /devices/{device-type}
      • /devices/{device-type}/details
      • /devices/{device-type}/history
    • Trips
      • /trips/history
      • /trips/ongoing-trips
    • Trip Share
      • /tripshare/live-eta
      • /tripshare/partners
      • /tripshare/share
    • Alerts
      • /alerts/summary
      • /alerts/history
      • /alerts/bulk-history
      • /fencealerts/fence-names
      • /fencealerts/geo-fencealerts
    • Location
      • Retrieve GPS data within a 24-hour time range
      • /gpsdata/device-last-location
      • /gpsdata/latest
      • /gpsdata/latest/4cj
      • /gpsdata/latest/5ta
      • /bulk-gpsdata
    • Maintenance
      • /maintenance/history
      • /maintenance/indicators
      • /maintenance/settings/indicators
      • /maintenance/settings/measurements
    • Reports
      • /reports/temperature-sensors
      • /reports/{report-key}
    • Geofence
      • Get all fences
      • Get fence detail
      • Retrieve geofence alerts
    • Others
      • /jobs
  • API Guides
    • Retrieve All Devices from an Enterprise
  1. API Guides

Retrieve All Devices from an Enterprise

Overview#

This user case demonstrates how to retrieve all devices from an enterprise using the FleetUp API. The process involves two main steps:
1.
Obtain a JWT token using the /token endpoint.
2.
Use the obtained token to call the /devices endpoint to fetch the devices.

Step 1: Obtain JWT Token#

First, you need to obtain a JWT token by making a POST request to the /token endpoint.

Request#

Response#

The response will include a JWT token that you can use for subsequent API calls.
{
  "token": "YOUR_JWT_TOKEN"
}

Step 2: Retrieve Devices#

Use the obtained JWT token to make a POST request to the /devices endpoint.

Request#

Response#

The response will include a list of devices.
[
  {
    "deviceId": "device1",
    "deviceName": "Device 1",
    "status": "active"
  },
  {
    "deviceId": "device2",
    "deviceName": "Device 2",
    "status": "inactive"
  }
  // Additional devices...
]

Notes#

Replace YOUR_X_API_KEY with your actual x-api-key.
Replace YOUR_ENTERPRISE_ACCOUNT_ID with your actual acctId.
Replace YOUR_APP_SECRET with your actual appSecret.
Replace YOUR_JWT_TOKEN with the token obtained from the /token endpoint.
Ensure that the x-api-key and JWT token are kept secure and not exposed publicly.
If you encounter any issues with the API endpoints, please verify the validity of the URLs and ensure that your network connection is stable.
Modified at 2025-03-03 04:56:12
Previous
/jobs
Built with