JavaScript examples
The following examples show common usages of the SDK using JavaScript. We recommend that you examine the examples in the following order to learn more about build great web applications using the Geotab JavaScript API. These examples are stand-alone HTML, JavaScript and CSS written so you can extract them and “run” them without having your own Web server.
You can also use the Runner option on the left to see some code snippets that you can run directly against a database.
Click here to download the examples ZIP file and extract the contents to your local drive.
Demonstrates how to add Drivers and Zones (geofences) to the system.
How to use the GetFeed method and retrieve a continuous stream of GPS, Engine Status and Fault data. This is the most efficient and recommended way of getting a copy of this data.
Shows how to display a vehicle's odometer readings over time.
This example demonstrates how to retrieve the number of vehicles and users in your account. This does not use API.js; it has been designed to show you a simple integration example.
This examples shows how to obtain the location of a vehicle.
Tools that demonstrate how to bulk import different entity types into MyGeotab via comma-delimited text values.
Shows how to move an existing zone to a new address using reverse geocoding.
This example illustrates how to poll the system for new text messages to and from compatible GO devices equipped with Garmin navigation systems.
This example demonstrates how to send text messages to compatible GO devices equipped with Garmin navigation systems.
Building upon the showVehicleToday.html example, this demonstrates some of the features of MyGeotab. You will learn how to retrieve vehicles and their trips for any date and show the trips on a map.
Shows the current location of a vehicle on a map. This is a great starting point if you want to see a complete example of how to use the API for real-world applications.
This example demonstrates how you can embed MyGeotab functionality into your own web applications. This is an excellent way to see how to embed your own vehicles on a map inside your projects.
This is where we recommend you begin your projects. Use the starter kit to learn how to authenticate with Geotab and how to create simple API calls to retrieve information about your fleet. This example can be used as a base to continue building on or starting your own custom projects.
Shows how to retrieve the engine status data for a vehicle.
This example illustrates how to create a custom registration page. With this example, you will be able to: determine if a database name is available; register a new database; perform post-registration setup on the new database; send a confirmation email; and redirect a user to the new database. This is an advanced example and is designed for resellers.