FleetUp API Docs
  1. Authentication
FleetUp API Docs
  • Quick Start
    • Your First API Call
    • Token Expiration
    • Rate Limit
    • Error Codes
  • API Reference
    • Introduction
    • Authentication
      • /token
        GET
      • Obtain JWT Token
        POST
    • 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. Authentication

Obtain JWT Token

POST
/token
This endpoint generates a JWT-formatted token valid for 3600 seconds. Enterprise users are required to use this endpoint for authentication. The token must be included in the Authorization header (e.g., Bearer <token>) for subsequent API calls.

Request

Authorization
Add parameter in header
x-api-key
Example:
x-api-key: ********************
Body Params application/json
acctId
number 
required
Example:
12345
secret
string 
required
Example:
your-app-secret
Example
{
    "acctId": 12345,
    "secret": "your-app-secret"
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/token' \
--header 'Content-Type: application/json' \
--header 'x-api-key;' \
--data-raw '{
    "acctId": 12345,
    "secret": "your-app-secret"
}'

Responses

🟢200成功
application/json
200 response
Body
token
string 
required
Access JWT token which is valid for 3600s
Example:
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzZXNzaW9uSW5mbyI6eyJhY2NvdW50SWQiOjE2ODE2LCJyb2xlVHlwZSI6MiwiY2xpZW50QWRtaW5JZCI6MzUwMDgsImNsaWVudEFkbWluTGFuZyI6MSwibG9jYWxlIjoiZW5fVVMiLCJvcGVyYXRvcklkIjpudWxsfSwic3ViIjoiRmxlZXRVcCBPcGVuQVBJIiwiaXNzIjoiRmxlZXRVcCIsImV4cCI6MTc0MDYzNjc1MiwiaWF0IjoxNzQwNjMzMTUyfQ.55h5E0ZHCmODAGjeDQidJqSi-2G8ky_oNLvwhWVPBmA
Example
{
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzZXNzaW9uSW5mbyI6eyJhY2NvdW50SWQiOjE2ODE2LCJyb2xlVHlwZSI6MiwiY2xpZW50QWRtaW5JZCI6MzUwMDgsImNsaWVudEFkbWluTGFuZyI6MSwibG9jYWxlIjoiZW5fVVMiLCJvcGVyYXRvcklkIjpudWxsfSwic3ViIjoiRmxlZXRVcCBPcGVuQVBJIiwiaXNzIjoiRmxlZXRVcCIsImV4cCI6MTc0MDYzNjc1MiwiaWF0IjoxNzQwNjMzMTUyfQ.55h5E0ZHCmODAGjeDQidJqSi-2G8ky_oNLvwhWVPBmA"
}
Modified at 2025-02-28 08:12:14
Previous
/token
Next
/account-info
Built with