REST Provider
The REST Provider makes HTTP API requests to the given URL and parses the result with a given expression.
All requests are periodically executed at the given interval time.
So it’s possible to periodically query any HTTP API and extract any according values.
Configuration
-
API URL
The REST API URL to query.ImportantMake sure to provide a valid URL, which starts with http://
orhttps://
. -
HTTP Method
The HTTP method to access the URL:Method Description Get
HTTP GET method, this is the default.
Post
HTTP POST method
Put
HTTP PUT method
-
Response Format
The format of the response data:Format
Response Content
Plain Text
The response is in plain text, no parsing necessary.
JSON
The response is in JSON format.
XML
The response is in XML format.
-
Request Body
POST or PUT body data. -
Request MIME Type
POST or PUT body content MIME type liketext/plain
orapplication/json
. -
Authentication The following fields set up a HTTP authentication.
-
Authentication Method Selects the HTTP authentication method:
Method
Description
None
No authentication required
Basic
Basic access authentication
Token
Bearer Token authentication
-
Username
Username if basic authentication is required, empty if HTTP authentication is not necessary. -
Password
Password if basic authentication is required. -
Token
A token string for bearer authentication.
-
-
Confidential URL Parameter The following parameter can be used in the URL:
-
Username
Username for the URL, used as$USER
in the URL, like…/img.html?user=$USER
. -
Password
Password for the URL, used as$PASS
in the URL, like…/img.html?pw=$PASS
. -
Optional Parameter
Secure optional parameter like a code etc. for the URL, used as$PARA
in the URL, like…/img.html?code=$PARA
.
-
-
Interval
The query interval time like every30s
,5m
or4h
. -
Ignore Sleep
Enable to ignore sleep mode, disabled to pause requests during sleep.
Disabled is the default to safe power.
Query
-
Status
Get the result status.Text Numeric Description N/A
0
No result available.
Excellent
1
Result answer available.
Fail
5
Result parsing or format error
-
Value
Returns the response value.-
Param 1
A valid JsonPath or XPATH expression which is evaluated on the response data.
Depending on the Response Format settings, setup a JsonPath to parse a JSON response or an XPath to parse XML response data.
JSON: A simple example is$.data
to get the value of thedata
field of{ data: 23 }
.
XPATH: A simple example is/data
to get the value of thedata
field of<data>23</data>
.
-
Action
-
Set: Send Data
Send data to the REST API.
Used as trigger action, e.g. from a button facelet.-
Param 1
The data / value to send to the API.
-