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.
Find more training videos at the Geotab DEV Channel.
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:
Getting started with the SDK is easy. Open up your favorite browser and navigate to: http://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:
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.
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:
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.
If you liked this post, let us know!