Skip to main content

GET /api/devices

This endpoint allows you to retrieve a list of available devices in the satellite tracking application. It is useful for viewing all tracked devices and obtaining basic details about each one.

Request Details

The request is made using the GET method at the /api/devices URL. No additional URL parameters are required to make this request.

Authentication Required

Authentication required to use the endpoint is via a Bearer token. This authentication method implies that each request must include an authorization header with a valid access token. This Bearer token acts as a credential that verifies the identity of the user or application making the request, ensuring that only authorized entities can modify the user's information. By requiring this type of authentication, the system guarantees a high level of security and access control, protecting users' data against unauthorized access.

Example Request

GET /api/devices HTTP/1.1
Host: api.plaspy.com
Authorization: Bearer {token}

Response Parameters

The response from this endpoint includes details about the success of the operation and, if successful, a list of devices. The response may vary depending on whether the request was successful or if there was an error.

FieldTypeRequiredDescription
successbooleanYesIndicates whether the request was successful.
errorstringNoError message in case the request fails.
apiUsageintegerNoAPI usage in the current request.
apiDailyUsageintegerNoDaily API usage.
devicesarrayNoList of devices. Each device is represented by an object with specific details.

Within the devices field, each device has the following fields:

FieldTypeRequiredDescription
idstringNoUnique identifier of the device.
namestringNoName of the device.
descriptionstringNoDescription of the device.
min (Mobile Identity Number)stringNoTelephone number associated with the device.
tagsobjectNoTags associated with the device.
expiresstringNoExpiration date and time of the device, in ISO 8601 format.

Example Successful Response

{
"success": true,
"apiUsage": 150,
"apiDailyUsage": 3000,
"devices": [
{
"id": "device123",
"name": "Device 1",
"description": "Main tracking device",
"min": "12345",
"tags": {
"tag1": "value1",
"tag2": "value2"
},
"expires": "2024-12-31T23:59:59Z"
},
{
"id": "device456",
"name": "Device 2",
"description": "Backup tracking device",
"min": "67890",
"tags": {
"tagA": "valueA",
"tagB": "valueB"
},
"expires": "2025-12-31T23:59:59Z"
}
]
}

Example Error Response

Error 400 (Bad Request) Response

{
"success": false,
"error": "Bad Request",
"apiUsage": 150,
"apiDailyUsage": 3000
}

Error 500 (Internal Server Error) Response

{
"success": false,
"error": "Internal Server Error",
"apiUsage": 150,
"apiDailyUsage": 3000
}

This endpoint is crucial for managing and monitoring the devices tracked within the system. It allows users to obtain detailed and up-to-date information about all devices under their control.

Plaspy GPS Tracking Platform

Explore the Plaspy platform and compatible GPS devices

Browse technical guides, application documentation, compatible trackers, and setup resources to get more value from Plaspy.