Update location history by email & createdTime
curl --request PUT \
--url https://apiweb.mile.app/api/v3/location-history/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "[email protected]",
"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
}
'import requests
url = "https://apiweb.mile.app/api/v3/location-history/"
payload = {
"email": "[email protected]",
"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
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: '[email protected]',
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
})
};
fetch('https://apiweb.mile.app/api/v3/location-history/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apiweb.mile.app/api/v3/location-history/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'email' => '[email protected]',
'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
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apiweb.mile.app/api/v3/location-history/"
payload := strings.NewReader("{\n \"email\": \"[email protected]\",\n \"lat\": -6.934837011379089,\n \"lon\": 107.74135602107883,\n \"speed\": 102,\n \"createdTime\": \"2023-07-07 16:00:10\",\n \"distance\": 10,\n \"duration\": 1,\n \"createdFrom\": \"GPS\",\n \"data\": {\n \"temp\": 31\n },\n \"taskId\": \"\",\n \"time\": 1688720650331\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://apiweb.mile.app/api/v3/location-history/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"[email protected]\",\n \"lat\": -6.934837011379089,\n \"lon\": 107.74135602107883,\n \"speed\": 102,\n \"createdTime\": \"2023-07-07 16:00:10\",\n \"distance\": 10,\n \"duration\": 1,\n \"createdFrom\": \"GPS\",\n \"data\": {\n \"temp\": 31\n },\n \"taskId\": \"\",\n \"time\": 1688720650331\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v3/location-history/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"[email protected]\",\n \"lat\": -6.934837011379089,\n \"lon\": 107.74135602107883,\n \"speed\": 102,\n \"createdTime\": \"2023-07-07 16:00:10\",\n \"distance\": 10,\n \"duration\": 1,\n \"createdFrom\": \"GPS\",\n \"data\": {\n \"temp\": 31\n },\n \"taskId\": \"\",\n \"time\": 1688720650331\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Success",
"location_history": {
"email": "[email protected]",
"taskId": "634e98098ce69d29474a7e11",
"speed": 40,
"distance": 50,
"duration": 50,
"lat": -6.1771046,
"lon": 106.9240199,
"_id": "[email protected]_1675224349343",
"time": 1675224349343,
"organizationId": "634e98098ce07d29474a7e22",
"createdTime": "2022-10-07 03:00:58",
"updatedTime": "2022-10-07 04:00:58",
"data": {
"temperature": 31,
"anotherKey": "anotherValue"
}
}
}{
"status": false,
"message": "Bad request - invalid parameters provided."
}{
"status": false,
"message": "Data not found"
}{
"status": false,
"message": "Internal server error, please contact [email protected]."
}Location History
Update location history by email & createdTime
PUT
/
location-history
/
Update location history by email & createdTime
curl --request PUT \
--url https://apiweb.mile.app/api/v3/location-history/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "[email protected]",
"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
}
'import requests
url = "https://apiweb.mile.app/api/v3/location-history/"
payload = {
"email": "[email protected]",
"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
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: '[email protected]',
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
})
};
fetch('https://apiweb.mile.app/api/v3/location-history/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apiweb.mile.app/api/v3/location-history/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'email' => '[email protected]',
'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
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apiweb.mile.app/api/v3/location-history/"
payload := strings.NewReader("{\n \"email\": \"[email protected]\",\n \"lat\": -6.934837011379089,\n \"lon\": 107.74135602107883,\n \"speed\": 102,\n \"createdTime\": \"2023-07-07 16:00:10\",\n \"distance\": 10,\n \"duration\": 1,\n \"createdFrom\": \"GPS\",\n \"data\": {\n \"temp\": 31\n },\n \"taskId\": \"\",\n \"time\": 1688720650331\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://apiweb.mile.app/api/v3/location-history/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"[email protected]\",\n \"lat\": -6.934837011379089,\n \"lon\": 107.74135602107883,\n \"speed\": 102,\n \"createdTime\": \"2023-07-07 16:00:10\",\n \"distance\": 10,\n \"duration\": 1,\n \"createdFrom\": \"GPS\",\n \"data\": {\n \"temp\": 31\n },\n \"taskId\": \"\",\n \"time\": 1688720650331\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v3/location-history/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"[email protected]\",\n \"lat\": -6.934837011379089,\n \"lon\": 107.74135602107883,\n \"speed\": 102,\n \"createdTime\": \"2023-07-07 16:00:10\",\n \"distance\": 10,\n \"duration\": 1,\n \"createdFrom\": \"GPS\",\n \"data\": {\n \"temp\": 31\n },\n \"taskId\": \"\",\n \"time\": 1688720650331\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Success",
"location_history": {
"email": "[email protected]",
"taskId": "634e98098ce69d29474a7e11",
"speed": 40,
"distance": 50,
"duration": 50,
"lat": -6.1771046,
"lon": 106.9240199,
"_id": "[email protected]_1675224349343",
"time": 1675224349343,
"organizationId": "634e98098ce07d29474a7e22",
"createdTime": "2022-10-07 03:00:58",
"updatedTime": "2022-10-07 04:00:58",
"data": {
"temperature": 31,
"anotherKey": "anotherValue"
}
}
}{
"status": false,
"message": "Bad request - invalid parameters provided."
}{
"status": false,
"message": "Data not found"
}{
"status": false,
"message": "Internal server error, please contact [email protected]."
}Body
application/json
Required, User's email assigned to the monitored task. Example: [email protected]
This is a free object that you can fill with any data in object format. Use it to store dynamic information that is not covered by the standard fields, such as fuel level or vehicle temperature. Any key you send is stored as-is and returned in the location history response. Example: {'temp': 31}