REST API Bridge
Overview
Section titled “Overview”Reads cloud and REST data sources, such as condition monitoring or a CMMS. CONNECT keeps the credentials and forwards allowed GET requests; a project plugin displays the data.
Set up and parameters
Section titled “Set up and parameters”A RESTAPI interface reads cloud and REST data sources, such as condition monitoring services or a computerized maintenance management system (CMMS). CONNECT handles authentication and forwards allowed requests. A project plugin in realvirtual displays the data as status indicators, charts or panels; the interface itself has no signals or topics.
Add an interface entry to the Interfaces array in your project’s *.connect.json, for example:
{ "Id": "cloud-data", "Type": "RESTAPI", "Enabled": true, "RestApi": { "BaseUrl": "https://api.example.com/v1", "Auth": { "Kind": "OAuth2ClientCredentials", "TokenUrl": "https://api.example.com/v1/oauth2/token", "ClientId": "hmi-reader", "ClientSecret": { "$secretRef": "cloud-data.client" } }, "Allow": ["/machines/*/statuses"], "TimeoutSec": 30, "MaxResponseMb": 50 }}Replace the URLs and client ID with your provider’s values. Only OAuth2 Client Credentials, with HTTP Basic client authentication at the token endpoint, is supported. CONNECT obtains and refreshes the access token. Use HTTPS for both URLs; HTTP is accepted only for loopback hosts.
The bridge allows GET only. Allow lists paths relative to BaseUrl: * matches one path segment and a final ** matches the remaining path. An empty list denies all requests. Query strings pass through without taking part in path matching. The example allows /machines/123/statuses; the destination stays under the configured base URL and redirects are not followed.
TimeoutSec bounds the entire response, including its body (default 30 s). MaxResponseMb limits the streamed response size (default 50 MB). A response that exceeds either limit is rejected, or its connection is aborted if streaming has already started.
Requests use CONNECT’s existing access rule — loopback, a valid gateway key or a valid dev key — and its origin checks. Browser authentication headers and cookies are not forwarded upstream. Responses carry X-Content-Type-Options: nosniff and Content-Security-Policy: sandbox; default-src 'none'; active or unrecognized content types are served as attachments.
The project plugin calls ctx.apiBridge('cloud-data') to read and interpret the response. For implementation, see the developer documentation and its viewer source guide doc-extending-webviewer.md, section Calling external APIs through CONNECT.
Create or import signals
Section titled “Create or import signals”- Manually. Not applicable: the interface has no signals and no topics.
- Browse. No browse: there are no signals to find.
- File import. No file import. The interface is configured in the
Interfacesarray of the project’s*.connect.json, as shown above. - There is no signal binding to the model. The plugin calls
ctx.apiBridge('cloud-data')and renders the response.
See also
Section titled “See also”- Common concepts — text signals, direction, write access, tracking signals
- Configuring interfaces — adding signals, direction and write access
- All supported interfaces
- Troubleshooting — connection and signal problems