Avatar

Getting Vehicle Info from Device ID

0

There is a Device id when retrieving an ExceptionEvent entity. How can I use this device id to find the corresponding vehicle Info (where the device is installed)?

Mehdi

Please sign in to leave a comment.

2 comments

0
Avatar

Issue a get call and search by the device's ID.  I work in PHP and Python, so here are the examples:

PHP: $results = $api->get("Device",["search" => ["id" => "b1B"]]);

Python: newCall = api.get('Device', id ='b1B')

(b1B is the device's ID from Geotab, substitute the device ID that you are searching for). 

-Jeremiah

Jeremiah Cook 0 votes
0
Avatar

You can search for device by the ExceptionEvent.Device.Id property. Device represents the physical device and the asset (vehicle) to which it is attached.

Here's an example:

api.call("Get", {
"typeName": "Device",
"search": {
"id": "b1" // re: exceptionEvent.device.id
}
}, function(result) {
console.log("Done: ", result);
}, function(e) {
console.error("Failed:", e);
});
Steve Hansen 0 votes