How to View DVIR Logs through the SDK

Applies To

  • MyGeotab
  • Geotab Drive
  • HOS
  • SDK

Procedure

  1. Navigate to the API runner https://geotab.github.io/sdk/software/api/runner.html
  2. Login to the corresponding server
  3. Run the following API call to view the DVIR Logs for a Vehicle
    • api.call("Get", {
      "typeName": "DVIRLog",
      "search": {
      "DeviceSearch": {"id":"b1"},
      "fromDate":"2019-03-22T00:00:00.000Z",
      "toDate":"2019-03-23T00:00:00.000Z"
      }
      }, function(result) {
      console.log("Done: ", result);
      }, function(e) {
      console.error("Failed:", e);
      });
  4. Run the following API call to view the DVIR Logs for a Trailer
    • api.call("Get", {
      "typeName": "DVIRLog",
      "search": {
      "TrailerSearch": {"id":"aWQYLVpwugEyE8i2e1VK19w"},
      "fromDate":"2019-03-22T00:00:00.000Z",
      "toDate":"2019-03-23T00:00:00.000Z"
      }
      }, function(result) {
      console.log("Done: ", result);
      }, function(e) {
      console.error("Failed:", e);
      });

Additional Notes

  • Modify the fromDate, toDate, Device ID and Trailer ID accordingly
  • The timestamp in fromDate and toDate are in UTC 
  • A TrailerSearch and DeviceSearch cannot be used at the same time because a DVIR log entry is only ever associated with one asset type (for instance, if the "device" is set, "trailer" is always null and vice versa).
  • The above API call can also be used to view DVIR Logs based on a User by using the UserSearch object and specifying the User ID