API Reference
This page explains how to use the aREST cloud API so you can directly access & control your devices connected to the aREST cloud.
All the API commands are done using the same base URL:
https://cloud.arest.io
Unless specified differently, all calls to the aREST API are GET requests.
All calls to the aREST cloud API must be done by passing your API key (that you can find inside your account) in the query of the call. For example:
/your_command?key=your_key
The simplest call you can do the aREST cloud is to get the ID, name and status of a device. You can do so with this command:
/device_id/id
You can use the aREST cloud API to get the current value of a variable defined on a device connected to aREST. The syntax is the following:
/device_id/your_variable
This will return the value of the variable if it is defined on the device & if the device is connected.
One of the main use of the aREST cloud API is to be able to control digital pins of your devices from anywhere in the world. You can do so with the following command:
/device_id/digital/pin_number/output_value
This will return a confirmation message that the output has been set, if the device is online.
Some devices (like most Arduino boards) will require to set pins as an input or as an output prior to setting the pin itself. You can do that via this command:
/device_id/mode/pin_number/output_type
Where output_type can be i (input) or o (output).
You can also use the API to query the current value of a given digital pin, which will return 0 or 1. You can do so with this command:
/device_id/digital/pin_number
Similar to digital inputs, some boards will allow you to measure analog values. Careful, this command is not available on all pins of the boards, check your device documentation before using this command. The command is the following:
/device_id/analog/pin_number
Some boards allow you to set the value of some pins as analog values. Careful, this command is not available on all pins of the boards, check your device documentation before using this command. The command is the following:
/device_id/analog/pin_number/pin_value