Patch Milestone
curl --request PATCH \
--url https://api.pathstack.io/milestone/{milestone_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"device_id": "<string>",
"start_point": {
"latitude": 0,
"longitude": 0
},
"end_point": {
"latitude": 0,
"longitude": 0
},
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z",
"webhook_url": "<string>",
"webhook_enabled": true
}
'import requests
url = "https://api.pathstack.io/milestone/{milestone_id}"
payload = {
"device_id": "<string>",
"start_point": {
"latitude": 0,
"longitude": 0
},
"end_point": {
"latitude": 0,
"longitude": 0
},
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z",
"webhook_url": "<string>",
"webhook_enabled": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
device_id: '<string>',
start_point: {latitude: 0, longitude: 0},
end_point: {latitude: 0, longitude: 0},
start_time: '2023-11-07T05:31:56Z',
end_time: '2023-11-07T05:31:56Z',
webhook_url: '<string>',
webhook_enabled: true
})
};
fetch('https://api.pathstack.io/milestone/{milestone_id}', 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://api.pathstack.io/milestone/{milestone_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'device_id' => '<string>',
'start_point' => [
'latitude' => 0,
'longitude' => 0
],
'end_point' => [
'latitude' => 0,
'longitude' => 0
],
'start_time' => '2023-11-07T05:31:56Z',
'end_time' => '2023-11-07T05:31:56Z',
'webhook_url' => '<string>',
'webhook_enabled' => true
]),
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://api.pathstack.io/milestone/{milestone_id}"
payload := strings.NewReader("{\n \"device_id\": \"<string>\",\n \"start_point\": {\n \"latitude\": 0,\n \"longitude\": 0\n },\n \"end_point\": {\n \"latitude\": 0,\n \"longitude\": 0\n },\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"webhook_url\": \"<string>\",\n \"webhook_enabled\": true\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.pathstack.io/milestone/{milestone_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"device_id\": \"<string>\",\n \"start_point\": {\n \"latitude\": 0,\n \"longitude\": 0\n },\n \"end_point\": {\n \"latitude\": 0,\n \"longitude\": 0\n },\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"webhook_url\": \"<string>\",\n \"webhook_enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pathstack.io/milestone/{milestone_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"device_id\": \"<string>\",\n \"start_point\": {\n \"latitude\": 0,\n \"longitude\": 0\n },\n \"end_point\": {\n \"latitude\": 0,\n \"longitude\": 0\n },\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"webhook_url\": \"<string>\",\n \"webhook_enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"device_id": "<string>",
"start_point": {
"latitude": 0,
"longitude": 0
},
"end_point": {
"latitude": 0,
"longitude": 0
},
"start_time": "<string>",
"end_time": "<string>",
"id": "<string>",
"tenant_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"status": "trip_not_started",
"webhook_url": "<string>",
"webhook_error_count": 0,
"last_webhook_error": "<string>",
"last_webhook_error_at": "<string>",
"webhook_enabled": true
}
}{
"error": {
"code": 400,
"message": "Invalid JWT format"
}
}{
"error": {
"code": 401,
"message": "Authentication header is missing, or token is invalid/expired."
}
}{
"error": {
"code": 403,
"message": "You do not have access to this resource"
}
}{
"error": {
"code": 404,
"message": "Unknown milestone id <uuid>"
}
}{
"error": {
"code": 422,
"message": "Field required",
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
}Milestones
Patch Milestone
Modifies an existing milestone.
PATCH
/
milestone
/
{milestone_id}
Patch Milestone
curl --request PATCH \
--url https://api.pathstack.io/milestone/{milestone_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"device_id": "<string>",
"start_point": {
"latitude": 0,
"longitude": 0
},
"end_point": {
"latitude": 0,
"longitude": 0
},
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z",
"webhook_url": "<string>",
"webhook_enabled": true
}
'import requests
url = "https://api.pathstack.io/milestone/{milestone_id}"
payload = {
"device_id": "<string>",
"start_point": {
"latitude": 0,
"longitude": 0
},
"end_point": {
"latitude": 0,
"longitude": 0
},
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z",
"webhook_url": "<string>",
"webhook_enabled": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
device_id: '<string>',
start_point: {latitude: 0, longitude: 0},
end_point: {latitude: 0, longitude: 0},
start_time: '2023-11-07T05:31:56Z',
end_time: '2023-11-07T05:31:56Z',
webhook_url: '<string>',
webhook_enabled: true
})
};
fetch('https://api.pathstack.io/milestone/{milestone_id}', 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://api.pathstack.io/milestone/{milestone_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'device_id' => '<string>',
'start_point' => [
'latitude' => 0,
'longitude' => 0
],
'end_point' => [
'latitude' => 0,
'longitude' => 0
],
'start_time' => '2023-11-07T05:31:56Z',
'end_time' => '2023-11-07T05:31:56Z',
'webhook_url' => '<string>',
'webhook_enabled' => true
]),
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://api.pathstack.io/milestone/{milestone_id}"
payload := strings.NewReader("{\n \"device_id\": \"<string>\",\n \"start_point\": {\n \"latitude\": 0,\n \"longitude\": 0\n },\n \"end_point\": {\n \"latitude\": 0,\n \"longitude\": 0\n },\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"webhook_url\": \"<string>\",\n \"webhook_enabled\": true\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.pathstack.io/milestone/{milestone_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"device_id\": \"<string>\",\n \"start_point\": {\n \"latitude\": 0,\n \"longitude\": 0\n },\n \"end_point\": {\n \"latitude\": 0,\n \"longitude\": 0\n },\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"webhook_url\": \"<string>\",\n \"webhook_enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pathstack.io/milestone/{milestone_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"device_id\": \"<string>\",\n \"start_point\": {\n \"latitude\": 0,\n \"longitude\": 0\n },\n \"end_point\": {\n \"latitude\": 0,\n \"longitude\": 0\n },\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"webhook_url\": \"<string>\",\n \"webhook_enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"device_id": "<string>",
"start_point": {
"latitude": 0,
"longitude": 0
},
"end_point": {
"latitude": 0,
"longitude": 0
},
"start_time": "<string>",
"end_time": "<string>",
"id": "<string>",
"tenant_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"status": "trip_not_started",
"webhook_url": "<string>",
"webhook_error_count": 0,
"last_webhook_error": "<string>",
"last_webhook_error_at": "<string>",
"webhook_enabled": true
}
}{
"error": {
"code": 400,
"message": "Invalid JWT format"
}
}{
"error": {
"code": 401,
"message": "Authentication header is missing, or token is invalid/expired."
}
}{
"error": {
"code": 403,
"message": "You do not have access to this resource"
}
}{
"error": {
"code": 404,
"message": "Unknown milestone id <uuid>"
}
}{
"error": {
"code": 422,
"message": "Field required",
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Path Parameters
ID of the Milestone to be updated
Body
application/json
Details for Milestone Update
Available options:
trip_not_started, trip_in_progress, trip_ended Coordinate parses Latitude and Longitude.
You can use the Coordinate data type for storing coordinates. Coordinates can be
defined using one of the following formats:
- Tuple:
(Latitude, Longitude). For example:(41.40338, 2.17403)or(Decimal('41.40338'), Decimal('2.17403')). Coordinateinstance:Coordinate(latitude=Latitude, longitude=Longitude).
from decimal import Decimal
from pydantic import BaseModel
from pydantic_extra_types.coordinate import Coordinate
class Location(BaseModel):
coordinate: Coordinate
# Using float values
location1 = Location(coordinate=(41.40338, 2.17403))
# > coordinate=Coordinate(latitude=41.40338, longitude=2.17403)
# Using Decimal values
location2 = Location(coordinate=(Decimal('41.40338'), Decimal('2.17403')))
# > coordinate=Coordinate(latitude=41.40338, longitude=2.17403)
Show child attributes
Show child attributes
Coordinate parses Latitude and Longitude.
You can use the Coordinate data type for storing coordinates. Coordinates can be
defined using one of the following formats:
- Tuple:
(Latitude, Longitude). For example:(41.40338, 2.17403)or(Decimal('41.40338'), Decimal('2.17403')). Coordinateinstance:Coordinate(latitude=Latitude, longitude=Longitude).
from decimal import Decimal
from pydantic import BaseModel
from pydantic_extra_types.coordinate import Coordinate
class Location(BaseModel):
coordinate: Coordinate
# Using float values
location1 = Location(coordinate=(41.40338, 2.17403))
# > coordinate=Coordinate(latitude=41.40338, longitude=2.17403)
# Using Decimal values
location2 = Location(coordinate=(Decimal('41.40338'), Decimal('2.17403')))
# > coordinate=Coordinate(latitude=41.40338, longitude=2.17403)
Show child attributes
Show child attributes
Required string length:
1 - 2083Response
Successful Response
Successful response payload
Show child attributes
Show child attributes
⌘I

