Platforms
Product Lines
Platforms Safecrete Safewall Mine Operating System (Coming Soon)
On this page

REST Connector

Overview

The REST connector enables the IndustryOS IoT Gateway to collect data from RESTful APIs. This connector is useful for integrating with cloud services, web applications, and any device or system that exposes a REST API.

General Settings

  • Name - connector name
  • Logs configuration - logging settings
  • Report strategy - data sending strategy

Connection Settings

Endpoint Configuration

  • Base URL - API base URL
  • Security - authentication method
  • Timeout - request timeout
  • SSL/TLS verify - certificate validation

Authentication Methods

Basic Authentication

  • Username - API username
  • Password - API password

Token Authentication

  • Token type - Bearer, API Key
  • Token - authentication token
  • Header name - custom header for token

OAuth 2.0

  • Client ID - OAuth client ID
  • Client secret - OAuth secret
  • Token URL - token endpoint
  • Scope - access scope

Data Mapping

Request Configuration

  • Device name - name in IndustryOS
  • Device profile - device type
  • Endpoint - API endpoint path
  • Method - HTTP method (GET, POST, PUT)
  • Headers - custom HTTP headers
  • Polling period - request interval

Response Parsing

Parse JSON responses:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
  "deviceNameExpression": "${name}",
  "attributes": [
    {
      "key": "model",
      "value": "${model}"
    }
  ],
  "telemetry": [
    {
      "key": "temperature",
      "value": "${sensors.temperature}"
    }
  ]
}

JSON Path Expressions

Extract data using JSON path:

  • Simple path - $.temperature
  • Nested path - $.sensors.temperature
  • Array access - $.data[0].value
  • Wildcard - $.sensors[*].value

Advanced Features

Request Templates

Dynamic request building:

1
2
3
4
5
6
7
8
9
10
{
  "url": "${baseUrl}/devices/${deviceId}",
  "headers": {
    "Accept": "application/json",
    "X-Custom-Header": "${customValue}"
  },
  "params": {
    "from": "${timestamp}"
  }
}

Response Converters

Custom response processing:

1
2
3
4
5
6
7
8
def convert_response(response, metadata):
    data = response.json()
    return {
        "deviceName": data["name"],
        "telemetry": {
            "temperature": data["temp"] / 10
        }
    }

Requests Mapping

Attribute Updates

Send attributes to REST API:

  • Method - POST, PUT, PATCH
  • Endpoint - target endpoint
  • Body template - request body

RPC Methods

Execute API calls:

  • Method name - RPC identifier
  • HTTP method - GET, POST, etc.
  • Endpoint - API endpoint
  • Timeout - request timeout

Error Handling

  • Retry policy - automatic retries
  • Status code handling - error detection
  • Fallback values - default values on error

Next Steps

  • Cloud service integration
  • Weather data collection
  • Third-party API integration
  • Webhook processing