Avatar

3rd Party devices

0

I am getting underway with using 3rd party device support. I have been provided with the Google doc overview and I downloaded the most recent SDK as the DLL I was using did not recognise ProvisionResult. I have been assigned a device type prefix, though I am waiting for a productID integer to use in the ProvisionResult call. I assume the productID is not the same as the device type prefix as that is alphanumeric (or is it hex, and the decimal conversion is my ID?). 

While I was waiting, I was attempting to code with ProvisionResult. However, I cannot get the code to even compile as it states that ProvisionResult does not have a 4 argument structure. I tried to wrap it in an API.call, but the API references a database, so I don't think that is the way to go. 

On that note, I assume when asked for a user name and password parameters, this is the master credentials for my MyAdmin account, and not a MyGeotab database (since the goal is to get a serial number which is going to be tracked in MyAdmin)? 

Would it be possible to post some code that would achieve a provisioning? I can't find anything on the subject in the SDK documentation and experimenting is not getting me anywhere. Thank you!

Mauricio Muniz

Please sign in to leave a comment.

1 comment

0
Avatar

You can use the WebServerInvoker class from our ObjectModel DLL to make the call to ProvisionResult as below. You must use a MyAdmin user that has been given privileges for third party integration. 

WebServerInvoker invoker = new WebServerInvoker(null, 100000); 
 invoker.Url = "https://myadminapi.geotab.com/MyAdminApi.ashx"; 
 Dictionary<string, object> arguments = new Dictionary<string, object> 
     { 
         {"username", ""}, // Your MyAdmin username 
         {"password", ""}, // Your MyAdmin password 
         {"productId", 0} // Your integer product ID 
     }; 
 ProvisionResult result = (ProvisionResult)invoker.Invoke("ProvisionDevice", typeof(ProvisionResult), arguments); 

 

You can use the same process for AddGps by putting the correct parameters in the arguments dictionary and changing the invoked method and return type.

Geotab Developers 0 votes