Rest Adaptor

The Generic REST adaptors connect IFS OI Server to REST web services that return JSON, without custom code. You describe how to call the service and where the data sits in its response, and the adaptor turns that response into time series or dataset data.

Related: Dataset Datasources, Tag Datasources

Overview

Every REST API arranges its JSON differently. The Generic REST adaptors handle this with a shape configuration: a short JSON description that says where each value is in the response. The adaptor calls the service, applies the shape, and returns data that Explorer understands.

There are two adaptors:

  • Generic REST Time Series Adaptor: tag data (timestamped values for named tags), used in trends and anywhere Explorer reads tag history.
  • Generic REST Dataset Adaptor: tabular data (rows and columns), used anywhere Explorer uses a dataset.

Both adaptors share the same connection, authentication and shape configuration options. Both are read-only.

Choosing an Adaptor

  Time Series Dataset
Use it for Sensor readings, process values: anything with a tag name, a time and a value Lists and tables: work orders, assets, events, reference data
Output Values per tag: name, timestamp, value, confidence A table whose columns you define
Shape is set Once, on the datasource On each dataset, in its query
Values filled into the request {tag}, {tags}, {startTime}, {endTime} Dataset parameters through PARAM() and PARAMS()
Paging No Yes
Tag browsing Yes Not applicable

If the service is an OData service, try the OData adaptors first; they understand OData queries natively. Use the Generic REST adaptors for services that are not OData, or when the response needs reshaping.

Quick Start

This example uses a public OData sample service so that you can see the whole flow before connecting your own API.

  1. Create a datasource that uses the Generic REST Dataset Adaptor. Set Base URL to https://services.odata.org/V4/Northwind/Northwind.svc and leave Authentication Mode as None.
  2. Use Test Connection. The adaptor sends a GET to the Base URL; a success response marks the datasource as operational.
  3. Create a dataset on the datasource and enter this query:
{
  "path": "Products?$top=20",
  "shape": {
    "rowsPath": "$.value[*]",
    "emit": {
      "ProductID":   { "path": "ProductID", "type": "int" },
      "ProductName": { "path": "ProductName" },
      "UnitPrice":   { "path": "UnitPrice", "type": "decimal" }
    }
  }
}
  1. Preview the dataset. You should see 20 rows with the columns ProductID, ProductName and UnitPrice.

The path is appended to the Base URL. The shape says that each item in the response's value array is a row, and which three fields to take from each item.

Connection and Authentication Settings

These settings apply to both adaptors. The following table lists them along with the name and type to be used in the Import/Export spreadsheet. The standard datasource settings (name, description, time zone, timeouts) also apply.

Parameter Description and example Name Type
Base URI / Base URL Required. The service's address, for example https://api.example.com/v1. Request paths are appended to it. Called Base URI on the Time Series adaptor and Base URL on the Dataset adaptor. BaseURI / BaseUrl String
HTTP Method GET (default) or POST. Use POST for services that take a request body, such as GraphQL. HttpMethod String
Request Headers Extra headers, one Name: Value per line. Example: Accept: application/json. Headers String
Request Content Type Content type of a POST body. Default: application/json. RequestContentType String
Request Timeout (seconds) How long to wait for a response. 0 (default) uses the system default of 100 seconds. RequestTimeoutSeconds Integer
Verification Path Optional path that Test Connection requests instead of the Base URL. Use it when the Base URL itself returns an error. VerificationPath String
Authentication Mode None (default), Basic, Bearer, ApiKey, OAuth2ClientCredentials or Certificate. Only the settings for the chosen mode are used. AuthenticationMode String
Username User name for Basic authentication. Username String
Password Password for Basic authentication. Password EncryptedString
Bearer Token A fixed token, sent as Authorization: Bearer …. Replace it manually when it expires. BearerToken EncryptedString
API Key Name Name of the header or query-string parameter that carries the API key. ApiKeyName String
API Key Value The API key. ApiKeyValue EncryptedString
API Key Location Header (default) or QueryString. ApiKeyLocation String
OAuth2 Token URL Token endpoint for the OAuth 2.0 client-credentials grant. The adaptor reuses a token until shortly before it expires. If a request is rejected as unauthorized, it gets a new token and tries once more. OAuth2TokenUrl String
OAuth2 Client Id Client ID for the client-credentials grant. OAuth2ClientId String
OAuth2 Client Secret Client secret for the client-credentials grant. OAuth2ClientSecret EncryptedString
OAuth2 Scope Optional scope for the client-credentials grant. OAuth2Scope String
Certificate Thumbprint Thumbprint of a client certificate for mutual TLS. The certificate must be installed on the server that runs the adaptor. CertificateThumbprint String
Certificate Store Location CurrentUser (default) or LocalMachine. CertificateStoreLocation String

Time Series Adaptor

The Generic REST Time Series Adaptor answers Explorer's requests for tag data. For each request it builds a URL (and a body, for POST) from your templates, calls the service, applies the shape configuration, and returns the values for each tag.

You only configure how to get raw values. IFS OI Server calculates averages, interpolated values and last-known values from the raw data, so every sampling method works without extra setup.

Time Series Adaptor Settings

In addition to the connection and authentication settings:

Parameter Description and example Name Type
Request Path Template Path and query string appended to the Base URI. Can contain placeholders. Example: trend?tag={tag}&from={startTime}&to={endTime} RequestPathTemplate String
Request Body POST only. The body to send. Can contain the same placeholders. RequestBody String
Request Timestamp Format .NET date format used for {startTime} and {endTime}. Default: yyyy-MM-ddTHH:mm:ssZ. RequestTimestampFormat String
Request Time Zone UTC (default) or DatasourceLocal, the datasource's time zone. For DatasourceLocal, include an offset in the timestamp format, for example yyyy-MM-ddTHH:mm:sszzz. RequestTimeZone String
Shape Configuration Required. JSON that finds the name, timestamp, value and confidence in the response. See Shape Configuration. ShapeConfiguration String
Tag Discovery Path Optional path of an endpoint that lists tags. If blank, the Request Path Template is used. Supports {startTime}, {endTime} and {tags}. TagDiscoveryPath String
Tag Discovery Shape Optional shape for the tag-list response. Outputs name, and optionally description, units, minimum and maximum. If blank, the Shape Configuration is used. TagDiscoveryShape String
Tag Discovery Headers Optional headers for tag browsing. They replace the Request Headers; authentication still applies. TagDiscoveryHeaders String
Tag Discovery Content Type Optional content type for a POST discovery body. If blank, the Request Content Type is used. TagDiscoveryContentType String
Tag Discovery Body Optional POST body for tag browsing. If blank, the Request Body is used. TagDiscoveryBody String
Tag Discovery Window (hours) How far back {startTime} goes during tag browsing. Default: 24. TagDiscoveryWindowHours Integer

Request Placeholders

The adaptor replaces these placeholders in the Request Path Template and Request Body before each call.

Placeholder Replaced with
{tag} One tag name. The adaptor makes one call per tag; if one tag fails, the others still return. The response doesn't need to include the tag name.
{tags} All requested tag names, separated by commas. The adaptor makes one call for all tags, so the shape must output name to match values to tags. Matching ignores case.
{startTime} Start of the requested period, in the Request Timestamp Format and Request Time Zone.
{endTime} End of the requested period, formatted the same way.

If the template uses neither {tag} nor {tags}, the adaptor makes one call and matches values to tags by the name the shape outputs.

Note: if Request Time Zone is DatasourceLocal but the timestamp format still ends in Z, local times are sent labeled as UTC and the data will be shifted.

Shape Output for Tag Data

Field Required Description
value Yes The reading. Numbers, text and true/false are accepted.
timestamp Recommended When the reading was taken. Must have a format. Rows without a timestamp are stamped with the end of the requested period, which suits services that only return current values.
name With {tags} or no placeholder The tag name, used to match values to tags.
confidence No Quality from 0 to 100. Default: 100.

Tag Browsing

When a user browses or searches for tags on the datasource, the adaptor gets tag names from the service. By default it repeats the normal data request over the last 24 hours and lists each distinct name it finds; the search filter, including wildcards, is then applied. If the service has an endpoint that lists tags, set the Tag Discovery settings above to use it instead. Tag browsing uses the datasource's HTTP Method.

Dataset Adaptor

The Generic REST Dataset Adaptor returns a table. Connection, authentication and paging are set on the datasource. The request path and the shape are set on each dataset, because each endpoint returns a different structure.

Dataset Adaptor Settings

The Dataset adaptor uses the connection and authentication settings and the paging settings. It has no settings of its own beyond those.

Writing a Dataset Query

For a SQL datasource, a dataset query is a SELECT statement. For a REST datasource, the query is a JSON document with these fields:

Field Required Description
path Usually Path and query string appended to the Base URL.
body For POST The request body, written as a JSON string. Sent when the datasource's HTTP Method is POST.
shape Yes How to turn the response into rows and columns. See Shape Configuration.
params No A list of { "name": …, "value": … } entries. Currently used only for loading one page at a time.

Every field the shape outputs becomes a column, and each shaped item becomes a row. To add, rename or retype a column, change the shape. Column types come from the first non-empty value in the column:

  • true/false values make a Boolean column.
  • A field with a format makes a Date/Time column.
  • A field with "type": "int" makes an Integer column.
  • Other numbers make a Decimal column. This includes whole numbers with no type, and "type": "long".
  • Anything else makes a Text column.

Parameters

REST dataset queries use the same parameter keywords as SQL dataset queries. Define the dataset's parameters as you would for a SQL dataset, then use them in the query.

Related: Dataset Queries

Keyword Becomes Example
PARAM(name,type) The parameter's value PARAM(site,string) becomes 2401
PARAMS(name,type) All selected values, separated by commas PARAMS(ids,integer) becomes 1,2,3

Values are formatted for a URL:

  • Text is URL-encoded, so a space becomes %20.
  • Numbers use a dot as the decimal separator.
  • Booleans are true or false.
  • Dates and times are ISO 8601 in the datasource's time zone, including the offset.

Note: values are URL-encoded even inside a POST body, so text with spaces arrives as, for example, New%20York. In POST queries, use parameters only for values that need no encoding, such as codes and numbers.

Dataset Paging

Many APIs return large results in pages. Set the Paging Style on the datasource to match the API. The following table lists the paging settings along with the name and type to be used in the Import/Export spreadsheet.

Parameter Description and example Name Type
Paging Style None (default): a single request.
NextLink: follow the next-page URL in each response until there is none (OData @odata.nextLink style).
OffsetLimit: add an offset and a limit to the URL, and increase the offset until a page has fewer rows than Page Size.
PageNumber: add a page number (from 1) and a page size, and increase the page number until a page has fewer rows than Page Size.
PagingStyle String
Next Link Path Where the next-page URL is in the response. Default: $['@odata.nextLink']. NextLinkPath String
Page Size Rows to request in each call. Default: 100. PageSize Integer
Offset Parameter URL parameter that holds the offset. Default: $skip. OffsetParameter String
Limit Parameter URL parameter that holds the page size for OffsetLimit. Default: $top. LimitParameter String
Page Parameter URL parameter that holds the page number. Default: page. PageParameter String
Page Size Parameter URL parameter that holds the page size for PageNumber. Default: pageSize. PageSizeParameter String
Max Pages Safety limit: the adaptor stops after this many calls. Default: 1000. MaxPages Integer

Normally the adaptor fetches every page, up to Max Pages, and returns all rows as one table. With OffsetLimit or PageNumber, don't put offset or page parameters in the path; the adaptor adds them. Paging applies to GET requests only; a POST dataset always makes a single call.

Loading One Page at a Time

For displays that load data page by page, add pageNumber, and optionally pageSize, to the query's params. The adaptor then returns only that page, making only as many API calls as it needs. If pageSize is left out, the display's page size is used.

{
  "path": "Orders",
  "params": [
    { "name": "pageNumber", "value": "PARAM(pageNumber,integer)" },
    { "name": "pageSize",   "value": "50" }
  ],
  "shape": { "rowsPath": "$.value[*]", "emit": { "OrderId": { "path": "OrderID", "type": "int" } } }
}

With OffsetLimit or PageNumber paging, the adaptor starts at the first row of the requested page, so rows from earlier pages are never requested again. It stops when the page is full or the API returns a short page, and discards any extra rows from the last call. See One Display Page from Several API Calls.

With NextLink paging, the adaptor remembers where the previous page ended, so the next page doesn't start from the beginning. When it has no record of where the previous page ended, for example on the first request for page 3:

  • If Offset Parameter is set, the first call adds the offset and the datasource's Page Size (as the Limit Parameter), so it starts at the right row. The adaptor then follows the next links from there.
  • If Offset Parameter is blank, the adaptor starts from the first page and skips the rows that belong to earlier pages.

With Paging Style None, it fetches the full response and returns only the requested rows.

Note: Offset Parameter defaults to $skip. If a NextLink API doesn't accept $skip and $top, clear Offset Parameter on the datasource.

Note: this works only when the display asks the dataset for paged results. The page number must be passed through params as shown, because Explorer does not otherwise pass it to the adaptor.

Related: Paged Queries

Shape Configuration

A shape configuration is a JSON document that turns one API response into a list of rows. Both adaptors use the same format. For the Time Series adaptor, the shape outputs name, timestamp, value and confidence. For the Dataset adaptor, every field it outputs becomes a column.

Patterns

Use exactly one pattern. If more than one is present, the first in this table is used.

Pattern Use when the response…
levels is nested: rows inside rows, the tag name several levels above the values, or the tag name used as an object key
zip holds each column as its own array, for example timestamps[] next to values[]
rowsPath + emit is one list in which each item is a row. This is the most common case.
emit is a single object that should become one row

Finding a Value

Each entry in emit (or in zip.columns) names an output field and says where its value comes from:

Key Takes the value from Example
path A path inside the current item { "path": "meta.quality" }
index A position, when the item is an array such as [time, value, quality] { "index": 1 }
var A variable saved at an outer level (see levels) { "var": "tagName" }
literal A fixed value { "literal": "PLANT-1" }

If an entry has more than one of these keys, literal wins, then var, index and path. An entry with none of them, { }, takes the current item itself. A literal value is used exactly as written; type and format don't apply to it.

Converting Values

Key Values Description
format iso8601, unixSeconds, unixMilliseconds, or custom: plus a .NET pattern, such as custom:dd/MM/yyyy HH:mm:ss Reads the value as a date and time. Always set this on timestamp. A custom pattern with no offset is read as UTC.
type decimal, double, int, long, bool, string Reads the value as that type. integer, float and boolean are also accepted, and case is ignored. A value that can't be converted fails the whole request.
nullSentinels A list, for example [-9999, "N/A"] Treats these values as empty. Matching ignores case.
default Any value Used when the field is missing, null, or matches a null sentinel.

Use format for dates and type for everything else. A field with neither is passed through as it appears in the JSON.

Nested Responses (levels)

levels is a list of steps, from the outside of the response inward. Each step can have:

  • path: the items to go through at this level. The first step is relative to the whole response; later steps are relative to the item from the previous step.
  • bind: values to save for use further in, as { "variableName": "path" }. Read them later with var.
  • bindKey: for when the tag name is an object key rather than a field. The adaptor goes through each key, saves it under this variable name, and moves into its value.
  • emit or zip: on the last step only. This step produces the rows.

Columnar Responses (zip)

zip.columns lists the output fields. A column with a path reads an array, and the arrays are combined item by item: the first item of each array makes the first row, and so on. A column with var or literal repeats the same value on every row. onRagged controls what happens when the arrays have different lengths:

  • truncate (default) stops at the shortest array.
  • pad continues to the longest array and fills missing values with empty values.
  • fail returns an error.

Path Syntax

Write To select
name, a.b.c A property, or a property inside a property
['@odata.count'] A property whose name contains dots, spaces or other symbols
items[0] One array item by position, starting at 0
items[*] Every item in an array
* Every item, or every property value, of the current item
$.data A path from the top of the response, not from the current item
empty, $ or @ The current item itself

Note: filters ([?(...)]), recursive search (..) and slices ([0:5]) are not supported. Filter on the server through the request URL instead. Property names are case-sensitive.

Building a Shape

Writing a shape is easier if you look at the real response first. Follow these steps:

  1. Call the API in a browser or a tool such as Postman, using the same URL and sign-in as the datasource, and copy the response.
  2. Find the repeating part. Look for the array that has one item per row (or per reading). Its path becomes rowsPath, or the path of the last level.
  3. Find each value relative to one item. Inside emit, paths start from a single array item, not from the top of the response.
  4. Find values that sit outside the repeating part, such as a tag name or site name in a parent object. Capture them with bind on an outer level and read them with var.
  5. Add type and format so numbers become numbers and dates become dates. Many APIs send numbers as text, such as "18.4".
  6. Test by previewing the dataset, or by trending one tag over a short period.

Which Pattern to Use

If the response looks like… Use Example
A list of records rowsPath + emit Users, ServiceNow incidents
A list of records, plus details in a header levels with bind ThingSpeak channel
One array per column zip Daily weather
Readings nested inside series, inside sites levels River gauges
Tag names used as property names levels with bindKey Hourly weather

Shape Examples from Real Services

These examples use real public services, so you can try them against the live API. The responses are shortened. Check the provider's documentation for current details before you rely on a service.

Dataset: Flattening Nested Objects (Users)

Each user record has an address and a company inside it. The shape flattens them into one row per user.

Datasource

Base URL: https://jsonplaceholder.typicode.com

Response from GET /users

[
  {
    "id": 1,
    "name": "Leanne Graham",
    "email": "Sincere@april.biz",
    "address": {
      "street": "Kulas Light",
      "city": "Gwenborough",
      "geo": { "lat": "-37.3159", "lng": "81.1496" }
    },
    "company": { "name": "Romaguera-Crona" }
  }
]

Dataset query

{
  "path": "users",
  "shape": {
    "rowsPath": "$[*]",
    "emit": {
      "Id":        { "path": "id", "type": "int" },
      "Name":      { "path": "name" },
      "Email":     { "path": "email" },
      "City":      { "path": "address.city" },
      "Latitude":  { "path": "address.geo.lat", "type": "decimal" },
      "Company":   { "path": "company.name" }
    }
  }
}
Id Name Email City Latitude Company
1 Leanne Graham Sincere@april.biz Gwenborough -37.3159 Romaguera-Crona
  • The response is an array at the top level, so rowsPath is $[*].
  • Dots reach into nested objects: address.geo.lat.
  • The latitude arrives as text, so "type": "decimal" makes it a number.

Dataset: Business Records with Paging (ServiceNow Incidents)

The ServiceNow Table API returns records in a result array, uses a non-standard date format, and returns a person as an object with a display name. It pages with offset and limit parameters.

Datasource

Base URL:            https://yourinstance.service-now.com/api/now
Authentication Mode: Basic (or OAuth2ClientCredentials)
Request Headers:     Accept: application/json
Paging Style:        OffsetLimit
Offset Parameter:    sysparm_offset
Limit Parameter:     sysparm_limit
Page Size:           500

Response

{
  "result": [
    {
      "number": "INC0010023",
      "short_description": "Compressor C-101 high vibration",
      "priority": "2",
      "state": "In Progress",
      "assigned_to": { "display_value": "Beth Anglin", "link": "https://…" },
      "opened_at": "2026-10-07 08:15:22"
    }
  ]
}

Dataset query

{
  "path": "table/incident?sysparm_query=active=true^assignment_group.name=PARAM(group,string)&sysparm_display_value=true&sysparm_fields=number,short_description,priority,state,assigned_to,opened_at",
  "shape": {
    "rowsPath": "$.result[*]",
    "emit": {
      "Number":      { "path": "number" },
      "Description": { "path": "short_description" },
      "Priority":    { "path": "priority", "type": "int" },
      "State":       { "path": "state" },
      "Assigned To": { "path": "assigned_to.display_value", "default": "Unassigned" },
      "Opened":      { "path": "opened_at", "format": "custom:yyyy-MM-dd HH:mm:ss" }
    }
  }
}
Number Description Priority State Assigned To Opened
INC0010023 Compressor C-101 high vibration 2 In Progress Beth Anglin 07/10/2026 08:15:22
  • PARAM(group,string) lets the Explorer user choose the assignment group.
  • sysparm_display_value=true makes ServiceNow return names instead of internal IDs, so assigned_to.display_value gives the person's name.
  • default fills in Unassigned when nobody is assigned.
  • The date has no time zone, so the custom: format reads it as UTC, which is what the ServiceNow API returns by default.
  • OffsetLimit paging adds sysparm_offset and sysparm_limit to the URL and fetches pages until one comes back with fewer than 500 records. Don't put those parameters in the path yourself.

Dataset: Header Values on Every Row (ThingSpeak IoT Channel)

ThingSpeak returns details about the channel once, followed by its readings. Every reading is text. The shape copies the channel name onto every row.

Datasource

Base URL: https://api.thingspeak.com

Response

{
  "channel": {
    "id": 9,
    "name": "my_house",
    "field1": "Light",
    "field2": "Outside Temperature"
  },
  "feeds": [
    { "created_at": "2026-10-08T01:00:15Z", "entry_id": 101, "field1": "345", "field2": "18.45" },
    { "created_at": "2026-10-08T01:00:30Z", "entry_id": 102, "field1": "351", "field2": null }
  ]
}

Dataset query

{
  "path": "channels/9/feeds.json?results=PARAM(readings,integer)",
  "shape": {
    "levels": [
      { "path": "$", "bind": { "channel": "channel.name" } },
      { "path": "feeds[*]", "emit": {
          "Channel":     { "var": "channel" },
          "Time":        { "path": "created_at", "format": "iso8601" },
          "Light":       { "path": "field1", "type": "decimal" },
          "Temperature": { "path": "field2", "type": "decimal" }
      } }
    ]
  }
}
Channel Time Light Temperature
my_house 08/10/2026 01:00:15 345 18.45
my_house 08/10/2026 01:00:30 351  
  • The first level stays at the top of the response ($) and saves the channel name. The second level walks the readings.
  • The readings are text, so "type": "decimal" turns them into numbers. The null reading becomes an empty cell.
  • The field names (field1, field2) are renamed to meaningful column names.

Dataset: One Array per Column (Daily Weather Forecast)

Open-Meteo returns each measurement as its own array, with the dates in a separate array. Item 1 of each array belongs to the same day. zip lines them up into rows.

Datasource

Base URL: https://api.open-meteo.com/v1

Response

{
  "latitude": -31.95,
  "longitude": 115.86,
  "daily_units": { "temperature_2m_max": "°C", "precipitation_sum": "mm" },
  "daily": {
    "time":               ["2026-10-08", "2026-10-09", "2026-10-10"],
    "temperature_2m_max": [24.1, 26.8, 22.3],
    "temperature_2m_min": [12.4, 14.0, 13.1],
    "precipitation_sum":  [0.0, 0.0, 4.2]
  }
}

Dataset query

{
  "path": "forecast?latitude=-31.95&longitude=115.86&daily=temperature_2m_max,temperature_2m_min,precipitation_sum&timezone=GMT",
  "shape": {
    "zip": {
      "columns": {
        "Location": { "literal": "Perth" },
        "Date":     { "path": "daily.time[*]", "format": "iso8601" },
        "Max (°C)": { "path": "daily.temperature_2m_max[*]", "type": "decimal" },
        "Min (°C)": { "path": "daily.temperature_2m_min[*]", "type": "decimal" },
        "Rain (mm)":{ "path": "daily.precipitation_sum[*]", "type": "decimal" }
      }
    }
  }
}
Location Date Max (°C) Min (°C) Rain (mm)
Perth 08/10/2026 24.1 12.4 0
Perth 09/10/2026 26.8 14.0 0
Perth 10/10/2026 22.3 13.1 4.2
  • Each column with a path reads one array; the arrays are combined item by item.
  • literal adds the same value to every row, which is useful when you combine data from several locations.
  • Dates with no time are read as midnight UTC.

Time Series: Readings Nested Inside Series (River Gauges)

USGS Water Services returns river flow and level readings. Each series has its tag-like name at the top, and its readings two levels further in. Readings are text, and -999999 means "no data".

Datasource

Base URI:              https://waterservices.usgs.gov/nwis
Request Path Template: iv/?format=json&sites=01646500&parameterCd=00060,00065&startDT={startTime}&endDT={endTime}

Response

{
  "value": {
    "timeSeries": [
      {
        "name": "USGS:01646500:00060:00000",
        "sourceInfo": { "siteName": "POTOMAC RIVER NEAR WASH, DC LITTLE FALLS PUMP STA" },
        "variable": {
          "variableDescription": "Discharge, cubic feet per second",
          "unit": { "unitCode": "ft3/s" }
        },
        "values": [ {
          "value": [
            { "value": "10900", "qualifiers": ["P"], "dateTime": "2026-10-07T00:00:00.000-04:00" },
            { "value": "-999999", "qualifiers": ["P", "Ice"], "dateTime": "2026-10-07T00:15:00.000-04:00" }
          ]
        } ]
      }
    ]
  }
}

Shape Configuration

{
  "levels": [
    { "path": "$.value.timeSeries[*]",
      "bind": {
        "tagName": "name",
        "site":    "sourceInfo.siteName",
        "measure": "variable.variableDescription",
        "unit":    "variable.unit.unitCode"
      } },
    { "path": "values[0].value[*]", "emit": {
        "name":        { "var": "tagName" },
        "timestamp":   { "path": "dateTime", "format": "iso8601" },
        "value":       { "path": "value", "type": "decimal",
                         "nullSentinels": ["-999999", "-999999.0"] },
        "description": { "var": "measure" },
        "units":       { "var": "unit" }
    } }
  ]
}
Tag Time (UTC) Value
USGS:01646500:00060:00000 07/10/2026 04:00:00 10900
USGS:01646500:00060:00000 07/10/2026 04:15:00 (no data)
  • The first level visits each series and saves its name, units and description. The second level visits its readings.
  • values[0] picks the first item of the values array, which is where USGS puts the readings.
  • The template uses neither {tag} nor {tags}, so one request returns all series and the readings are matched to tags by name. Create the tags with these exact names, for example USGS:01646500:00065:00000 for gauge height.
  • The extra description and units fields are ignored when reading data, but tag browsing uses them, so browsing shows "Discharge, cubic feet per second" and "ft3/s".
  • Times include a UTC offset (-04:00), so they are converted to UTC correctly.

Time Series: Tag Names as Property Names (Hourly Weather)

For hourly weather, Open-Meteo uses each measurement name as a property inside hourly, next to a shared time array. Using the Open-Meteo variable names as tag names, the shape turns each array into a tag.

Datasource

Base URI:                 https://api.open-meteo.com/v1
Request Path Template:    forecast?latitude=-31.95&longitude=115.86&hourly={tags}&timeformat=unixtime&start_hour={startTime}&end_hour={endTime}
Request Timestamp Format: yyyy-MM-ddTHH:mm
Request Time Zone:        UTC

Response for the tags temperature_2m and wind_speed_10m

{
  "hourly_units": { "time": "unixtime", "temperature_2m": "°C", "wind_speed_10m": "km/h" },
  "hourly": {
    "time":           [1791417600, 1791421200, 1791424800],
    "temperature_2m": [18.3, 19.1, 20.4],
    "wind_speed_10m": [12.2, 14.8, 16.1]
  }
}

Shape Configuration

{
  "levels": [
    { "path": "$.hourly", "bindKey": "tagName",
      "zip": { "columns": {
        "name":      { "var": "tagName" },
        "timestamp": { "path": "$.hourly.time[*]", "format": "unixSeconds" },
        "value":     { "path": "[*]", "type": "decimal" }
      } } }
  ]
}

Tag browsing

Tag Discovery Path:  forecast?latitude=-31.95&longitude=115.86&hourly=temperature_2m,relative_humidity_2m,wind_speed_10m,precipitation&forecast_days=1
Tag Discovery Shape:
{
  "levels": [
    { "path": "$.hourly_units", "bindKey": "tagName", "emit": {
        "name":  { "var": "tagName" },
        "units": { }
    } }
  ]
}
  • bindKey goes through each property of hourly, saving its name (temperature_2m) as tagName and moving into its array.
  • Inside zip, [*] reads the current array, and $.hourly.time[*] reads the shared time array from the top of the response.
  • The time array also becomes a series called time, but it's ignored because no tag has that name.
  • {tags} puts all requested tags into one request, which suits APIs that accept a comma-separated list.
  • Tag browsing reads hourly_units, where each tag name is paired with its unit. The empty field spec { } takes the value itself (the unit text). Browsing also lists time, which you can ignore.

More Examples

Time Series: Flat List

One array of readings, with a nested value and a timestamp in milliseconds.

Response

{ "items": [
  { "id": "PMP-1.run",
    "ts": 1718928000000,
    "reading": { "value": 12.4 },
    "meta": { "q": 100 } }
] }

Shape Configuration

{
  "rowsPath": "$.items[*]",
  "emit": {
    "name":       { "path": "id" },
    "timestamp":  { "path": "ts", "format": "unixMilliseconds" },
    "value":      { "path": "reading.value", "type": "decimal" },
    "confidence": { "path": "meta.q", "type": "int" }
  }
}

Time Series: Tag Names as Keys

The response maps each tag name to its readings. bindKey saves each key as tagName.

Response

{ "data": {
  "TIC-101": [ { "t": "2026-06-21T00:00:00Z", "v": 12.3 } ],
  "FIC-200": [ { "t": "2026-06-21T00:00:00Z", "v": 50.1 } ]
} }

Shape Configuration

{
  "levels": [
    { "path": "$.data", "bindKey": "tagName" },
    { "path": "*", "emit": {
        "name":      { "var": "tagName" },
        "timestamp": { "path": "t", "format": "iso8601" },
        "value":     { "path": "v", "type": "decimal" }
    } }
  ]
}

Time Series: Deeply Nested Readings

The tag name is three levels above the readings, and each reading is an array of [time, value, quality].

Response

{ "facilities": [ {
  "facilityId": "PLANT-1",
  "areas": [ {
    "areaName": "Compression",
    "instruments": [ {
      "tag": "TIC-101",
      "samples": [
        [1718928000, 12.3, 100],
        [1718928060, 12.5, 90]
      ]
    } ]
  } ]
} ] }

Shape Configuration

{
  "levels": [
    { "path": "$.facilities[*]" },
    { "path": "areas[*]" },
    { "path": "instruments[*]",
      "bind": { "tagName": "tag" } },
    { "path": "samples[*]", "emit": {
        "name":       { "var": "tagName" },
        "timestamp":  { "index": 0, "format": "unixSeconds" },
        "value":      { "index": 1, "type": "decimal" },
        "confidence": { "index": 2, "type": "int", "default": 100 }
    } }
  ]
}

Time Series: Separate Arrays with Bad Values

Times and values are in parallel arrays, the time uses a day-first format, and -9999 marks a bad reading.

Response

{ "tag": "FIC-200",
  "trend": {
    "timestamps": ["21/06/2026 08:00:00",
                   "21/06/2026 08:05:00",
                   "21/06/2026 08:10:00"],
    "values":     [50.2, -9999, 50.4],
    "qualities":  [100, 0, 90]
} }

Shape Configuration

{
  "levels": [
    { "path": "$", "bind": { "tagName": "tag" } },
    { "path": "trend", "zip": { "columns": {
        "name":       { "var": "tagName" },
        "timestamp":  { "path": "timestamps[*]",
                        "format": "custom:dd/MM/yyyy HH:mm:ss" },
        "value":      { "path": "values[*]", "type": "decimal",
                        "nullSentinels": [-9999] },
        "confidence": { "path": "qualities[*]", "type": "int" }
    } } }
  ]
}

This produces three readings. The middle one is empty because -9999 is a null sentinel.

Time Series: Current Values Only

The service returns only the latest value for each tag, with no time. Leave timestamp out of the shape; each value is stamped with the end of the requested period.

Request Path Template

current?tags={tags}

Shape Configuration

{
  "rowsPath": "$.values[*]",
  "emit": {
    "name":  { "path": "tag" },
    "value": { "path": "v", "type": "decimal" }
  }
}

Time Series: GraphQL with OAuth2

Datasource settings

Base URI:             https://example.com/graphql
HTTP Method:          POST
Request Body:         {"query":"{ readings(from:\"{startTime}\", to:\"{endTime}\", tags:[{tags}]) { tag ts value } }"}
Authentication Mode:  OAuth2ClientCredentials
OAuth2 Token URL:     https://example.com/oauth/token
OAuth2 Client Id:     (your client ID)
OAuth2 Client Secret: (your client secret)
OAuth2 Scope:         read:timeseries

Shape Configuration

{
  "rowsPath": "$.data.readings[*]",
  "emit": {
    "name":      { "path": "tag" },
    "timestamp": { "path": "ts", "format": "unixSeconds" },
    "value":     { "path": "value", "type": "decimal" }
  }
}

Dataset: Filtered by a Parameter

The dataset has a string parameter called category.

{
  "path": "Products?$filter=CategoryName eq 'PARAM(category,string)'",
  "shape": {
    "rowsPath": "$.value[*]",
    "emit": {
      "ProductID":    { "path": "ProductID", "type": "int" },
      "ProductName":  { "path": "ProductName" },
      "UnitPrice":    { "path": "UnitPrice", "type": "decimal" },
      "Discontinued": { "path": "Discontinued", "type": "bool" }
    }
  }
}

Dataset: List of Selected IDs

The dataset has a multi-value integer parameter called ids.

{
  "path": "Products?$filter=ProductID in (PARAMS(ids,integer))",
  "shape": { "rowsPath": "$.value[*]", "emit": {
    "ProductID":   { "path": "ProductID", "type": "int" },
    "ProductName": { "path": "ProductName" }
  } }
}

Dataset: Nested Data Flattened into One Table

Each department contains its employees. The result has one row per employee, with the department name repeated on each row.

Response

{ "departments": [
  { "name": "Sales", "employees": [
    { "id": 1, "fullName": "A. Smith" },
    { "id": 2, "fullName": "B. Lee" }
  ] }
] }

Dataset query

{
  "path": "org",
  "shape": { "levels": [
    { "path": "$.departments[*]",
      "bind": { "department": "name" } },
    { "path": "employees[*]", "emit": {
        "Department": { "var": "department" },
        "EmployeeId": { "path": "id", "type": "int" },
        "Name":       { "path": "fullName" }
    } }
  ] }
}

Dataset: All Pages of an OData Feed

Set Paging Style to NextLink on the datasource and keep the default Next Link Path. The adaptor follows each @odata.nextLink until the last page.

{
  "path": "Orders?$expand=Customer",
  "shape": { "rowsPath": "$.value[*]", "emit": {
    "OrderId":  { "path": "OrderID", "type": "int" },
    "Customer": { "path": "Customer.CompanyName" },
    "Ordered":  { "path": "OrderDate", "format": "iso8601" }
  } }
}

Dataset: One Display Page from Several API Calls

The display shows 100 rows per page, but the API returns at most 25 rows per call. The adaptor makes as many calls as it needs to fill each display page.

Datasource

Base URL:         https://api.example.com
Paging Style:     OffsetLimit
Offset Parameter: $skip
Limit Parameter:  $top
Page Size:        25

Dataset query

{
  "path": "Products?$orderby=ProductID",
  "params": [
    { "name": "pageNumber", "value": "PARAM(pageNumber,integer)" },
    { "name": "pageSize",   "value": "100" }
  ],
  "shape": { "rowsPath": "$.value[*]", "emit": {
    "ProductID":   { "path": "ProductID", "type": "int" },
    "ProductName": { "path": "ProductName" }
  } }
}

Requests sent for page 2

GET https://api.example.com/Products?$orderby=ProductID&$skip=100&$top=25
GET https://api.example.com/Products?$orderby=ProductID&$skip=125&$top=25
GET https://api.example.com/Products?$orderby=ProductID&$skip=150&$top=25
GET https://api.example.com/Products?$orderby=ProductID&$skip=175&$top=25
  • Page 2 starts at row 101, so the first call starts at $skip=100. The 100 rows of page 1 are not requested again.
  • The datasource's Page Size (25) is the size of each API call. The pageSize entry in params (100) is the size of the display page. Leave pageSize out to use the display's own page size.
  • If a call returns fewer than 25 rows, that is the last page and the adaptor stops early.
  • The adaptor adds $skip and $top itself (URL-encoded, so they are sent as %24skip and %24top). Don't put them in the path.

Troubleshooting

Test Connection fails, but data requests work
Test Connection sends a GET to the Base URL, which many APIs don't serve. Set Verification Path to an endpoint that returns success for a GET.

"The dataset query must be a JSON document with a 'shape'"
The query isn't valid JSON, or it has no shape. Check for missing commas and unescaped quotes. Inside body, write quotes as \".

Some tags return no data in batch mode
With {tags}, the shape must output name, and it must match the tag name exactly apart from case.

A request fails with a conversion error
A field's type or format doesn't match the data, for example "type": "int" on "n/a". Add the bad value to nullSentinels, or use "type": "string".

Times are shifted by a few hours
For requests, check Request Time Zone and include an offset in the timestamp format. For responses, a custom: format with no offset is read as UTC.

A whole-number column shows as decimal
Add "type": "int" to the field.

A column is missing or empty
Check the path against the actual response; paths are case-sensitive. Use ['name'] for property names that contain dots or symbols.

Only part of the data comes back
The API is probably paging. Set Paging Style to match it, and check whether Max Pages was reached.

Where to find error details
Failed requests report the URL and the HTTP status from the service, and timeouts say so. Full details are written to the server log.

Limitations

  • Read-only. Neither adaptor writes data back to the service.
  • Responses must be JSON. XML and CSV are not supported.
  • Paging applies only to GET requests in the Dataset adaptor. The Time Series adaptor makes one call per fetch, or one per tag.
  • The path syntax has no filters, recursive search or slices.
  • PageNumber paging always starts at page 1. APIs that number pages from 0 are not supported.
  • Tag names are inserted into the URL without encoding. Tag names with spaces or symbols such as & or # may need extra care.
  • Loading one page at a time requires the params setup described in Dataset Paging.
  • OAuth2 supports the client-credentials flow only. Flows that sign in as an individual user are not supported.

Comments are closed