Loading...

GET /api/devices/{deviceId}/lastLocation

The last known location is the most recent position Plaspy has on record for a tracker. If someone asks where a van is, the coordinates let you place it on the map. The time of the fix tells you whether the information is seconds old or comes from an earlier trip.

Supply the ID of the device you want to look up. To draw a marker, request latitude and longitude. The position also includes its date and time. If the tracker has never reported, there may be no location to display.

Request Details

GET /api/devices/{deviceId}/lastLocation

Request Parameters

Path parameters

ParameterTypeRequiredDescription
deviceIdStringRequiredStringYesTracker identifier in the path. Use the id from the device list.

Query parameters

ParameterTypeRequiredDescription
fieldsString arrayOptionalString arrayNoNames of the fields to return. Separate them with commas or repeat the parameter. The selection always includes dateTime.

Replace the sample identifier with a device id visible in GET /api/devices.

Omitting fields returns the usual available fields. Request outputs explicitly to include device outputs. The position fields table lists the accepted names.

Optional fields with no reading can be omitted. The contract allows null values for latitude, longitude and milleage.

Authentication Required

Send the access token in the Authorization: Bearer <token> header. See Authentication.

Example Request

GET /api/devices/123456789012345/lastLocation?fields=latitude,longitude HTTP/1.1 Host: api.plaspy.com Authorization: Bearer {token}

Response Parameters

A response with a position includes lastLocation. If the tracker has not yet reported, this field may be absent. The lookup uses one unit.

FieldTypePresenceDescription
lastLocationObjectWhen a position is availableObjectWhen a position is availableLast tracker position. It may be absent if the tracker has never reported.
successBooleanAlwaysBooleanAlwaysIn a successful response, true confirms the operation.
apiUsageIntegerAlwaysIntegerAlwaysUnits charged for this request.
apiDailyUsageIntegerAlwaysIntegerAlwaysDaily usage before the units for this request are added.

Last location fields

FieldTypePresenceDescription
dateTimeDate-timeIn every positionDate-timeIn every positionRecord date and time in the user’s time zone.
latitudeNumberDepends on selection and dataNumberDepends on selection and dataLatitude of the last location.
longitudeNumberDepends on selection and dataNumberDepends on selection and dataLongitude of the last location.
speedNumberDepends on selection and dataNumberDepends on selection and dataSpeed in metres per second.
courseNumberDepends on selection and dataNumberDepends on selection and dataCourse (direction) at the last location.
batteryIntegerDepends on selection and dataIntegerDepends on selection and dataBattery level of the device at the last location.
fuelIntegerDepends on selection and dataIntegerDepends on selection and dataFuel level of the device at the last location.
fuel2IntegerDepends on selection and dataIntegerDepends on selection and dataSecondary fuel level at the last location.
temperatureNumberDepends on selection and dataNumberDepends on selection and dataTemperature measured at the last location.
temperature2NumberDepends on selection and dataNumberDepends on selection and dataSecondary temperature measured at the last location.
sensorTime1IntegerDepends on selection and dataIntegerDepends on selection and dataSensor 1 time at the last location.
sensorTime2IntegerDepends on selection and dataIntegerDepends on selection and dataSensor 2 time at the last location.
sensorTime3IntegerDepends on selection and dataIntegerDepends on selection and dataSensor 3 time at the last location.
sensorTime4IntegerDepends on selection and dataIntegerDepends on selection and dataSensor 4 time at the last location.
inactiveSecondsIntegerDepends on selection and dataIntegerDepends on selection and dataInactive seconds at the last location.
rpmIntegerDepends on selection and dataIntegerDepends on selection and dataRevolutions per minute at the last location.
milleageNumberDepends on selection and dataNumberDepends on selection and dataMileage at the last location.
warningTextsString arrayDepends on selection and dataString arrayDepends on selection and dataWarning texts at the last location.
alertTextsString arrayDepends on selection and dataString arrayDepends on selection and dataAlert texts at the last location.
alertsString arrayDepends on selection and dataString arrayDepends on selection and dataAlerts at the last location.
warningsString arrayDepends on selection and dataString arrayDepends on selection and dataWarnings at the last location.
hasCriticalAlertBooleanDepends on selection and dataBooleanDepends on selection and dataIndicates if there are critical alerts at the last location.
attributesObjectDepends on selection and dataObjectDepends on selection and dataAdditional attributes at the last location.
accessoriesAttributesObject arrayDepends on selection and dataObject arrayDepends on selection and dataAdditional attributes of accessories at the last location.
inputsBoolean arrayDepends on selection and dataBoolean arrayDepends on selection and dataState of the inputs at the last location.
outputsBoolean arrayIf requested and availableBoolean arrayIf requested and availableState of the outputs at the last location.

Example HTTP 200 response

{ "success": true, "apiUsage": 1, "apiDailyUsage": 12, "lastLocation": { "dateTime": "2026-06-10T09:12:00", "latitude": 4.61, "longitude": -74.08 } }

Errors

FieldTypePresenceDescription
successBooleanDepends on the errorBooleanDepends on the errorIn the operation errors shown here, the value is false.
errorStringDepends on the errorStringDepends on the errorMessage explaining why the request was rejected.

The tracker must be enabled and have daily API allowance available. Once the allowance is exhausted, the request returns HTTP 400. The allowance resets at 00:00 UTC.

If a field is unknown, the API returns HTTP 400 and lists the accepted names in error. Correct the selection and repeat the query. Also check the identifier and device access.

Example HTTP 400 error

{ "success": false, "error": "Device with id '123456789012345' does not exist." }
Index
Questions?

We answer all support request within 24 business hours approximately, If you have a question that needs an immediate resolution, please contact us by other way.

We answer you in business hours, as soon as possible. We are located in Bogotá, Colombia, time zone (GMT-5).

Last modification: 2026-11-30 11:47:42