Avatar

Need rest API details to fetch vehicle engine data

1

Hi Team,

We are trying to build backend server which collects data from Geotab device. We are referring below link but could not find API urls to get engine data like coolant temperature, mileage, distance traveled etc. Any help regarding this would be appreciated.

https://my.geotab.com/sdk/#/urlRequests

Thanks,

Pradeep.

Pradeep VR

Please sign in to leave a comment.

16 comments

0
Avatar

Pradeep,

The page you are referring to talks about links to the MyGeotab UI and how you could leverage them within your website or application.

If you wish to retrieve the data then you should review the Concepts page as well as the Reference page.

Within the Concepts page you will find key information on how to use our API such as our Building Block approach as well as Multi-Call.

Within the Reference page you will find all the available methods and objects you can use.

Now specifically referring to your engine data requirement, you will need to pull that information from StatusData and joining those results with the results of Diagnostic and Device in order to get fully populated data.

Calls:

Get<StatusData> (look at GetFeed if it is not a once off request)
Get<Diagnostic>
Get<Device>

 

Mauricio Muniz 0 votes
0
Avatar

Hi Mauricio, thanks for the response. As mentioned by you I am firing below GET API

https://my116.geotab.com/apiv1/Get?typeName=Device&credentials={"database":"<connectdynamics>","userName":"<my_geotab_com_login_email>","password":"<my_geotab_com_login_password>"}

Below error response is received

{
  "error": {
    "errors": [
      {
        "message": "DbUnavailableException: Unknown Database: &lt;connectdynamics&gt;",
        "name": "DbUnavailableException"
      }
    ],
    "message": "Unknown Database: &lt;connectdynamics&gt;",
    "code": "EX0EDEF792",
    "name": "JSONRPCError"
  },
  "requestIndex": 0
}

If I remove "database" from request I get below error response

https://my116.geotab.com/apiv1/Get?typeName=Device&credentials={"userName":"<my_geotab_com_login_email>","password":"<my_geotab_com_login_password>"}

{
  "error": {
    "errors": [
      {
        "message": "Incorrect MyGeotab login credentials",
        "name": "InvalidUserException"
      }
    ],
    "message": "Incorrect MyGeotab login credentials",
    "code": "EXCC7AC01E",
    "name": "JSONRPCError"
  },
  "requestIndex": 0
}

 

Pradeep VR 0 votes
0
Avatar

Hi Mauricio, thanks a lot above API is working fine after removing < and >.

Pradeep VR 0 votes
0
Avatar

Hi Mauricio,

We are firing API to fetch engine status data but it is returning empty records, below are the details. Device is active and its running, so this API should return valid data. FaultData API is also returning same empty response.

https://my116.geotab.com/apiv1/GetFeed?typeName=StatusData&resultsLimit=10&credentials={"database":"Connectdynamics","userName":"<email_id>","password":"<password>"}

Response : {

 "result": {

    "data": [],

    "toVersion": "00000000000225bd"

 }

}

 

Thnaks.

Pradeep VR 0 votes
0
Avatar

Pradeep,

You are missing the fromVersion parameter, if you add that you will start getting results after the passed version number.

Mauricio Muniz 0 votes
0
Avatar

Hi Mauricio, thanks for the info. Can you tell us steps on how we can fetch this version number ?

Pradeep VR 0 votes
0
Avatar

Hey Pradeep,

The version will come as part of every response. In fact, your previous post has the latest version id: "00000000000225bd"

If you wanted to start from the very beginning you would use "0000000000000000"

Mauricio Muniz 0 votes
0
Avatar

Hi Mauricio,

We have an usecase to fetch gps points and engine ignition status at the same time. For this we are trying to execute multicall API, but the API is throwing DbUnavailableException. I get successful response if I fire these 2 APIs separately. Below are the details.

URL : https://my.geotab.com/apiv1/ExecuteMultiCall?calls=[{"method":"GetFeed","params":{"typeName":"StatusData","fromVersion":"0000000000000000","resultsLimit":10,"credentials":{"database":"Connectdynamics","userName":"valid_email@gmail.com","password":"valid_password"}}},{"method":"GetFeed","params":{"typeName":"LogRecord","fromVersion":"0000000000000000","resultsLimit":10,"credentials":{"database":"Connectdynamics","userName":"valid_email@gmail.com","password":"valid_password"}}}]

Response :

{"error":{"errors":[{"message":"DbUnavailableException: Unknown Database: Connectdynamics","name":"DbUnavailableException","stackTrace":"   at Geotab.Checkmate.Web.WebMethodsDataStoreCache.GetDataStore(Credentials credentials, Boolean isNewSession, Boolean loginProvidedDbName, Boolean allowMyAdminVerify, Func`2 getDatabaseCollection, UIConfiguration& uiConfiguration) in C:\\BuildServer\\Code\\release\\Checkmate\\CheckmateServer\\Geotab\\Checkmate\\Web\\WebMethodsDataStoreCache.cs:line 146\r\n   at Geotab.Checkmate.Web.APIV1.ProcessRequest(IHttpRequest httpRequest, HttpResponse httpResponse, String& methodName, JObject parameters, Action`3 parametersJSONToTokens, IProfiler profile, Credentials credentials, Int32 requestIndex, Object requestJsonOrHashMap, Boolean& isAsync) in C:\\BuildServer\\Code\\release\\Checkmate\\CheckmateServer\\Geotab\\Checkmate\\Web\\APIV1.cs:line 512\r\n   at Geotab.Checkmate.Web.APIV1.ExecuteMultiCall(IHttpRequest httpRequest, HttpResponse httpResponse, JArray calls, Credentials credentials, IProfiler profiler) in C:\\BuildServer\\Code\\release\\Checkmate\\CheckmateServer\\Geotab\\Checkmate\\Web\\APIV1.cs:line 238\r\n   at Geotab.Checkmate.Web.APIV1.ProcessRequest(IHttpRequest httpRequest, HttpResponse httpResponse, String& methodName, JObject parameters, Action`3 parametersJSONToTokens, IProfiler profile, Credentials credentials, Int32 requestIndex, Object requestJsonOrHashMap, Boolean& isAsync) in C:\\BuildServer\\Code\\release\\Checkmate\\CheckmateServer\\Geotab\\Checkmate\\Web\\APIV1.cs:line 437\r\n   at Geotab.Checkmate.Web.APIV1.<>c__DisplayClass15_1.
<ProcessApiRequest>b__1() in C:\\BuildServer\\Code\\release\\Checkmate\\CheckmateServer\\Geotab\\Checkmate\\Web\\APIV1.cs:line 127\r\n   at Geotab.Checkmate.Web.APIV1Base.ExecuteHandleException(Action action) in C:\\BuildServer\\Code\\release\\Checkmate\\CheckmateServer\\Geotab\\Checkmate\\Web\\APIV1Base.cs:line 531"},{"message":"Unknown Database: Connectdynamics","name":"Exception"}],"message":"Unknown Database: Connectdynamics","name":"JSONRPCError"},"requestIndex":0}

Pradeep VR 0 votes
0
Avatar

Hi Maurico, can you kindly respond to this ? This has become a blocker for us to work on our next tasks.

Pradeep VR 0 votes
0
Avatar

Hi Mauricio, thanks for the response. Any other APIs that are not supported in multicall ?

Pradeep VR 0 votes
0
Avatar

Hey Pradeep,

The Multi-Call was created in principal for all the Get methods, with the exception of GetFeed.

You could also use Add, Remove, Set within a Multi-Call however if one of the API calls fail then you will get an error back. The biggest issue with this is that every call prior to the failed one will have executed and you currently will not know which call failed.

Mauricio Muniz 0 votes
0
Avatar

Hi Mauricio, thanks for the response. One more clarification needed, how do we get if engine is on/off from StatusData API ?

Pradeep VR 0 votes
0
Avatar

Pradeep,

That would be with the DiagnosticIgnitionId records within StatusData, you would just need to know the last state of that record 0 or 1.

Mauricio Muniz 0 votes