Authentication Extension

In addition to authenticating via a batch call, the server offers an optional extension to the JSONRPC protocol.
You can supply the auth token and sync id on the query string, which will authenticate the method call(s) in the request. The values are as follows:

authThe value returned by 'device.auth'

sync_idThe value that would normally be passed to 'device.check_auth'

Here's an example:

?auth=kwkewyn7wernw9er7&sync_id=28

The form at the top of this page has a input for the query string, which you may use to test the authentication extension.

get_device

get_device_locations

Accepts a list of device ids as a parameter. Returns a list of dicts containing the device id, lat and lng. If no device has gps coords, then no dict is returned for that device. If none of the devices have gps coords, an empty list is returned.

get_product_types

get_tag_types

get_tank_samples

Get a range of tank dips for a given device from start to end. If start is omitted then the start will be from the first available sample, if end is omitted, samples up to the most recent will be returned.

Samples are returned as a list of tuples where each tuple contains the timestamp and volume.

hydip_get_customer_transactions

hydip_get_samples

This call is only for devices that haven't been migrated to the sites framework. Get a range of tank dips for a given device from start to end. If start is omitted then the start will be from the first available sample, if end is omitted, samples up to the most recent will be returned.

Samples are returned as a list of dictionaries. Each dictionary contains two values; "sensor" is the index of the sensor, and "dips" is a list samples, where each sample is a list containing the timestamp and volume.

keep_alive

login

Log in a user with credentials username and password.

Most of the json rpc methods require a login, so this should be the first call before anything else. If login is successful, this method will return a string containing the session key, this value should be passed to the other methods as a parameter called sessionkey.

If login is not successful this method will return an error state.

Sessions are automatically logged out, 60 minutes after the last request.

auth.get_authenticated_user

auth.login

Log in a user with credentials username and password.

Most of the json rpc methods require a login, so this should be the first call before anything else. If login is successful, this method will return a string containing the session key, this value should be passed to the other methods as a parameter called sessionkey.

If login is not successful this method will return an error state.

Sessions are automatically logged out, 60 minutes after the last request.

devices.get_devices_by_asset_tag

fueltracking.export_new_transactions

Get new transactions since a previous call.

This method retrieves new transaction based on an update_index. On the first call to this method, update_index should be 0, which will return all transactions. A new value for update_index will be returned along with the transactions. Subsequent calls should use the update_index from the previous calls. This ensures that only new transactions will be returned.

This method returns the following response. The list of transactions is in the same format as the export_transactions method.

fueltracking.import

Import tag database. On success this method returns a dictionary containing statistics regarding the number of objects that were newly imported, modified or suspended. If the import fails for some reason an error code 7 will be returned, along with a (hopefully) helpful error message.

Customers and tags are given as a list of objects. Any enduser or tag that was previously imported, but not in this call will be marked as 'suspended'.

hydip.get_samples

This call is only for devices that haven't been migrated to the sites framework. Get a range of tank dips for a given device from start to end. If start is omitted then the start will be from the first available sample, if end is omitted, samples up to the most recent will be returned.

Samples are returned as a list of dictionaries. Each dictionary contains two values; "sensor" is the index of the sensor, and "dips" is a list samples, where each sample is a list containing the timestamp and volume.

network.get_new_transactions

Get new transactions since a previous call.

This method retrieves new transaction based on an update_index. On the first call to this method, update_index should be 0, which will return all transactions. A new value for update_index will be returned along with the transactions. Subsequent calls should use the update_index from the previous calls. This ensures that only new transactions will be returned.

This method returns the following response. The list of transactions is in the same format as the get_network_transactions method.

network.import

Import tag database. On success this method returns a dictionary containing statistics regarding the number of objects that were newly imported, modified or suspended. If the import fails for some reason an error code 7 will be returned, along with a (hopefully) helpful error message.

Customers and tags are given as a list of objects. Any enduser or tag that was previously imported, but not in this call will be marked as 'suspended'.

sites.get_tank_samples

Get a range of tank dips for a given device from start to end. If start is omitted then the start will be from the first available sample, if end is omitted, samples up to the most recent will be returned.

Samples are returned as a list of tuples where each tuple contains the timestamp and volume.