Skip to main content

Get device coordinates

Returns the coordinates of a device's installation site — latitude and longitude stored in its settings. The server does not determine coordinates itself: they are set with set_device_coordinates_req, when creating the device, or in the web interface.

Request and response: get_device_coordinates_req → get_device_coordinates_resp.
Access: a low access level token sees the devices of its application and of applications that granted it access; a high access level token sees all devices of the owner.

Request​

Fields not marked as required may be omitted.

FieldTypeDescription
cmdstringget_device_coordinates_req
operation_idstringAny string; the server returns it in the response to match the request and the response
devEuistringDevice DevEUI, 16 hex characters. Without it the server returns all available active devices
{
"cmd": "get_device_coordinates_req",
"operation_id": "1W3fd",
"devEui": "D745F677B2412E03"
}

Response​

FieldTypeDescription
cmdstringget_device_coordinates_resp
operation_idstringValue from the request
statusuint81 — success, 2 — error
deviceCountuint32Number of devices in the list
deviceListarrayDevices: devEui, lat — latitude, lon — longitude, in degrees. null if coordinates are not set
error_code, error_textuint8, stringOnly on error, see below
{
"cmd": "get_device_coordinates_resp",
"operation_id": "1W3fd",
"status": 1,
"deviceCount": 1,
"deviceList": [
{
"devEui": "D745F677B2412E03",
"lat": 43.2217921642226,
"lon": 76.8974626064301
}
]
}

Errors​

error_codeerror_textWhat happened
3Data is filled in with an errordevEui is not 16 hex characters
0—Internal server error — retry later

A device that does not exist or is not available with your token is not treated as an error: it is simply absent from deviceList.

See also​