REST Client

<< Click to Display Table of Contents >>

Navigation:  Components > Driver >

REST Client

This component is used to query REST API servers

For developers - no free support!

The subchapter contains examples for the connection of Netatmo, EcoFlow River2 Pro and ChatGPT.

 

Data points of the component:

Name

Type

Type Function

Diagnosis [Text]

Output

Error messages are output here. Attention: Diagnostic or debug outputs are only intended for use in the event of an error. Please only use them after consulting the support team! If used, they can significantly impair the performance of the service.

Dynamic

Folder

This folder contains the query parameters and the response. The folder for the created channel contains the data points for the endpoint query trigger and for the response status code (see HTTP error code).

Extended diagnostics

Input

(De)Activates the extended debug output. Attention: Diagnostics or debug outputs are only intended for error cases. Please only use them after consulting the support team! If used, they can significantly impair the performance of the service

Driver On/Off

Bidirectional

Switches the driver on or off

 

 

Properties of the component

Component name

Standard

Function

Connection

 

Settings for the connection to the REST endpoint (see below).

Parameter profiles

0

Using self-defined profiles, it is possible to split JSON strings that are read by a REST server into individual sub-data points according to the hierarchy. A separate JSON parser is therefore no longer necessary. The entire JSON string can be converted automatically using the wizard. A data point is also created for this so that this parameter can also be changed at runtime.

Response profiles

0

Using self-defined profiles, it is possible to split JSON strings that are transmitted in a REST server into individual sub-data points according to the hierarchy. A separate JSON parser is therefore no longer necessary. The entire JSON string can be automatically converted using the wizard. The profile is created automatically via "Channels" --> "Read data points".

Channels

0

Name: own designation
Path: Specification of the request path (e.g. /api/device)
Request Type: Read, write, delete or set
Query Format: Defines the format of the query

Parameter-Profile: Selection of the parameter profile
Result-Profile: Display of the result from "Read Datapoint"
Read Datapoint: Triggers a query. A response profile can be generated automatically.
Interval: Setting for a cyclical query in seconds.

Driver On/Off

 

Switches the driver on or off at server start.

 

Note: Endpoint = base URL from Common + entry for Path

 

Connection Common

Common Name

Common Name Function

API Base URL:

Specifies the base URL for the query endpoint. Example: https://api.ecoflow.com/iot-service/open

Timeout [s]:

Specification of the time from which a timeout is recognised.

Headers:

Additional information for the query is transferred in the header. The following notation applies: Name=Value and one line corresponds to one parameter.

User:

User name for the login.

Password:

Password for logging in.

 

Connection OAuth2

Name: Name

Function

Authentication

Selection of the OAuth authentication method (must be known).

Scopes

In OAuth2, scopes denote the authorisations that an application requests in order to access certain resources of a user or an API. if there are several, these can be written one after the other (blank character as separator)

Authorisation path

URL path for authorisation. This is required to be able to log in to the system. Example: /oauth2/authorise (results with the base URL: https://api.domain.com/rest/oauth2/authorize )

Token path

URL to the token endpoint. This gives you the access token. Example: /oauth2/token (results with the base URL: https://api.domain.com/rest/oauth2/token )

Client ID

Identification of the client (user name) for logging on to a backend.

Client Secret

Password/secret key for logging in to the backend.

Perform authentication

This button is used to start a login attempt.

Access token

If the login is successful, the token is set automatically.

Refresh token

The token is set automatically after a successful login.