Intro to the Geotab software development kit (SDK video)
DEV Channel SDK video - Steve Hansen provides step by step instructions on how to get started in the Geotab Software Development Kit.
By Geotab
March 8, 2023
•4 minute read
In this helpful DEV Channel SDK video, Steve Hansen (Geotab Software Developer) provides step-by-step instructions on using the Geotab Software Development Kit (SDK). Learn about the uses of the SDK, where to find it, how to get help, and see running examples. Visit https://my.geotab.com/sdk/ to learn more about the Geotab SDK.
Watch: SDK Video Introduction
Find more training videos at the Geotab DEV Channel.
SDK Introduction for Software Developers (Video Transcription)
Hi. My name is Steve Hansen. I'm a developer at Geotab. I'm going to take you on a tour of the MyGeotab SDK.
An SDK is a software development kit which helps people use a platform to extend some functionality. The MyGeotab SDK can be used to create:
- Apps for smartphones
- Integrate MyGeotab data with third-party software. This could be accounting software that bills a customer based on trip distance.
- MyGeotab Add-Ins. Add-Ins provide a way to add new functionality or value-adding features inside the MyGeotab application.
- Automate tasks such as bulk-importing devices, users or zones to MyGeotab from an Excel spreadsheet.
Getting started with the SDK is easy. Open up your favorite browser and navigate to: https://sdk.geotab.com
Now just click on the SDK button on this page. Here you will find everything you need to get started with the SDK.
The landing page is Getting Started. This provides some general information about the SDK and illustrates how to install a device, register a database, and make your first API call.
The Concepts section describes the fundamentals of the API. The API is JSON-RPC over HTTPS, using GET and POST requests. An advantage of being web-based is that the API is not tied to a programming language. It can be used by any language that supports HTTPS.
In the Concepts section, you'll find information on:
- How to make HTTPS GET requests
- HTTPS POST requests
- Results and errors you will receive back
- How to authenticate a user
- Working with dates
- Units of measure
- Entities
- ID
- Building block approach
- MultiCalls
This section is important when you first start. Read through here to get a basic understanding of how the API works and API-specific conventions.
The API reference is a list of all the methods and objects that are exposed via the API. Methods will display the required and optional parameters, and the expected data type for those parameters.
The search bar provides a convenient way to find what you're looking for. We're going to search for the GET method here.
A great feature of the SDK is the API runner. You can click Runner from any of the API methods.
Let's test this by searching for a device. I'm going to remove the search parameters form this query, add the type name device and click Run.
You'll see it's asking me for my credentials now. I'm going to add the server “my.geotab.com” and my database “G560” and my credentials and I'll click Run again.
There we go. There's my device. This is the JSON view of the device object that was returned, it's property, and the values of those properties. The runner authenticated our user against the database we specified and made a request to get one device object.
Let's head back to the SDK, to see what else is available to us.
The SDK provides API wrappers for JavaScript and .NET. This is basically a simple interface for authenticating and making a request to a database. .NET also provides an object library. This is convenient because when using an API wrapper, the JSON results will automatically be deserialized from JSON to .NET objects.
In the Code samples section you will find JavaScript examples, .NET examples, simple How to examples for common operations, such as showing the current location and driving status of all vehicles, adding a driver to the system, getting count of steps at a given client zone, and many more.
Let's try out one of the JavaScript examples.
From the JavaScript examples page, there's a link to “Click here to download.” You'll see we downloaded a JavaScript.zip file. Let's open it to see the examples. I'm going to create a folder on my desktop to extract the examples to. I'll call mine “js_examples.” LEt's extract the files there. Let's close off this window, and open the examples up here.
Now let's test out of the Import Devices example. I'll enter my credentials. This is the database that the devices will be imported to. Now, I’ll click Sign In. Now I’ll head over to my MyGeotab database and see no devices added. The gray box here gives an example of the structure for the data we want to enter:
SerialNumber,Name1,GroupName
Line break, another device, line break, next device.
For my example, I'll just enter the single device. I'll enter this serial number here (G6-CC-00-00-0B-C1), then a comma, the device name - I'll just say “Steve Device” and the Group name - I'll say my Group is “Canada.” Then I'll click import device. Great, looks like our device was imported successfully.
But what's this about "Check the browser console for details"?
I'm using Chrome here, so I'll open my developer tools by pushing F12. Oh, what's this? We can see some information was logged to the console. This is just more details about what happened. “Successfully Imported Steve Device.” That's my device name. Then the device ID that was returned.
Now I'll head back to my database to see if the device was added. Let me refresh the page. There we go. There's the device. You can see my Group is “Canada.”
This example used the API to authenticate our user, get Groups from our database, and add a new device to our database, all using the API.
Let's head back to the SDK.
If you ever get stuck and can't find the answer in the SDK, a great resource is the Developer Forum.
The forum is a great way to find answers to common questions and connect with other developers in the MyGeotab community.
Geotab monitors the forums and we do our best to make sure questions are answered quickly.
The forum can be reached by clicking this link in the SDK [Forums] or by navigating to geotab.com, click Support, and click Developer Forum.
This was a short introduction to the tools available to you in the SDK. I encourage you to explore the SDK in detail to see all the great tools and resources that are available to you.
Thanks for joining me for this short introduction to the MyGeotab SDK. See you next time.
You might also like:
Learning the MyGeotab SDK - What is an SDK and how is it used?
The Beginner’s Guide to APIs - 90% of enterprises are relying on APIs in their cloud integration plans -Forbes. Learn why you should use APIs.
5 Tips From a Geotab Software Developer on Building Fleet Management Solutions - Best practices for designing code.
Subscribe to get industry tips and insights
Geotab team
Table of Contents
Subscribe to get industry tips and insights
Related posts
Streamline your workflow with the fleet manager’s productivity checklist
November 14, 2024
1 minute read
Routes to riches – Geotab Routing and Optimization drives operational efficiency and cost management
February 15, 2024
5 minute read
A complete guide to fleet idling: Understand, detect and stop true idling
December 15, 2023
6 minute read
Strategies to increase fuel efficiency and manage fuel costs
November 2, 2023
4 minute read