Skip to main content
PUT
/
location-history
/
{loc_history_id}
Update location history by ID
curl --request PUT \
  --url https://apiweb.mile.app/api/v3/location-history/{loc_history_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "email": "example@mile.app",
  "lat": -6.934837011379089,
  "lon": 107.74135602107883,
  "speed": 102,
  "createdTime": "2023-07-07 16:00:10",
  "distance": 10,
  "duration": 1,
  "createdFrom": "GPS",
  "data": {
    "temp": 31
  },
  "taskId": "",
  "time": 1688720650331
}
'
{
  "status": true,
  "message": "Data has been updated successfully.",
  "location_history": {
    "email": "example@mile.app",
    "taskId": "634e98098ce69d29474a7e11",
    "speed": 40,
    "distance": 50,
    "duration": 50,
    "lat": -6.1771046,
    "lon": 106.9240199,
    "_id": "634e98098ce07d29474a7e22_example@mile.app_1675224349343",
    "time": 1675224349343,
    "organizationId": "634e98098ce07d29474a7e22",
    "createdTime": "2022-10-07 03:00:58",
    "updatedTime": "2022-10-07 04:00:58"
  }
}

Authorizations

Authorization
string
header
required

Use a valid Bearer token to authenticate.

Body

application/json
email
string
required

Required, User's email assigned to the monitored task. Example: example@mile.app

lat
string
required

Required, Latitude coordinate position. Example: -6.934837011379089

lon
string
required

Required, Longitude coordinate position. Example: 107.74135602107883

taskId
string

Unique ID to identify the task. Example: 634e98098ce69d29474a7e11

speed
integer

Vehicle speed in kilometers per hour. Example: 102

distance
integer

Distance traveled from the previous location. Example: 10

duration
integer

Time duration spent at this location in milliseconds. Example: 1

createdFrom
string

Source identifier for the location history entry. System-generated entries default to mileAppField, override this value when integrating a custom device or external source.
Example: GPS
Default: mileAppField

Response

Success

status
boolean

Indicates whether the request was successful.

code
integer

HTTP status code.

message
string

A message providing additional information about the response.

location_history
object