Road Segment
The road segment resource.
Base/roadSegment
GET
/roadSegmentList road segments
Retrieve a paginated list of road segments. Filter, order, and select columns with PostgREST query parameters.
Query parameters
selectstringComma-separated columns to return. Defaults to all.
orderstringColumn to sort by, e.g. `createdAt.desc`.
limitintegerMaximum rows to return.
offsetintegerRows to skip, for pagination.
GET/roadSegment
curl --request GET \
--url '<your-host>/roadSegment?select=*&limit=10' \
--header 'Authorization: Bearer <api-key>'Response
[
{
"id": "abc123def456",
"companyId": "xyz789",
"readableId": "xyz789",
"fromNode": "string",
"toNode": "string",
"name": "Example",
"distanceMiles": 0,
"driveSeconds": 0
}
]GET
/roadSegmentRetrieve a road segment
Fetch a single road segment by filtering on `id`.
Query parameters
idstringMatch on the road segment's `id`, e.g. `eq.{id}`.
GET/roadSegment
curl --request GET \
--url '<your-host>/roadSegment?id=eq.%7Bid%7D' \
--header 'Authorization: Bearer <api-key>'Response
{
"id": "abc123def456",
"companyId": "xyz789",
"readableId": "xyz789",
"fromNode": "string",
"toNode": "string",
"name": "Example",
"distanceMiles": 0,
"driveSeconds": 0
}POST
/roadSegmentCreate a road segment
Create a new road segment.
Body parameters
readableIdstringrequiredfromNodestringrequiredtoNodestringrequirednamestringdistanceMilesnumberrequireddriveSecondsnumberrequiredhazmatAllowedbooleanrequiredgeometryobjectPOST/roadSegment
curl --request POST \
--url <your-host>/roadSegment \
--header 'Authorization: Bearer <api-key>' \
--header 'Content-Type: application/json' \
--header 'Prefer: return=representation' \
--data '{"readableId":"xyz789","fromNode":"string","toNode":"string","name":"Example","distanceMiles":0,"driveSeconds":0,"hazmatAllowed":true}'Response
{
"id": "abc123def456",
"companyId": "xyz789",
"readableId": "xyz789",
"fromNode": "string",
"toNode": "string",
"name": "Example",
"distanceMiles": 0,
"driveSeconds": 0
}PATCH
/roadSegmentUpdate a road segment
Update an existing road segment, matched on `id`.
Body parameters
readableIdstringrequiredfromNodestringrequiredtoNodestringrequirednamestringdistanceMilesnumberrequireddriveSecondsnumberrequiredhazmatAllowedbooleanrequiredgeometryobjectPATCH/roadSegment
curl --request PATCH \
--url '<your-host>/roadSegment?id=eq.%7Bid%7D' \
--header 'Authorization: Bearer <api-key>' \
--header 'Content-Type: application/json' \
--header 'Prefer: return=representation' \
--data '{"readableId":"xyz789"}'Response
{
"id": "abc123def456",
"companyId": "xyz789",
"readableId": "xyz789",
"fromNode": "string",
"toNode": "string",
"name": "Example",
"distanceMiles": 0,
"driveSeconds": 0
}DELETE
/roadSegmentDelete a road segment
Delete a road segment, matched on `id`. Returns 204 No Content.
Query parameters
idstringThe `id` of the road segment to delete, e.g. `eq.{id}`.
DELETE/roadSegment
curl --request DELETE \
--url '<your-host>/roadSegment?id=eq.%7Bid%7D' \
--header 'Authorization: Bearer <api-key>'204 No Content