Using REST APIs with Helm

Helm has built-in support for accessing JSON REST APIs.

To start, add a REST API Device to your panel. You’ll find this in the “Other” section in the Parts Bin. Set the URL property of the device to the base URL of your REST server. Both HTTP and HTTPS are supported.

You can send GET, POST and DELETE commands from Lua scripts. Helm automatically converts between Lua tables and JSON, so no parsing of the result is needed.

Here’s an example of s script making a GET request and displaying the results in HELM components.

-- Get the specified post

local p = H.RESTDevice_1:Get("/posts/" .. H.DROPDOWN_1.Value)

-- JSON return is automatically converted to a Lua table

H.TEXTFIELD_1.Text = p.body
H.LABEL_3.Text = p.title

Query parameters can be added to GET requests by passing a second Lua table:

-- Get the posts from the specified user

local p = H.RESTDevice_1:Get("/posts", {userId = H.DROPDOWN_2.Value})

Here’s a Helm panel that shows these techniques, using the dummy REST server at