Get Last Device State
POST {{base_url}}/api/v2/device/getstate
Description
Get device state including location, speed, motion state, battery level and location time.
Response Body Contents
_id(string): Unique identifier for the post request object.deviceId(string): Unique identifier for the device (also known as MAC).archived(boolean): Indicates whether the object is archived or not.assetName(string): Name of the asset.configurationId(string): Configuration identifier.beaconType(string): Type of the beacon (assetfloNearable
orunknown
).context(string): Context of the device environment (Indoor
,Outdoor
,Unknown
)coordinates(object): Object containing coordinate information.lat(number): Latitude coordinate.lng(number): Longitude coordinate.alt(number): Altitude coordinate.speed(number): Speed value in km/h.heading(number): Heading value indicating direction of device in degrees.
createdAt(number): Timestamp indicating the creation time, specified in milliseconds starting at the UNIX epoch (January 1, 1970 00:00:00 UTC).deviceType(string): Type of the device (Tag
orLocator
).fixAsset(boolean): Indicates whether the device is an fixed asset or not (true or false).groups(array of strings): Array of groups associated with the device.icon(string): Icon associated with the object (tagIcon
orlocatorIcon
).isAnchor(boolean): Indicates whether the device is an anchor or not.isProvisioned(boolean): Indicates whether the object is provisioned or not.locTime(number): Timestamp indicating the location time in milliseconds.motionState(string): Motion state of the device (Stopped
,Idle
,Moving
,Driving
).organization(string): The organisation associated with the asset.protocol(string): Communication protocol associated with the device (BLE,
WIFI,
LTE,
IOX").scanTime(number): Timestamp indicating the scan time in milliseconds.source(string): Source of the object (API
orSCAN
)stateTime(number): Timestamp indicating the state time in milliseconds.status(string): Status of the asset (active
orinactive
)updatedAt(number): Timestamp indicating the last update time in milliseconds.location(object): Object containing location information.lat(number): Latitude coordinate.lng(number): Longitude coordinate.alt(number): Altitude coordinate.speed(number): Speed value in km\h.heading(number): Heading value indicating direction of device in degree.
locators(array): Array of locators associated with the object.telemetry(object): Telemetry data.isMoving(boolean): Indicates whether the object is moving or not.batterylevel: (number) Indicates current battery level.temperature: (number) Indicates temperature measurement by the device.
eventId(string): Event identifier.eventTime(string): Timestamp indicating the event time.fwVersion(number): Firmware version.pushState(boolean): Push state value.stopDuration(number): Duration of the stop.stopStart(number): Timestamp indicating the start of the stop.configurationId(string): Configuration identifier.connectors(array): Array of connectors.isPush(boolean): Indicates whether it is a push or not.firmware(array of objects): Array of firmware information.firmwareId(string): Firmware identifier.protocol(string): Communication protocol associated with the firmware.version(number): Version of the firmware.
Request Body
{"deviceId"=>"Device MAC Address"}
HEADERS
| Key | Datatype | Required | Description |
|---|---|---|---|
Content-Type | string |
RESPONSES
status: OK
{"_id":"636178633fe3bb06d32a5c10","deviceId":"de0366b789d8","archived":false,"assetName":"5G-de03","beaconType":"unknown","context":"Unknown","coordinates":{"lat":43.64467545151057,"lng":-79.39032326654123,"alt":-399.8593300618258,"speed":1,"heading":12},"createdAt":1667332195552,"deviceType":"Tag","fixAsset":false,"groups":["GroupVehicleId"],"icon":"tagIcon","id":"de0366b789d8","isAnchor":false,"isProvisioned":true,"locTime":1668184855950,"motionState":"Stopped","organization":"assetflotest","protocol":"LTE","scanTime":1668184855950,"source":"API","stateTime":1668185000952,"status":"Active","updatedAt":1668185760298,"location":{"lat":43.644674531030105,"lng":-79.39032159217336,"alt":-399.85932162866186,"speed":1,"heading":12},"locators":[],"telemetry":{"isMoving":false},"eventId":"de0366b789d8.1668184855950","eventTime":"2022-11-11T16:40:55.950Z","fwVersion":16,"isMoving":false,"lteTowerRSSI":-70,"pushState":true,"stopDuration":156136,"stopStart":1668184699814,"configurationId":"636d59c0e62bb0cdfd95076e","connectors":["DIG"],"isPush":true,"serialNo":"JU13214BA906","firmware":[{"firmwareId":"636d8f4ac51b3407c5ae05d1","protocol":"LTE","version":16},{"protocol":"BLE","version":3}],"noLocation":"used","geotabId":"b11","productId":10239}