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"
}
]
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