Skip to content

Commit

Permalink
add alerts
Browse files Browse the repository at this point in the history
Add alerts documentation. Add Customer Sites summary. Updates to others.
  • Loading branch information
pendenga committed May 29, 2024
1 parent 1a1184e commit 6ab6115
Show file tree
Hide file tree
Showing 5 changed files with 162 additions and 14 deletions.
34 changes: 30 additions & 4 deletions alert/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,36 @@ For example, the`Ignition` alert will notify users when a vehicle starts or stop
The two endpoints for the ignition alert are `createIgnition` and `updateIgnition`.
Here is a partial list of the endpoints that are or will included in the API.
Check the endpoint documentation for current status of inclusion.
* **Ignition** alerts when a vehicle starts or stops
* **Stop/Idle** alerts when a vehicle stops or idles for a defined threshold in minutes
* **Speeding** alerts when a vehicle exceeds a static speed threshold (i.e. 85mph)
* **Posted** alerts when a vehicle exceeds a threshold above posted speed (i.e. 15mph over)


* **Acceleration** Alert when a vehicle violates the specified acceleration threshold
* **Asset Input** Alert when an asset's input changes status
* **Deceleration** Alert when a vehicle violates the specified deceleration threshold
* **Device Plugin** Alert when a driver hasn't plugged in their device after a threshold of being assigned to a vehicle
* **Diagnostic** Alert when a diagnostic threshold is reached
* **Driver Assign** Alert when a driver is assigned to a vehicle
* **Driver Login** Alert when a driver does not log in when starting a trip
* **DTC** Alert on Diagnostic Trouble Codes (supported devices only)
* **DVIR** Alert when a Driver Vehicle Inspection Report (DVIR) with Defects is received
* **DVIR Status** Alert when a vehicle is moving without a DVIR completed or marked unsafe
* **First Movement Reverse** Alert when the first device event movement is in reverse
* **Heartbeat** Alert when Garmin messages reach a specified queue depth
* **HOS** Alert when specified Hours of Service (HOS) limit is reached
* **HOS Driver Assign** Alert when a vehicle moves without HOS driver assigned
* **Idle Time** Alert when a vehicle idles more than the specified limit
* **Ignition** Alert when a vehicle turns on or off
* **Inputs** Alert when an input changes status
* **Jamming** Alert when a supported GPS device detects Radio or GPS Jamming
* **Landmark** Alert as soon as a vehicle enters or exits a landmark (geofence)
* **Odd-Hours** Alert on movement within an odd-hours violation window
* **Out-Of-Range** Alert on vehicles that have not reported for a time
* **Posted Speed** Alert on vehicles violating posted speed limits (i.e. 15mph over)
* **Seat Belt Use** Alert when a vehicle exceeds the speed threshold while the seat belt is unbuckled
* **Service Reminder** Alert when scheduled service is close or overdue
* **Speeding** Alert when a vehicle violates the specified speed limit (i.e. 85mph)
* **Stop/Idle** Alert on a stop or idle longer than a specified duration
* **Switch** Alert on device switches (supported devices) (i.e. Panic Switch, Power Cycle)PTO, Boom engaged, etc.)
* **Towing** Alert when vehicle moves when ignition is off

### Parameter Help
Let's look at parameters in logical groups, according to function,
Expand Down
18 changes: 14 additions & 4 deletions alert/availableAlerts.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,25 @@ https://api.gpsinsight.com/v2/alert/availableAlerts?session_token=xxxx
Example Response:

{
head: { .... },
data: [
"head": { ... },
"data": {
"accel": {
"label": "Accel Alert",
"desc": "Alert when a vehicle violates the specified accel threshold."
},
"assetin": {
"label": "Asset Inputs Alert",
"desc": "Alert when an asset's input changes status."
}
]
},
"decel": {
"label": "Decel Alert",
"desc": "Alert when a vehicle violates the specified decel threshold."
},
"diagnostic": {
"label": "Diagnostic Alert",
"desc": "Alert when a diagnostic threshold is reached.",
"acc_id": "diagnos"
},
{ ... }
}
}
3 changes: 3 additions & 0 deletions alert/delete.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
This will permanently delete the alert. If you wish to temporarily disable an alert instead,
use the corresponding update method for the alert and set the `active` parameter to `0`.

Example Request:

https://api.gpsinsight.com/v2/alert/delete?session_token=xxxx&alert_id=19761
Expand Down
46 changes: 46 additions & 0 deletions customersite/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
The `CustomerSite` API is a collection of endpoints that allow you to manage your Customer Sites.
A Customer Site is a public map showing the current location of one or more of your vehicles,
which you link to or embed in your own website, that does not require authentication to view.

With Customer Sites, you can share the location of specific vehicles with customers right from your website.
For example, a trolley company may want to show the current location of their trolleys on their website.
The trolley company can create a Customer Site for each trolley, or all of them, and then embed the map on their website.

### Adding Vehicles
Once you have created a Customer Site, you can add vehicles to it by vehicle group. On the portal or through the API,
create a vehicle group and assign the vehicles you want to share to that group.
Then, use the `addVehicle` endpoint to add the vehicle group to the Customer Site.

### Map Link and Options
To view your Customer Sites map, use this URL pattern with your Customer Sites ID as the `key` parameter:

```https://portal.gpsinsight.com/d/publicmap.php?key=gpsi0000000000000&follow=true```

The following are map options you can use by appending them to the URL as query parameters, such as `&follow=true` in the example above:

* **Follow** - Re-center the map on all shown vehicles as the map refreshes (example: `&follow=true`)
* **Landmark Alert** - Show an extra alert when vehicles enter or exit landmarks (example: `&alertlandmarks=true`)
* **Show Trails** - Hide the historical trail of the vehicle(s) on the map (example: `&showTrails=true`)
* **Trail Option** - Hide the option in the vehicle list to choose a different length trail (example: `&trailsoption=false`)
* **Trail Duration** - Specify the number of minutes of trail to show on the map. Use `-1` for 1 day. (example: `&trail_minutes=90`)
* **Static Map** - Disable zooming and panning on the map, so the user can't move the map. (example: `static=true`)
This option requires a landmark group. A static map will lock to the selected landmark group. A use case for this is to see vehicles passing in and out of a work site (a landmark).

You can link directly to this URL for a full-screen view of the map, use that same link in an iFrame on your website,

### Embedding the Map
Alternately, you can use embed code pattern, with your Customer Sites ID as the `data-key` parameter, to embed the map right into your HTML.

```html
<!doctype html>
<div data-api-host="api.gpsinsight.com" data-trail-minutes="60" data-list-closed="false" data-trails="false" data-url-base="https://portal.gpsinsight.com" data-key="gpsi0000000000000" style="width:800px;height:600px;" id="cust-site-map-canvas" data-google-api-key=""></div>
<img src="https://portal.gpsinsight.com/common/images/map/loader.png" onload="var custSiteScript = document.createElement('script'); var custSiteNoCache = (new Date()).getTime(); custSiteScript.src = 'https://portal.gpsinsight.com/common/js/user/customersites.js?v=' + custSiteNoCache; document.body.appendChild(custSiteScript)" id="cust-site-script-img">
```

The following are map options you can use by adding key/value pairs to the embed code, such as `data-trails="false"` in the example above:

* **Follow** - Follow the vehicle(s) on the map (example: `data-follow="true"`)
* **Show Trails** - Show the trail of the vehicle(s) on the map (example: `data-trails="true"`)
* **Trail Duration** - Specify the number of minutes of trail to show on the map. Use `-1` for 1 day. (example: `data-trail-minutes=90`)
* **Hide Vehicle List** - Hide the vehicle list on the map (example: `data-list-closed=true`)
* **Show Address Bar** - Show the address bar in the map's browser window (example: `data-address-box`)
75 changes: 69 additions & 6 deletions vehicle/list.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,80 @@
Example Request:
NOTE: Excluding the `vehicle` paramter will return all vehicles in the account.

Example Request (no detail):

https://api.gpsinsight.com/v2/vehicle/list?session_token=xxxx

Example Response:
Example Response (no detail):

{
"head": { .... },
"data": [
{
"id": "CA454204XXXX",
"vin": "1G1JC52462745XXXX",
"label": "Truck 130",
"serial_number": 454204XXXX
}, { ... }
]
}

Example Request (all details):

https://api.gpsinsight.com/v2/vehicle/list?session_token=xxxx&details=1

Example Response (all details):

{
head: { .... },
data: [
{
"id": "CA4572257709",
"vin": "123456ABCD7890EFG",
"label": "2279-02",
"serial_number": 4572257709,
"source": "CA",
"pnd": 4,
"report_interval": 120,
"runtime_base": 595.6,
"idle_gph": 0.31,
"install_dt": "2022-10-12 12:06:28",
"fuel_type": "U",
"country": "US",
"license_state": "AZ",
"license_number": "REA6BNA",
"color": "Silver",
"make": "Honda",
"model": "Accord",
"model_year": 2006,
"odometer": 184101,
"ref_id": "G-123",
"phone_number": "3857751945",
"email_address": "[email protected]",
"alert_email": 0,
"alert_sms": 0,
"alert_garmin": 0,
"alert_pref": 0
}, { ... }
]
}

Example Request (list detail columns):

https://api.gpsinsight.com/v2/vehicle/list?session_token=xxxx&details=license_state,license_number

Example Response (list detail columns):

{
head: { .... },
data: [
{
id: "CA454204XXXX",
vin: "1G1JC52462745XXXX",
label: "Truck 130",
serial_number: 454204XXXX
"id": "CA4572257709",
"vin": "123456ABCD7890EFG",
"label": "2279-02",
"serial_number": 4572257709,
"license_state": "AZ",
"license_number": "REA6BNA"
}, { ... }
]
}

0 comments on commit 6ab6115

Please sign in to comment.