You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-19
Original file line number
Diff line number
Diff line change
@@ -154,7 +154,7 @@ To install the library, simply clone this repository in the /libraries folder of
154
154
155
155
## API documentation
156
156
157
-
The API currently supports five type of commands: digital, analog, and mode, variables, and user-defined functions and api-extensions.
157
+
The API currently supports five type of commands: digital, analog, and mode, variables, and user-defined functions.
158
158
159
159
### Digital
160
160
@@ -189,24 +189,6 @@ You can also define your own functions in your sketch that can be called using t
189
189
*`rest.function("led",ledControl);` declares the function in the Arduino sketch
190
190
*`/led?params=0` executes the function
191
191
192
-
### API-Extensions
193
-
194
-
With api-extensions you have the possibility to extend the api by your own subcommands and customized responses.
195
-
196
-
You define your api extensions in your sketch that can be called using the REST API. To access an user-defined api-extension defined in your sketch, you have to declare it first, and then call it from with a REST call. Note that all api-extension functions need to have the following signature `void api_extension(aREST *arest, const String& name, const String& request_url)`. For example, if your aREST instance is called "rest" and the function "aquariumController":
197
-
*`rest.api_extension("aquarium",aquariumController);` declares the api extension in the Arduino sketch
198
-
*`/aquarium/water_limit/lower/set/65` executes the api-extension function and passes the value `"/aquarium/water_limit/lower/set/65"` as the third parameter (`request_url`) into the api-extension function
199
-
* You can then customize your JSON result and extend it to something like this:
You can also access a description of all the variables that were declared on the board with a single command. This is useful to automatically build graphical interfaces based on the variables exposed to the API. This can be done via the following calls:
0 commit comments