This page explains how to use the aREST cloud API so you can directly access & control your devices connected to the aREST cloud.
Basic API information
All the API commands are done using the same base URL:
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:
Get Device Info
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:
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:
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:
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:
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:
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:
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: