Get the drive details of a vehicle/user in an InTouch account using the below method. A drive is a list of reported geo-positions with the start and end location of a vehicle according to pre-defined conditions. Time duration, distance covered during the drive, HA, HB, HC events are also returned along with the drive details.
// IDrivesListener - returns drives as response if success else returns error.
InTouch.getDrive(<deviceId>, <startTime>, <endTime>, new IDrivesListener() {
@Override
public void onSuccess(IntouchDriveResponse intouchDriveResponse) {
// write your code here.
}
@Override
public void onError(String reason, String errorIdentifier, String errorDescription) {
// reason gives the error type.
// errorIdentifier gives information about error code.
// errorDescription gives a message for a particular error.
}
});
// IDrivesListener - returns drives as response if success else returns error.
InTouch.getDrive(<deviceId>, <startTime>, <endTime>, object: IDrivesListener{
override fun onSuccess(t: IntouchDriveResponse?) {
// write your code here.
}
override fun onError(reason: String?, errorIdentifier: String?, errorDescription: String?) {
// reason gives the error type.
// errorIdentifier gives information about error code.
// error description gives a message for a particular error.
}
})
1.deviceId(Long)
- Id of the device for which the drives need to be fetched.
-
startTime(Long)
- The start Epoch timestamp in seconds from which the drives need to be fetched. -
endTime(Long)
- The end Epoch timestamp in seconds till which the drives need to be fetched.
- 200: To denote a successful API call.
- 400: Bad Request, User made an error while creating a valid request.
- 401: Unauthorized, the developer’s key is not allowed to send a request with restricted parameters.
- 403: Forbidden, the developer’s key has hit its daily/hourly limit.
- 500: Internal Server Error, the request caused an error in our systems.
- 503: Service Unavailable, during our maintenance break or server downtimes.
- 200: Success
- 203: Device Not Found
- 400: Bad Request - Invalid device ID supplied or invalid data type. For example, the input attribute "id" is an integer but string value gets passed.
- 401: Unauthorized Request. Access to API is forbidden.
- 404: Not Found - URL Not Found
DriveResponse
Class object returns the API response as a JSON object.
deviceId (Long)
- Device id of selected device.drivingBehaviourCount (DrivingBehaviourCount)
- Driving behavior count in the selected drive.movement(Movement)
- Movement info object.location (Location)
- Location info object.
duration (Long)
- Drive duration in seconds.distance (Long)
- The driving distance in KMs.idleTime (Long)
-Idle time in seconds.movementTime (Long)
- Movement time in seconds.stoppageTime (Long)
- Stoppage time in seconds.
haCount (Integer)
- Harsh acceleration count.hbCount (Integer)
- Harsh braking count.hcCount (Integer)
- Harsh cornering count.
startAddress(String)
- Start address of particular drive.startTimestamp(Long)
- Start Epoch time of particular drive.endAddress(String)
- End address of particular drive.endTimestamp(Long)
- Start Epoch time of particular drive.avgSpeed(Double)
- Speed in km/hr.
For any queries and support, please contact:
Email us at apisupport@mappls.com
Need support? contact us!