Trips and Drive

This API is used to request the trip details of a vehicle in an account on our telematics platform. A vehicle can be a device/sensor connected to our telematics platform directly or via a third party data aggregator who utilises our telematics platform for tracking services. A trip or a drive is a list of reported geo-positions of any object (such as vehicles, assets or people) according to pre-defined conditions.

Input:

  • License_key:the REST API license key allocated to you. This is part of URL structure.
  • deviceId: It’s an optional parameter, if drives specific to any particular device needs to be checked. Multiple comma separated entries can also be provided.
  • startTime : startTime needs to be fed as epoch timestamp according to the user choice.If not specified, automatically epoch timestamp of 24 hours before the endTime is taken into consideration. It's a required parameter.
  • endTime: endTime needs to be fed as epoch timestamp according to the user choice.If not specified, automatically current epoch timestamp is taken as input. It's a required parameter.

Note: maximum Duration will be 15 days

Output:
  • id: MapmyIndia Drive ID
  • deviceid
  • startlat
  • startlon
  • startaddress
  • starttimestamp
  • movementtime : In Minutes
  • idletime : In Minutes
  • endlat
  • endlon
  • endaddress
  • endtimestamp
  • maxspeed
  • maxspeedTimestamp
  • avgspeed
  • duration : In minutes
  • distance :In km
  • haCount
  • hbCount
  • hcCount

Example URL Response:
https://apis.mapmyindia.com/intouch/v1/<licence_key>/getDrives?startTime=1476077502&endTime=1476336702&deviceId=

{  "drives": {  "281": [  {  "id": "5819c9a90ac4396f5adb84df",  "deviceId": 281,  "startLat": 28.6862,  "startLon": 77.2039,  "startAddressId": null,  "startAddress": "7, Block D, Maurice Nagar, New Delhi, Delhi. 83 m from Dr JL Jain pin110007",  "startTimestamp": 1478079754,  "endLat": 28.6862,  "endLon": 77.2039,  "endAddress": "7, Block D, Maurice Nagar, New Delhi, Delhi. 83 m from Dr JL Jain pin110007",  "endAddressId": null,  "endTimestamp": 1478084055,  "maxSpeed": 0,  "maxSpeedTimestamp": 0,  "avgSpeed": 0,  "duration": 4301,  "distance": 0,  "haCount": 0,  "hbCount": 0,  "hcCount": 0,  "movementTime": 0,  "idleTime": 3021  },  {  "id": "5819b6c40ac4396f5adb2dc6",  "deviceId": 281,  "startLat": 28.6826,  "startLon": 77.1999,  "startAddressId": null,  "startAddress": "2, Satyawati Marg, Block 2, Roop Nagar, New Delhi, Delhi. 15 m from Satywati Ayurvedic Clinic & Pharmacy pin-110007",  "startTimestamp": 1478079279,  "endLat": 28.6862,  "endLon": 77.2039,  "endAddress": "7, Block D, Maurice Nagar, New Delhi, Delhi. 83 m from Dr JL Jain pin110007",  "endAddressId": null,  "endTimestamp": 1478079548,  "maxSpeed": 38,  "maxSpeedTimestamp": 1478079307,  "avgSpeed": 37.39531848057509,  "duration": 269,  "distance": 1.1114719659504264,  "haCount": 0,  "hbCount": 0,  "hcCount": 0,  "movementTime": 107,  "idleTime": 152  },  {  "id": "5819b3b60ac4396f5adb2497",  "deviceId": 281,  "startLat": 28.6862,  "startLon": 77.2039,  "startAddressId": null,  "startAddress": "7, Block D, Maurice Nagar, New Delhi, Delhi. 83 m from Dr JL Jain pin110007",  "startTimestamp": 1478077495,  "endLat": 28.6826,  "endLon": 77.1999,  "endAddress": "2, Satyawati Marg, Block 2, Roop Nagar, New Delhi, Delhi. 15 m from Satywati Ayurvedic Clinic & Pharmacy pin-110007",  "endAddressId": null,  "endTimestamp": 1478078760,  "maxSpeed": 44,  "maxSpeedTimestamp": 1478078149,  "avgSpeed": 26.779147946756122,  "duration": 1265,  "distance": 2.1869637489850833,  "haCount": 0,  "hbCount": 0,  "hcCount": 0,  "movementTime": 294,  "idleTime": 621  },  {  "id": "5819ab6a0ac4396f5adb0101",  "deviceId": 281,  "startLat": 28.6862,  "startLon": 77.2039,  "startAddressId": null,  "startAddress": "7, Block D, Maurice Nagar, New Delhi, Delhi. 83 m from Dr JL Jain pin110007",  "startTimestamp": 1478069895,  "endLat": 28.6862,  "endLon": 77.2039,  "endAddress": "7, Block D, Maurice Nagar, New Delhi, Delhi. 83 m from Dr JL Jain pin110007",  "endAddressId": null,  "endTimestamp": 1478076195,  "maxSpeed": 0,  "maxSpeedTimestamp": 0,  "avgSpeed": 0,  "duration": 6300,  "distance": 0,  "haCount": 0,  "hbCount": 0,  "hcCount": 0,  "movementTime": 0,  "idleTime": 3600  },  {  "id": "581992fa0ac4396f5adaa106",  "deviceId": 281,  "startLat": 28.6189,  "startLon": 77.2891,  "startAddressId": null,  "startAddress": "Indraprastha Extension, New Delhi, Delhi. 14 m from Aditi Apartment pin110092",  "startTimestamp": 1478066270,  "endLat": 28.6862,  "endLon": 77.2039,  "endAddress": "7, Block D, Maurice Nagar, New Delhi, Delhi. 83 m from Dr JL Jain pin110007",  "endAddressId": null,  "endTimestamp": 1478069542,  "maxSpeed": 44,  "maxSpeedTimestamp": 1478066801,  "avgSpeed": 94.40188712596607,  "duration": 3272,  "distance": 14.291396801014308,  "haCount": 0,  "hbCount": 0,  "hcCount": 0,  "movementTime": 545,  "idleTime": 2727  },  {  "id": "5819847f0ac4396f5ada5617",  "deviceId": 281,  "startLat": 28.6189,  "startLon": 77.2891,  "startAddressId": null,  "startAddress": "Indraprastha Extension, New Delhi, Delhi. 14 m from Aditi Apartment pin110092",  "startTimestamp": 1478065292,  "endLat": 28.6189,  "endLon": 77.2891,  "endAddress": "Indraprastha Extension, New Delhi, Delhi. 14 m from Aditi Apartment pin110092",  "endAddressId": null,  "endTimestamp": 1478065385,  "maxSpeed": 0,  "maxSpeedTimestamp": 0,  "avgSpeed": 0,  "duration": 93,  "distance": 0,  "haCount": 0,  "hbCount": 0,  "hcCount": 0,  "movementTime": 0,  "idleTime": 0  },  {  "id": "581975020ac4396f5ada0d71",  "deviceId": 281,  "startLat": 28.6189,  "startLon": 77.2891,  "startAddressId": null,  "startAddress": "Indraprastha Extension, New Delhi, Delhi. 14 m from Aditi Apartment pin110092",  "startTimestamp": 1478061089,  "endLat": 28.6189,  "endLon": 77.2891,  "endAddress": "Indraprastha Extension, New Delhi, Delhi. 14 m from Aditi Apartment pin110092",  "endAddressId": null,  "endTimestamp": 1478061770,  "maxSpeed": 0,  "maxSpeedTimestamp": 0,  "avgSpeed": 0,  "duration": 681,  "distance": 0,  "haCount": 0,  "hbCount": 0,  "hcCount": 0,  "movementTime": 0,  "idleTime": 681  }  ]  },  "message": "success",  "status": 200  }