JSON RPC auto-generated documentation

To call any of these methods, send a POST request to this url with encoded JSON according to the JSON RPC 2.0 spec.

The 'params' value should be specified by-name (i.e. as a JS object).

Batch requests are supported.

Test Form

Use the following form to send JSONRPC requests




                

Methods

The following methods are available

hello

Enthusiastically greet who.

Parameters
Parameter Purpose Default Required?
who Who you want to greet World No

device.add_alert (deprecated)

Parameters
Parameter Purpose Default Required?
text Yes
title Yes

device.add_events (deprecated)

Add a sequence of events to a given timeline, return ids of applied events.

Parameters
Parameter Purpose Default Required?
events A list of events Yes
name Name of the timeline Yes

device.add_gps_coords (deprecated)

Parameters
Parameter Purpose Default Required?
lat Yes
lng Yes

device.add_samples (deprecated)

Add samples to a sampler.

samples should be a list of samples, where a sample consists of the timestamp (epoch time) and value.

e.g:

samples = [[12342345, 123], [25324365.0, 420.0]]
** NOTE ** We are using this for both backward compatibility, and as a temporary fix to read disk samples into the system.

Parameters
Parameter Purpose Default Required?
device_class device class to use Yes
sampler_name name of sampler Yes
samples list of samples Yes
serial device serial number Yes

device.auth (deprecated)

Parameters
Parameter Purpose Default Required?
company_id User's company id (primary key) null No
company_uid User's company uid null No
password User's password null No
serial Device serial number Yes
username User's username null No

device.auth_rpi (deprecated)

Parameters
Parameter Purpose Default Required?
usercode Yes

device.check_approval (deprecated)

Parameters
Parameter Purpose Default Required?
device_class Yes
info Information to identify the device Yes
name (friendly) Name of the device Yes
serial Serial number of the device Yes
subdomain Company subdomain Yes

device.check_auth

Check credentials and authorize the rest of the batch requests.

Parameters
Parameter Purpose Default Required?
auth_token An authorization token Yes
device_class Yes
serial Yes
sync_id null No

device.check_firmware (deprecated)

Check for new firmware.

Parameters
Parameter Purpose Default Required?
current_version Version number of the current firmware Yes

device.create_samplers

Create samplers.

Parameters
Parameter Purpose Default Required?
sampler_names A list of samplers to create Yes

device.get_conf (deprecated)

Parameters
Parameter Purpose Default Required?
names Yes

device.get_firmware (deprecated)

Get the firmware for this device.

No parameters

device.get_manage_url (deprecated)

Get manage url.

No parameters

device.handoff (deprecated)

Parameters
Parameter Purpose Default Required?
auth_token Yes
rpi_b_plus null No
usercode Yes

device.publish (deprecated)

Parameters
Parameter Purpose Default Required?
company User's company null No
device_class Name of the device class Yes
firmware_b64 Base64 encoded firmware Yes
password User's password Yes
replace False No
ui UI XML Yes
username User's username Yes
version Version number Yes

device.register (deprecated)

Parameters
Parameter Purpose Default Required?
auth_token Authorization token null No
device_class_name Name of the required device class null No
name Device friendly name null No
path The location to place devices in the device tree Dataplicity Devices No
serial Device serial number null No
ui XML UI definition for firmware v1 null No

device.set_agent_version

Let us know what agent_version the device uses.

Parameters
Parameter Purpose Default Required?
agent_version The version of dataplicity Yes

device.set_disk_space

Let us know the disk capacity and amount used.

Parameters
Parameter Purpose Default Required?
disk_capacity Capacity of disk in bytes Yes
disk_used Amount of disk used in bytes Yes

device.set_firmware (deprecated)

Let the server know which firmware the device is running.

Parameters
Parameter Purpose Default Required?
version Firmware version Yes

device.set_ip_addresses

Save the IP addresses of the device

Parameters
Parameter Purpose Default Required?
ip_list A list of all ip address on the device Yes

device.set_machine_defined_tags

Sets tags on the device defined by the machine

Parameters
Parameter Purpose Default Required?
tag_list A list of tag names Yes

device.set_machine_revision

Let us know what the revision code of the machine is.

Parameters
Parameter Purpose Default Required?
revision_code The revision code of the machine Yes

device.set_machine_type

*Deprecated call, only used on old versions of the agent* The agent used to send through the machine type, rpi_2b for example. These still match our MACHINE_CHOICES, but there is potential for the old agent to send something not in those choices.

Let us know what type the device is.

Parameters
Parameter Purpose Default Required?
machine_type The type of machine Yes

device.set_model_name

Parameters
Parameter Purpose Default Required?
model_name The model name of the machine (for non-RPi devices Yes

device.set_os_version

Let us know what OS the device is running.

Parameters
Parameter Purpose Default Required?
os_version The OS version Yes

device.set_remote_directory

Update remote directory.

Parameters
Parameter Purpose Default Required?
directory serialized remote directory Yes
file_sizes Scan includes file sizes False No

device.set_uname

Let us know what uname the device presents.

Parameters
Parameter Purpose Default Required?
uname The result of uname. Yes

device.update_conf (deprecated)

Update a conf file.

Returns the new contents of the configuration file with any changes made by the server.

Parameters
Parameter Purpose Default Required?
contents conf contents in ConfigParserFormat Yes
name name of conf file on the device Yes

device.update_conf_map (deprecated)

Update conf files, return any conf files which have changed.

Parameters
Parameter Purpose Default Required?
conf_map object that maps a conf name on to its contents Yes

device.update_ui (deprecated)

Parameters
Parameter Purpose Default Required?
device_class Name of the device class Yes
ui User interface XML Yes
version Firmware version number Yes

m2m.associate

Associate a device with its m2m identity.

Parameters
Parameter Purpose Default Required?
identity An M2M identity (typically a UUID) Yes

test.error

Test explicit error.

No parameters

test.exception

Test error handling.

No parameters

user.authenticate (deprecated)

Parameters
Parameter Purpose Default Required?
password Yes
username Yes

user.get_companies (deprecated)

Parameters
Parameter Purpose Default Required?
password Yes
username Yes