{"id":72661,"date":"2026-10-19T12:59:19","date_gmt":"2026-10-19T04:59:19","guid":{"rendered":"https:\/\/oihelp.corporate.ifs.com\/help\/?page_id=72661"},"modified":"2026-11-26T11:58:14","modified_gmt":"2026-11-26T03:58:14","slug":"generic-rest-adaptor","status":"publish","type":"page","link":"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/primers\/datasources\/generic-rest-adaptor\/","title":{"rendered":"Generic REST Adaptor"},"content":{"rendered":"\n<p class=\"left-bar\">This article applies to IFS Cloud 26R2 and later.<\/p>\n<p class=\"intro-text\">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.<\/p>\n<p class=\"left-bar\">Related: <a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/connecting-your-data\/creating-a-dataset-datasource\/\">Dataset Datasources<\/a>, <a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/connecting-your-data\/creating-a-tag-datasource\/\">Tag Datasources<\/a><\/p>\n<h2 id=\"overview\" class=\"page-subheading\">Overview<\/h2>\n<p class=\"intro-text\">Every REST API arranges its JSON differently. The Generic REST adaptors handle this with a <strong>shape configuration<\/strong>: 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.<\/p>\n<p class=\"intro-text\">There are two Generic REST adaptors:<\/p>\n<ul class=\"intro-text\">\n<li><a href=\"#timeseries\"><strong>Generic REST Time Series Adaptor<\/strong><\/a>: Provides tag data, including timestamped values for named tags, for use in trends and other Explorer features that use tag history.<\/li>\n<li><a href=\"#dataset\"><strong>Generic REST Dataset Adaptor<\/strong><\/a>: Provides tabular data in a row-and-column format for use wherever Explorer uses datasets.<\/li>\n<\/ul>\n<p class=\"intro-text\">Both adaptors share the same connection, authentication and shape configuration options. Both are read-only.<\/p>\n<h2 id=\"choose\" class=\"page-subheading\">Choosing an Adaptor<\/h2>\n<p class=\"intro-text\">Choose the adaptor that matches the type of data returned by the REST service and how Explorer will use that data.<\/p>\n<table style=\"width: 72.1703%;\">\n<thead>\n<tr style=\"border: 1px solid #cccccc;\">\n<th style=\"width: 10.17%;\">\u00a0<\/th>\n<th style=\"width: 31.089%;\"><strong>Time Series<\/strong><\/th>\n<th style=\"width: 28.559%;\"><strong>Dataset<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 10.17%;\"><strong>Use it for<\/strong><\/td>\n<td style=\"width: 31.089%;\">Sensor readings, process values: anything with a tag name, a time and a value<\/td>\n<td style=\"width: 28.559%;\">Lists and tables: work orders, assets, events, reference data<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 10.17%;\"><strong>Output<\/strong><\/td>\n<td style=\"width: 31.089%;\">Values per tag: name, timestamp, value, confidence<\/td>\n<td style=\"width: 28.559%;\">A table whose columns you define<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 10.17%;\"><strong>Shape is set<\/strong><\/td>\n<td style=\"width: 31.089%;\">Once, on the datasource<\/td>\n<td style=\"width: 28.559%;\">On each dataset, in its query<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 10.17%;\"><strong>Values filled into the request<\/strong><\/td>\n<td style=\"width: 31.089%;\">{tag}, {tags}, {startTime}, {endTime}<\/td>\n<td style=\"width: 28.559%;\">Dataset parameters through PARAM() and PARAMS()<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 10.17%;\"><strong>Paging<\/strong><\/td>\n<td style=\"width: 31.089%;\">No. Each request is a single time-bounded call<\/td>\n<td style=\"width: 28.559%;\">Yes. Turn on <em>Enable Paging<\/em> in Explorer; see <a href=\"#paging\">Paging<\/a><\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 10.17%;\"><strong>Tag browsing<\/strong><\/td>\n<td style=\"width: 31.089%;\">Yes<\/td>\n<td style=\"width: 28.559%;\">Not applicable<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"intro-text\">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.<\/p>\n<h2 id=\"quickstart\" class=\"page-subheading\">Quick Start<\/h2>\n<p class=\"intro-text\">This example uses a public OData sample service so that you can see the whole flow before connecting your own API.<\/p>\n<ol class=\"intro-text\" type=\"1\">\n<li>Create a datasource that uses the <em>Generic REST Dataset Adaptor<\/em>. Set <strong>Base URL<\/strong> to https:\/\/services.odata.org\/V4\/Northwind\/Northwind.svc and leave <strong>Authentication Mode<\/strong> as <strong>None <\/strong>and set <strong>Paging Style<\/strong> to <strong>NextLink<\/strong>.<\/li>\n<li>Use <em>Test Connection<\/em>. The adaptor sends a GET to the Base URL; a success response marks the datasource as operational.<\/li>\n<li>Create a dataset on the datasource and enter this query:<\/li>\n<\/ol>\n<pre class=\"wrap:true lang:default decode:true\" style=\"font-size: 14px !important;\">{  \r\n  \"path\": \"Products?$top=20\",  \r\n  \"shape\": {  \r\n    \"rowsPath\": \"$.value[*]\",  \r\n    \"emit\": {  \r\n      \"ProductID\":   { \"path\": \"ProductID\", \"type\": \"int\" },  \r\n      \"ProductName\": { \"path\": \"ProductName\" },  \r\n      \"UnitPrice\":   { \"path\": \"UnitPrice\", \"type\": \"decimal\" }  \r\n    }  \r\n  }  \r\n}<\/pre>\n<ol class=\"intro-text\" start=\"4\" type=\"1\">\n<li>Preview the dataset. You should see 20 rows with the columns ProductID, ProductName and UnitPrice.<\/li>\n<\/ol>\n<p class=\"intro-text\">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.<\/p>\n<h2 id=\"connection\" class=\"page-subheading\">Connection and Authentication Settings<\/h2>\n<p class=\"intro-text\">The following connection and authentication settings apply to both the Time Series and Dataset adaptors. The table also shows the corresponding field name and data type used in the Import\/Export spreadsheet. Standard datasource settings, such as name, description, time zone, and timeouts, also apply.<\/p>\n<table>\n<thead>\n<tr style=\"border: 1px solid #cccccc;\">\n<th><strong>Parameter<\/strong><\/th>\n<th><strong>Description and example<\/strong><\/th>\n<th><strong>Name<\/strong><\/th>\n<th><strong>Type<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>Base URI \/ Base URL<\/strong><\/td>\n<td>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.<\/td>\n<td>BaseURI \/ BaseUrl<\/td>\n<td>String<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>HTTP Method<\/strong><\/td>\n<td>GET (default) or POST. Use POST for services that take a request body, such as GraphQL.<\/td>\n<td>HttpMethod<\/td>\n<td>String<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>Request Headers<\/strong><\/td>\n<td>Extra headers, one Name: Value per line. Example: Accept: application\/json.<\/td>\n<td>Headers<\/td>\n<td>String<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>Request Content Type<\/strong><\/td>\n<td>Content type of a POST body. Default: application\/json.<\/td>\n<td>RequestContentType<\/td>\n<td>String<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>Request Timeout (seconds)<\/strong><\/td>\n<td>How long to wait for a response. 0 (default) uses the system default of 100 seconds.<\/td>\n<td>RequestTimeoutSeconds<\/td>\n<td>Integer<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>Verification Path<\/strong><\/td>\n<td>Optional path that <em>Test Connection<\/em> requests instead of the Base URL. Use it when the Base URL itself returns an error.<\/td>\n<td>VerificationPath<\/td>\n<td>String<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>Authentication Mode<\/strong><\/td>\n<td>None (default), Basic, Bearer, ApiKey, OAuth2ClientCredentials or Certificate. Only the settings for the chosen mode are used.<\/td>\n<td>AuthenticationMode<\/td>\n<td>String<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>Username<\/strong><\/td>\n<td>User name for Basic authentication.<\/td>\n<td>Username<\/td>\n<td>String<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>Password<\/strong><\/td>\n<td>Password for Basic authentication.<\/td>\n<td>Password<\/td>\n<td>EncryptedString<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>Bearer Token<\/strong><\/td>\n<td>A fixed token, sent as Authorization: Bearer &lt;token&gt;. Replace it manually when it expires.<\/td>\n<td>BearerToken<\/td>\n<td>EncryptedString<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>API Key Name<\/strong><\/td>\n<td>Name of the header or query-string parameter that carries the API key.<\/td>\n<td>ApiKeyName<\/td>\n<td>String<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>API Key Value<\/strong><\/td>\n<td>The API key.<\/td>\n<td>ApiKeyValue<\/td>\n<td>EncryptedString<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>API Key Location<\/strong><\/td>\n<td>Header (default) or QueryString.<\/td>\n<td>ApiKeyLocation<\/td>\n<td>String<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>OAuth2 Token URL<\/strong><\/td>\n<td>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.<\/td>\n<td>OAuth2TokenUrl<\/td>\n<td>String<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>OAuth2 Client Id<\/strong><\/td>\n<td>Client ID for the client-credentials grant.<\/td>\n<td>OAuth2ClientId<\/td>\n<td>String<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>OAuth2 Client Secret<\/strong><\/td>\n<td>Client secret for the client-credentials grant.<\/td>\n<td>OAuth2ClientSecret<\/td>\n<td>EncryptedString<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>OAuth2 Scope<\/strong><\/td>\n<td>Optional scope for the client-credentials grant.<\/td>\n<td>OAuth2Scope<\/td>\n<td>String<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>Certificate Thumbprint<\/strong><\/td>\n<td>Thumbprint of a client certificate for mutual TLS. The certificate must be installed on the server that runs the adaptor.<\/td>\n<td>CertificateThumbprint<\/td>\n<td>String<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>Certificate Store Location<\/strong><\/td>\n<td>CurrentUser (default) or LocalMachine.<\/td>\n<td>CertificateStoreLocation<\/td>\n<td>String<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 id=\"timeseries\" class=\"page-subheading\">Time Series Adaptor<\/h2>\n<p class=\"intro-text\">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.<\/p>\n<p class=\"intro-text\">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.<\/p>\n<h3 id=\"time-series-adaptor-settings\">Time Series Adaptor Settings<\/h3>\n<p class=\"intro-text\">In addition to the <a href=\"#connection\">connection and authentication settings<\/a>, configure the following settings for the Time Series adaptor.<\/p>\n<table>\n<thead>\n<tr style=\"border: 1px solid #cccccc;\">\n<th><strong>Parameter<\/strong><\/th>\n<th><strong>Description and example<\/strong><\/th>\n<th><strong>Name<\/strong><\/th>\n<th><strong>Type<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>Request Path Template<\/strong><\/td>\n<td>Path and query string appended to the Base URI. Can contain placeholders. Example: trend?tag={tag}&amp;from={startTime}&amp;to={endTime}<\/td>\n<td>RequestPathTemplate<\/td>\n<td>String<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>Request Body<\/strong><\/td>\n<td>POST only. The body to send. Can contain the same placeholders.<\/td>\n<td>RequestBody<\/td>\n<td>String<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>Request Timestamp Format<\/strong><\/td>\n<td>.NET date format used for {startTime} and {endTime}. Default: yyyy-MM-ddTHH:mm:ssZ.<\/td>\n<td>RequestTimestampFormat<\/td>\n<td>String<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>Request Time Zone<\/strong><\/td>\n<td>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.<\/td>\n<td>RequestTimeZone<\/td>\n<td>String<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><a href=\"#shape-configuration\"><strong>Shape Configuration<\/strong><\/a><\/td>\n<td>Required. JSON that finds the name, timestamp, value and confidence in the response.\u00a0<\/td>\n<td>ShapeConfiguration<\/td>\n<td>String<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>Tag Discovery Path<\/strong><\/td>\n<td>Optional path of an endpoint that lists tags. If blank, the Request Path Template is used. Supports {startTime}, {endTime} and {tags}.<\/td>\n<td>TagDiscoveryPath<\/td>\n<td>String<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>Tag Discovery Shape<\/strong><\/td>\n<td>Optional shape for the tag-list response. Outputs name, and optionally description, units, minimum and maximum. If blank, the Shape Configuration is used.<\/td>\n<td>TagDiscoveryShape<\/td>\n<td>String<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>Tag Discovery Headers<\/strong><\/td>\n<td>Optional headers for tag browsing. They replace the Request Headers; authentication still applies.<\/td>\n<td>TagDiscoveryHeaders<\/td>\n<td>String<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>Tag Discovery Content Type<\/strong><\/td>\n<td>Optional content type for a POST discovery body. If blank, the Request Content Type is used.<\/td>\n<td>TagDiscoveryContentType<\/td>\n<td>String<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>Tag Discovery Body<\/strong><\/td>\n<td>Optional POST body for tag browsing. If blank, the Request Body is used.<\/td>\n<td>TagDiscoveryBody<\/td>\n<td>String<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>Tag Discovery Window (hours)<\/strong><\/td>\n<td>How far back {startTime} goes during tag browsing. Default: 24.<\/td>\n<td>TagDiscoveryWindowHours<\/td>\n<td>Integer<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 id=\"request-placeholders\">Request Placeholders<\/h3>\n<p class=\"intro-text\">The adaptor replaces these placeholders in the Request Path Template and Request Body before each call.<\/p>\n<table>\n<thead>\n<tr style=\"border: 1px solid #cccccc;\">\n<th><strong>Placeholder<\/strong><\/th>\n<th><strong>Replaced with<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>{tag}<\/strong><\/td>\n<td>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.<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>{tags}<\/strong><\/td>\n<td>All requested tag names, separated by commas. The adaptor makes one call for all tags, so the shape <strong>must<\/strong> output name to match values to tags. Matching ignores case.<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>{startTime}<\/strong><\/td>\n<td>Start of the requested period, in the Request Timestamp Format and Request Time Zone.<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>{endTime}<\/strong><\/td>\n<td>End of the requested period, formatted the same way.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"intro-text\">If the template uses neither {tag} nor {tags}, the adaptor makes one call and matches the values to tags using the name output by the shape.<\/p>\n<p class=\"note\">Note: If Request Time Zone is set to DatasourceLocal, make sure the timestamp format does not end in Z (UTC). Otherwise, local times are labelled as UTC, causing the data to be shifted.<\/p>\n<h3 id=\"shape-output-for-tag-data\">Shape Output for Tag Data<\/h3>\n<p class=\"intro-text\">The following fields define the output from a Time Series adaptor shape.<\/p>\n<table>\n<thead>\n<tr style=\"border: 1px solid #cccccc;\">\n<th><strong>Field<\/strong><\/th>\n<th><strong>Required<\/strong><\/th>\n<th><strong>Description<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>value<\/strong><\/td>\n<td>Yes<\/td>\n<td>The reading. Numbers, text and true\/false are accepted.<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>timestamp<\/strong><\/td>\n<td>Recommended<\/td>\n<td>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.<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>name<\/strong><\/td>\n<td>With {tags} or no placeholder<\/td>\n<td>The tag name, used to match values to tags.<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>confidence<\/strong><\/td>\n<td>No<\/td>\n<td>Quality from 0 to 100. Default: 100.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 id=\"tag-browsing\">Tag Browsing<\/h3>\n<p class=\"intro-text\">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.<\/p>\n<h2 id=\"dataset\" class=\"page-subheading\">Dataset Adaptor<\/h2>\n<p class=\"intro-text\">The Generic REST Dataset Adaptor returns a table. It uses the <a href=\"#connection\">connection and authentication settings<\/a> and the <a href=\"#paging\">paging settings<\/a>. Configure connection, authentication and paging on the datasource. Configure the request path and the shape on each dataset, because each endpoint returns a different structure.<\/p>\n<h3 id=\"writing-a-dataset-query\">Writing a Dataset Query<\/h3>\n<p class=\"intro-text\">For a Generic REST Dataset Adaptor, the dataset query is a JSON document with the following fields:<\/p>\n<table style=\"width: 100%;\">\n<thead>\n<tr style=\"border: 1px solid #cccccc;\">\n<th style=\"width: 15.1432%;\"><strong>Field<\/strong><\/th>\n<th style=\"width: 17.4625%;\"><strong>Required<\/strong><\/th>\n<th style=\"width: 67.3943%;\"><strong>Description<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 15.1432%;\"><strong>path<\/strong><\/td>\n<td style=\"width: 17.4625%;\">Usually<\/td>\n<td style=\"width: 67.3943%;\">Path and query string appended to the Base URL.<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 15.1432%;\"><strong>body<\/strong><\/td>\n<td style=\"width: 17.4625%;\">For POST<\/td>\n<td style=\"width: 67.3943%;\">The request body, written as a JSON string. Sent when the datasource's HTTP Method is POST.<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 15.1432%;\"><strong>shape<\/strong><\/td>\n<td style=\"width: 17.4625%;\">Yes<\/td>\n<td style=\"width: 67.3943%;\">How to turn the response into rows and columns. See <a href=\"#shape-configuration\">Shape Configuration<\/a>.<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"width: 15.1432%;\"><strong>params<\/strong><\/td>\n<td style=\"width: 17.4625%;\">No<\/td>\n<td style=\"width: 67.3943%;\">An optional list of { \"name\": \u2026, \"value\": \u2026 } entries. Add FIRSTROW() and LASTROW() to this list to make Enable Paging available in Explorer.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"intro-text\">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:<\/p>\n<ul class=\"intro-text\">\n<li>Values of true or false make a Boolean column.<\/li>\n<li>A field with a format makes a Date\/Time column.<\/li>\n<li>A field with \"type\": \"int\" makes an Integer column.<\/li>\n<li>Other numeric values create a Decimal column. This includes whole numbers where no type is specified and values where \"type\": \"long\" is specified.<\/li>\n<li>Anything else makes a Text column.<\/li>\n<\/ul>\n<h3 id=\"parameters\">Parameters<\/h3>\n<p class=\"intro-text\">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.<\/p>\n<p class=\"left-bar\">Related: <a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/connecting-your-data\/creating-a-dataset-datasource\/how-to-write-a-dataset-query\/\">Dataset Queries<\/a><\/p>\n<table>\n<thead>\n<tr style=\"border: 1px solid #cccccc;\">\n<th><strong>Keyword<\/strong><\/th>\n<th><strong>Becomes<\/strong><\/th>\n<th><strong>Example<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>PARAM(name,type)<\/strong><\/td>\n<td>The parameter's value<\/td>\n<td>PARAM(site,string) becomes 2401<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>PARAMS(name,type)<\/strong><\/td>\n<td>All selected values, separated by commas<\/td>\n<td>PARAMS(ids,integer) becomes 1,2,3<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"intro-text\">Values are formatted for a URL:<\/p>\n<ul class=\"intro-text\">\n<li>Text is URL-encoded, so a space becomes %20.<\/li>\n<li>Numbers use a dot as the decimal separator.<\/li>\n<li>Booleans are true or false.<\/li>\n<li>Dates and times are ISO 8601 in the datasource's time zone, including the offset.<\/li>\n<\/ul>\n<p class=\"note\">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.<\/p>\n<h2 id=\"paging\" class=\"page-subheading\">Paging<\/h2>\n<p class=\"intro-text\">Large result sets can be retrieved and displayed a page at a time. Paging for the Generic REST Dataset Adaptor involves two parts:<\/p>\n<ul class=\"intro-text\">\n<li><strong>Service paging.<\/strong> Configure Paging Style and the related settings on the datasource to define how the REST service returns pages of data.<\/li>\n<li><strong>Explorer paging.<\/strong> Add FIRSTROW() and LASTROW() to the dataset query to make Enable Paging available for the dataset.<\/li>\n<\/ul>\n<p class=\"intro-text\">When paging is enabled, the adaptor translates the page requested by Explorer into the requests needed by the REST service, retrieves the required service pages, and returns only the rows for the requested page.<\/p>\n<h3 id=\"paging-settings\">Paging Settings<\/h3>\n<p class=\"intro-text\">These settings are on the Dataset adaptor's datasource, in addition to the <a href=\"#connection\">connection and authentication settings<\/a>.<\/p>\n<table>\n<thead>\n<tr style=\"border: 1px solid #cccccc;\">\n<th><strong>Parameter<\/strong><\/th>\n<th><strong>Description and example<\/strong><\/th>\n<th><strong>Name<\/strong><\/th>\n<th><strong>Type<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>Paging Style<\/strong><\/td>\n<td>How the service pages its results: None (default), NextLink, OffsetLimit or PageNumber. See <a href=\"#paging-styles\">Paging Styles<\/a>.<\/td>\n<td>PagingStyle<\/td>\n<td>String<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>Next Link Path<\/strong><\/td>\n<td>NextLink only. JSONPath to the next page's URL in the response. Default: $['@odata.nextLink']. For a response with a top-level next field, use $.next.<\/td>\n<td>NextLinkPath<\/td>\n<td>String<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>Page Size<\/strong><\/td>\n<td>How many rows the adaptor asks the service for in each call. Default: 100. This is also how the adaptor recognizes the last page: a call that returns fewer rows than this ends the paging. It is not the page size you choose in Explorer.<\/td>\n<td>PageSize<\/td>\n<td>Integer<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>Offset Parameter<\/strong><\/td>\n<td>Name of the query parameter that carries the row offset. Used by OffsetLimit, and by NextLink to jump straight to a page. Default: $skip.<\/td>\n<td>OffsetParameter<\/td>\n<td>String<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>Limit Parameter<\/strong><\/td>\n<td>Name of the query parameter that carries the number of rows to return. Used with the Offset Parameter. Default: $top.<\/td>\n<td>LimitParameter<\/td>\n<td>String<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>Page Parameter<\/strong><\/td>\n<td>PageNumber only. Name of the query parameter that carries the page number. Pages start at 1. Default: page.<\/td>\n<td>PageParameter<\/td>\n<td>String<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>Page Size Parameter<\/strong><\/td>\n<td>PageNumber only. Name of the query parameter that carries the number of rows per page. Default: pageSize.<\/td>\n<td>PageSizeParameter<\/td>\n<td>String<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>Max Pages<\/strong><\/td>\n<td>The most calls the adaptor makes for one request. This stops a faulty service from looping forever. Default: 1000.<\/td>\n<td>MaxPages<\/td>\n<td>Integer<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"intro-text\">When Enable Paging is off, the adaptor normally fetches every service page, up to Max Pages, and returns all rows as one table. With OffsetLimit or PageNumber, do not put offset or page parameters in the dataset path; the adaptor adds them.<\/p>\n<h3 id=\"paging-styles\">Paging Styles<\/h3>\n<p class=\"intro-text\">The following table describes each supported paging style, how it works and which settings it uses.<\/p>\n<table>\n<thead>\n<tr style=\"border: 1px solid #cccccc;\">\n<th><strong>Style<\/strong><\/th>\n<th><strong>How it works<\/strong><\/th>\n<th><strong>Settings used<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>None<\/strong><\/td>\n<td>The adaptor sends a single request to the REST service. If paging is enabled, it returns the requested rows from the response.<\/td>\n<td>None<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>NextLink<\/strong><\/td>\n<td>Each response contains the URL of the next page. The adaptor follows the links until there are none left or it has enough rows. It remembers where each Explorer page ended, so moving to the next page carries on from there instead of starting again at page 1.<\/td>\n<td>Next Link Path. Optionally Offset Parameter and Limit Parameter (see the note below)<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>OffsetLimit<\/strong><\/td>\n<td>The adaptor adds an offset and a limit to the URL and increases the offset until a call returns fewer rows than the Page Size.<\/td>\n<td>Offset Parameter, Limit Parameter, Page Size<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>PageNumber<\/strong><\/td>\n<td>The adaptor adds a page number and a page size to the URL and increases the page number until a call returns fewer rows than the Page Size.<\/td>\n<td>Page Parameter, Page Size Parameter, Page Size<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"note\">Note: For NextLink paging, the adaptor can go to a page it has not reached yet (for example, from page 1 straight to page 5) only if it can build the offset itself. It does this with the Offset Parameter and Limit Parameter. If your service's next links use offset and limit parameters, set these two settings to the names the service uses, for example offset and limit. If the service uses opaque cursors, clear both settings; the adaptor then follows the links from page 1.<\/p>\n<h3 id=\"enable-paging\">Turning on Enable Paging<\/h3>\n<p class=\"intro-text\">Explorer offers <strong>Enable Paging<\/strong> for a dataset when its query contains FIRSTROW() or LASTROW(), the same keywords used by SQL datasets. For a REST dataset, add these keywords to the params list. Explorer fills in these values before sending the request. The values are not passed to the service.<\/p>\n<p class=\"intro-text\">The following example shows a dataset query that includes FIRSTROW() and LASTROW() in the params list to enable paging in Explorer:\u00a0<\/p>\n<pre class=\"wrap:true lang:default decode:true\" style=\"font-size: 14px !important;\">{  \r\n  \"path\": \"form-completions?fields=id,created,modified\",  \r\n  \"totalCountPath\": \"$.count\",  \r\n  \"shape\": {  \r\n    \"rowsPath\": \"$.results[*]\",  \r\n    \"emit\": {  \r\n      \"Id\":       { \"path\": \"id\", \"type\": \"int\" },  \r\n      \"Created\":  { \"path\": \"created\", \"type\": \"datetime\", \"format\": \"iso8601\" },  \r\n      \"Modified\": { \"path\": \"modified\", \"type\": \"datetime\",\"format\": \"iso8601\" }  \r\n    }  \r\n  },  \r\n  \"params\": [  \r\n    { \"name\": \"firstRow\", \"value\": \"FIRSTROW()\" },  \r\n    { \"name\": \"lastRow\",  \"value\": \"LASTROW()\" }  \r\n  ]  \r\n}<\/pre>\n<p class=\"intro-text\">In this example, the datasource uses <strong>NextLink<\/strong> as the Paging Style and <strong>$.next<\/strong> as the Next Link Path.<\/p>\n<ol class=\"intro-text\" type=\"1\">\n<li>In Explorer, bind the dataset to a table or grid and turn on <em>Enable Paging<\/em>. Explorer adds <em>Page Number<\/em> and <em>Page Size<\/em> and a paging control.<\/li>\n<li>When you move to a page, Explorer sends the page number and page size.<\/li>\n<li>The adaptor fetches only the service pages it needs to fill that page and returns those rows.<\/li>\n<\/ol>\n<p class=\"intro-text\">The same steps work for every paging style. POST requests are not paged: the adaptor sends the request once and slices the result.<\/p>\n<h3 id=\"total-count\">Showing the Number of Pages<\/h3>\n<p class=\"intro-text\">Explorer shows <em>Page 1 of n<\/em> only if it knows how many rows there are in total. Most services include the total in each response. To show the number of pages, add <strong>totalCountPath<\/strong> to the dataset query, next to shape. It is a JSONPath to the total number of rows across all pages.<\/p>\n<p class=\"intro-text\">For example, if the response is:<\/p>\n<pre class=\"wrap:true lang:default decode:true\" style=\"font-size: 14px !important;\">{  \r\n  \"count\": 484,  \r\n  \"next\": \"https:\/\/api.example.com\/v1\/form-completions?limit=25&amp;offset=25\",  \r\n  \"previous\": null,  \r\n  \"results\": [ ... ]  \r\n}<\/pre>\n<p class=\"intro-text\">Use: \"totalCountPath\": \"$.count\"<\/p>\n<p class=\"intro-text\">For an OData service, use: \"$['@odata.count']\"<\/p>\n<ul class=\"intro-text\">\n<li>The path must lead to a whole number, either a JSON number or text containing one. Negative and fractional values are ignored.<\/li>\n<li>The adaptor reads the total from the first response where the path finds a value.<\/li>\n<li>If <strong>totalCountPath<\/strong> is missing or does not find a value, paging still works, but the total is blank and Explorer shows <em>Page 1 of n\/a<\/em>.<\/li>\n<li>Some services only include the total when you ask for it, for example <strong>$count=true<\/strong> in an OData query. Add that to the dataset path.<\/li>\n<\/ul>\n<h3 id=\"dataset-query-reference\">Dataset Query Reference<\/h3>\n<p class=\"intro-text\">The following table summarises the supported keys in a Generic REST Dataset Adaptor query.<\/p>\n<table>\n<thead>\n<tr style=\"border: 1px solid #cccccc;\">\n<th><strong>Key<\/strong><\/th>\n<th><strong>Description<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>path<\/strong><\/td>\n<td>Path and query string appended to the Base URL. For POST, use body instead of, or as well as, path.<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>shape<\/strong><\/td>\n<td>Required. How to turn the response into rows and columns. See <a href=\"#shape-configuration\">Shape Configuration<\/a>.<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>params<\/strong><\/td>\n<td>Optional list of named values, each with a name and a value. Use it to hold FIRSTROW() and LASTROW(), which turn on Enable Paging.<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>totalCountPath<\/strong><\/td>\n<td>Optional JSONPath to the total number of rows in the response. Used to show the number of pages.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"left-bar\">Related: <a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/connecting-your-data\/creating-a-dataset-datasource\/how-to-write-a-dataset-query\/how-to-write-a-paged-query\/\">Paged Queries<\/a><\/p>\n<h2 id=\"shape-configuration\" class=\"page-subheading\">Shape Configuration<\/h2>\n<p class=\"intro-text\">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.<\/p>\n<h3 id=\"patterns\">Patterns<\/h3>\n<p class=\"intro-text\">Use exactly one pattern. If more than one is present, the first in this table is used.<\/p>\n<table>\n<thead>\n<tr style=\"border: 1px solid #cccccc;\">\n<th><strong>Pattern<\/strong><\/th>\n<th><strong>Response Structure<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>levels<\/strong><\/td>\n<td>\n<div>Nested data, such as rows inside rows, a tag name several levels above the values, or a tag name used as an object key<\/div>\n<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>zip<\/strong><\/td>\n<td>Each column is held in its own array, for example timestamps[] next to values[]<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>rowsPath + emit<\/strong><\/td>\n<td>One list where each item is a row. This is the most common case<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>emit<\/strong><\/td>\n<td>A single object that should become one row<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 id=\"finding-a-value\">Finding a Value<\/h3>\n<p class=\"intro-text\">Each output field is defined by an entry in <strong>emit<\/strong>, or in<strong> zip.columns<\/strong> when using the zip pattern. The entry names the output field and specifies where its value comes from:<\/p>\n<table>\n<thead>\n<tr style=\"border: 1px solid #cccccc;\">\n<th><strong>Key<\/strong><\/th>\n<th><strong>Takes the value from<\/strong><\/th>\n<th><strong>Example<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>path<\/strong><\/td>\n<td>A path inside the current item<\/td>\n<td>{ \"path\": \"meta.quality\" }<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>index<\/strong><\/td>\n<td>A position, when the item is an array such as [time, value, quality]<\/td>\n<td>{ \"index\": 1 }<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>var<\/strong><\/td>\n<td>A variable saved at an outer level (see levels)<\/td>\n<td>{ \"var\": \"tagName\" }<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>literal<\/strong><\/td>\n<td>A fixed value<\/td>\n<td>{ \"literal\": \"PLANT-1\" }<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 id=\"converting-values\">Converting Values<\/h3>\n<p class=\"intro-text\">Use format, type, nullSentinels and default in a field definition to control how response values are converted and handled.<\/p>\n<table>\n<thead>\n<tr style=\"border: 1px solid #cccccc;\">\n<th><strong>Key<\/strong><\/th>\n<th><strong>Values<\/strong><\/th>\n<th><strong>Description<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>format<\/strong><\/td>\n<td>iso8601, unixSeconds, unixMilliseconds, or custom: plus a .NET pattern, such as custom:dd\/MM\/yyyy HH:mm:ss<\/td>\n<td>Reads the value as a date and time. Always set this on timestamp. A custom pattern with no offset is read as UTC.<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>type<\/strong><\/td>\n<td>decimal, double, int, long, bool, string<\/td>\n<td>Reads the value as that type. A value that can't be converted fails the whole request.<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>nullSentinels<\/strong><\/td>\n<td>A list, for example [-9999, \"N\/A\"]<\/td>\n<td>Treats these values as empty. Matching ignores case.<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>default<\/strong><\/td>\n<td>Any value<\/td>\n<td>Used when the field is missing, null, or matches a null sentinel.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"intro-text\">Use <strong>format<\/strong> for date and time values and <strong>type<\/strong> for other value types. If neither is specified, the value is returned as it appears in the JSON response.<\/p>\n<h3 id=\"nested-responses-levels\">Nested Responses (levels)<\/h3>\n<p class=\"intro-text\">The <strong>levels<\/strong> configuration defines a list of steps that move from the outermost part of the response inward. Each step can include:<\/p>\n<ul class=\"intro-text\">\n<li>Use <strong>path<\/strong> to specify the items to process at the current level. The first step is relative to the whole response, while later steps are relative to the item from the previous step.<\/li>\n<li>Use <strong>bind<\/strong> to save values for use at later levels, in the form { \"variableName\": \"path\" }. Use var to read the saved values later.<\/li>\n<li>Use <strong>bindKey<\/strong> when the tag name is an object key rather than a field. The adaptor processes each key, saves the key under the specified variable name, and then moves into its value.<\/li>\n<li>Use <strong>emit<\/strong> or <strong>zip<\/strong> only on the last step to produce the rows.<\/li>\n<\/ul>\n<h3 id=\"columnar-responses-zip\">Columnar Responses (zip)<\/h3>\n<p class=\"intro-text\">The <strong>zip.columns<\/strong> configuration 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 <strong>var<\/strong> or <strong>literal<\/strong> repeats the same value on every row. The <strong>onRagged<\/strong> setting controls what happens when the arrays have different lengths:<\/p>\n<ul class=\"intro-text\">\n<li>Set <strong>onRagged<\/strong> to <strong>truncate<\/strong> (default) to stop at the shortest array.<\/li>\n<li>Set <strong>onRagged<\/strong> to <strong>pad<\/strong> to continue to the longest array and fill missing values with empty values.<\/li>\n<li>Set <strong>onRagged<\/strong> to <strong>fail<\/strong> to return an error.<\/li>\n<\/ul>\n<h3 id=\"path-syntax\">Path Syntax<\/h3>\n<p class=\"intro-text\">Use the following path syntax to select values from a JSON response.<\/p>\n<table>\n<thead>\n<tr style=\"border: 1px solid #cccccc;\">\n<th><strong>Write<\/strong><\/th>\n<th><strong>To select<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>name, a.b.c<\/strong><\/td>\n<td>A property, or a property inside a property<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>['@odata.count']<\/strong><\/td>\n<td>A property whose name contains dots, spaces or other symbols<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>items[0]<\/strong><\/td>\n<td>One array item by position, starting at 0<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>items[*]<\/strong><\/td>\n<td>Every item in an array<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>*<\/strong><\/td>\n<td>Every item, or every property value, of the current item<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>$.data<\/strong><\/td>\n<td>A path from the top of the response, not from the current item<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>empty, $ or @<\/strong><\/td>\n<td>The current item itself<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"note\">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.<\/p>\n<h2 id=\"building\" class=\"page-subheading\">Building a Shape<\/h2>\n<p class=\"intro-text\">Writing a shape is easier if you look at the real response first. Follow these steps:<\/p>\n<ol class=\"intro-text\" type=\"1\">\n<li><strong>Call the API<\/strong> in a browser or a tool such as Postman, using the same URL and sign-in as the datasource, and copy the response.<\/li>\n<li><strong>Find the repeating part.<\/strong> Look for the array that has one item per row (or per reading). Its path becomes rowsPath, or the path of the last level.<\/li>\n<li><strong>Find each value relative to one item.<\/strong> Inside emit, paths start from a single array item, not from the top of the response.<\/li>\n<li><strong>Find values that sit outside the repeating part<\/strong>, 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.<\/li>\n<li><strong>Add type and format<\/strong> to ensure values are interpreted correctly.\u00a0<\/li>\n<li><strong>Test<\/strong> by previewing the dataset, or by trending one tag over a short period.<\/li>\n<\/ol>\n<h3 id=\"which-pattern-to-use\">Which Pattern to Use<\/h3>\n<p class=\"intro-text\">Choose the pattern that matches the structure of the response. The following table maps common response structures to the appropriate pattern and example.<\/p>\n<table>\n<thead>\n<tr style=\"border: 1px solid #cccccc;\">\n<th><strong>Response Structure<\/strong><\/th>\n<th><strong>Use<\/strong><\/th>\n<th><strong>Example<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>A list of records<\/strong><\/td>\n<td>rowsPath + emit<\/td>\n<td><a href=\"#ex-users\">Users<\/a>, <a href=\"#ex-servicenow\">ServiceNow incidents<\/a><\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>A list of records, plus details in a header<\/strong><\/td>\n<td>levels with bind<\/td>\n<td><a href=\"#ex-thingspeak\">ThingSpeak channel<\/a><\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>One array per column<\/strong><\/td>\n<td>zip<\/td>\n<td><a href=\"#ex-weather-daily\">Daily weather<\/a><\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>Readings nested inside series, inside sites<\/strong><\/td>\n<td>levels<\/td>\n<td><a href=\"#ex-usgs\">River gauges<\/a><\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td><strong>Tag names used as property names<\/strong><\/td>\n<td>levels with bindKey<\/td>\n<td><a href=\"#ex-weather-hourly\">Hourly weather<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 id=\"real-examples\" class=\"page-subheading\">Shape Configuration Examples<\/h2>\n<p class=\"intro-text\">Some\u00a0examples in this section use public services so that you can try the shape configurations against a live API. The responses shown are shortened. Check the provider\u2019s documentation for the latest details before relying on the service.<\/p>\n<h3 id=\"dataset-examples\">Dataset Examples<\/h3>\n<h4 id=\"ex-users\">Dataset: Flattening Nested Objects (Users)<\/p>\n<\/h4>\n<p class=\"intro-text\">Each user record has an address and a company inside it. The shape flattens them into one row per user.<\/p>\n<p><strong>Datasource<\/strong><\/p>\n<pre class=\"wrap:true lang:default decode:true\" style=\"font-size: 14px !important;\">Base URL: https:\/\/jsonplaceholder.typicode.com<\/pre>\n<p><strong>Response from GET \/users<\/strong><\/p>\n<pre class=\"wrap:true lang:default decode:true\" style=\"font-size: 14px !important;\">[  \r\n  {  \r\n    \"id\": 1,  \r\n    \"name\": \"Leanne Graham\",  \r\n    \"email\": \"Sincere@april.biz\",  \r\n    \"address\": {  \r\n      \"street\": \"Kulas Light\",  \r\n      \"city\": \"Gwenborough\",  \r\n      \"geo\": { \"lat\": \"-37.3159\", \"lng\": \"81.1496\" }  \r\n    },  \r\n    \"company\": { \"name\": \"Romaguera-Crona\" }  \r\n  }  \r\n]<\/pre>\n<p><strong>Dataset query<\/strong><\/p>\n<pre class=\"wrap:true lang:default decode:true\" style=\"font-size: 14px !important;\">{  \r\n  \"path\": \"users\",  \r\n  \"shape\": {  \r\n    \"rowsPath\": \"$[*]\",  \r\n    \"emit\": {  \r\n      \"Id\":        { \"path\": \"id\", \"type\": \"int\" },  \r\n      \"Name\":      { \"path\": \"name\" },  \r\n      \"Email\":     { \"path\": \"email\" },  \r\n      \"City\":      { \"path\": \"address.city\" },  \r\n      \"Latitude\":  { \"path\": \"address.geo.lat\", \"type\": \"decimal\" },  \r\n      \"Company\":   { \"path\": \"company.name\" }  \r\n    }  \r\n  }  \r\n}<\/pre>\n<table>\n<thead>\n<tr style=\"border: 1px solid #cccccc;\">\n<th><strong>Id<\/strong><\/th>\n<th><strong>Name<\/strong><\/th>\n<th><strong>Email<\/strong><\/th>\n<th><strong>City<\/strong><\/th>\n<th><strong>Latitude<\/strong><\/th>\n<th><strong>Company<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"border: 1px solid #cccccc;\">\n<td>1<\/td>\n<td>Leanne Graham<\/td>\n<td>Sincere@april.biz<\/td>\n<td>Gwenborough<\/td>\n<td>-37.3159<\/td>\n<td>Romaguera-Crona<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<ul class=\"intro-text\">\n<li>The response is an array at the top level, so rowsPath is $[*].<\/li>\n<li>Use dot notation to access values in nested objects, for example address.geo.lat.<\/li>\n<li>The latitude arrives as text, so \"type\": \"decimal\" makes it a number.<\/li>\n<\/ul>\n<h4 id=\"ex-servicenow\">Dataset: Business Records with Paging (ServiceNow Incidents)<\/p>\n<\/h4>\n<p class=\"intro-text\">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.<\/p>\n<p><strong>Datasource<\/strong><\/p>\n<pre class=\"wrap:true lang:default decode:true\" style=\"font-size: 14px !important;\">Base URL:            https:\/\/yourinstance.service-now.com\/api\/now  \r\nAuthentication Mode: Basic (or OAuth2ClientCredentials)  \r\nRequest Headers:     Accept: application\/json  \r\nPaging Style:        OffsetLimit  \r\nOffset Parameter:    sysparm_offset  \r\nLimit Parameter:     sysparm_limit  \r\nPage Size:           500<\/pre>\n<p><strong>Response<\/strong><\/p>\n<pre class=\"wrap:true lang:default decode:true\" style=\"font-size: 14px !important;\">{  \r\n  \"result\": [  \r\n    {  \r\n      \"number\": \"INC0010023\",  \r\n      \"short_description\": \"Compressor C-101 high vibration\",  \r\n      \"priority\": \"2\",  \r\n      \"state\": \"In Progress\",  \r\n      \"assigned_to\": { \"display_value\": \"Beth Anglin\", \"link\": \"https:\/\/\u2026\" },  \r\n      \"opened_at\": \"2026-10-07 08:15:22\"  \r\n    }  \r\n  ]  \r\n}<\/pre>\n<p><strong>Dataset query<\/strong><\/p>\n<pre class=\"wrap:true lang:default decode:true\" style=\"font-size: 14px !important;\">{  \r\n  \"path\": \"table\/incident?sysparm_query=active=true^assignment_group.name=PARAM(group,string)&amp;sysparm_display_value=true&amp;sysparm_fields=number,short_description,priority,state,assigned_to,opened_at\",  \r\n  \"shape\": {  \r\n    \"rowsPath\": \"$.result[*]\",  \r\n    \"emit\": {  \r\n      \"Number\":      { \"path\": \"number\" },  \r\n      \"Description\": { \"path\": \"short_description\" },  \r\n      \"Priority\":    { \"path\": \"priority\", \"type\": \"int\" },  \r\n      \"State\":       { \"path\": \"state\" },  \r\n      \"Assigned To\": { \"path\": \"assigned_to.display_value\", \"default\": \"Unassigned\" },  \r\n      \"Opened\":      { \"path\": \"opened_at\", \"format\": \"custom:yyyy-MM-dd HH:mm:ss\" }  \r\n    }  \r\n  }  \r\n}<\/pre>\n<table>\n<thead>\n<tr style=\"border: 1px solid #cccccc;\">\n<th><strong>Number<\/strong><\/th>\n<th><strong>Description<\/strong><\/th>\n<th><strong>Priority<\/strong><\/th>\n<th><strong>State<\/strong><\/th>\n<th><strong>Assigned To<\/strong><\/th>\n<th><strong>Opened<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"border: 1px solid #cccccc;\">\n<td>INC0010023<\/td>\n<td>Compressor C-101 high vibration<\/td>\n<td>2<\/td>\n<td>In Progress<\/td>\n<td>Beth Anglin<\/td>\n<td>07\/10\/2026 08:15:22<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<ul class=\"intro-text\">\n<li>PARAM(group,string) lets the Explorer user choose the assignment group.<\/li>\n<li>Setting sysparm_display_value=true makes ServiceNow return names instead of internal IDs, so assigned_to.display_value gives the person's name.<\/li>\n<li>The default field fills in <em>Unassigned<\/em> when nobody is assigned.<\/li>\n<li>The date does not include a time zone, so the <strong>custom:<\/strong> format interprets it as UTC, which is the default time zone used by the ServiceNow API.<\/li>\n<li>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.<\/li>\n<\/ul>\n<h4 id=\"ex-thingspeak\">Dataset: Header Values on Every Row (ThingSpeak IoT Channel)<\/p>\n<\/h4>\n<p class=\"intro-text\">ThingSpeak returns details about the channel once, followed by its readings. Every reading is text. The shape copies the channel name onto every row.<\/p>\n<p><strong>Datasource<\/strong><\/p>\n<pre class=\"wrap:true lang:default decode:true\" style=\"font-size: 14px !important;\">Base URL: https:\/\/api.thingspeak.com<\/pre>\n<p><strong>Response<\/strong><\/p>\n<pre class=\"wrap:true lang:default decode:true\" style=\"font-size: 14px !important;\">{  \r\n  \"channel\": {  \r\n    \"id\": 9,  \r\n    \"name\": \"my_house\",  \r\n    \"field1\": \"Light\",  \r\n    \"field2\": \"Outside Temperature\"  \r\n  },  \r\n  \"feeds\": [  \r\n    { \"created_at\": \"2026-10-08T01:00:15Z\", \"entry_id\": 101, \"field1\": \"345\", \"field2\": \"18.45\" },  \r\n    { \"created_at\": \"2026-10-08T01:00:30Z\", \"entry_id\": 102, \"field1\": \"351\", \"field2\": null }  \r\n  ]  \r\n}<\/pre>\n<p><strong>Dataset query<\/strong><\/p>\n<pre class=\"wrap:true lang:default decode:true\" style=\"font-size: 14px !important;\">{  \r\n  \"path\": \"channels\/9\/feeds.json?results=PARAM(readings,integer)\",  \r\n  \"shape\": {  \r\n    \"levels\": [  \r\n      { \"path\": \"$\", \"bind\": { \"channel\": \"channel.name\" } },  \r\n      { \"path\": \"feeds[*]\", \"emit\": {  \r\n          \"Channel\":     { \"var\": \"channel\" },  \r\n          \"Time\":        { \"path\": \"created_at\", \"format\": \"iso8601\" },  \r\n          \"Light\":       { \"path\": \"field1\", \"type\": \"decimal\" },  \r\n          \"Temperature\": { \"path\": \"field2\", \"type\": \"decimal\" }  \r\n      } }  \r\n    ]  \r\n  }  \r\n}<\/pre>\n<table>\n<thead>\n<tr style=\"border: 1px solid #cccccc;\">\n<th><strong>Channel<\/strong><\/th>\n<th><strong>Time<\/strong><\/th>\n<th><strong>Light<\/strong><\/th>\n<th><strong>Temperature<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"border: 1px solid #cccccc;\">\n<td>my_house<\/td>\n<td>08\/10\/2026 01:00:15<\/td>\n<td>345<\/td>\n<td>18.45<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td>my_house<\/td>\n<td>08\/10\/2026 01:00:30<\/td>\n<td>351<\/td>\n<td>&nbsp;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<ul class=\"intro-text\">\n<li>The first level stays at the top of the response ($) and saves the channel name. The second level walks the readings.<\/li>\n<li>The readings are returned as text. \"type\": \"decimal\" converts them to decimal values. The null reading becomes an empty cell.<\/li>\n<li>The field names (field1, field2) are renamed to meaningful column names.<\/li>\n<\/ul>\n<h4 id=\"ex-weather-daily\">Dataset: One Array per Column (Daily Weather Forecast)<\/p>\n<\/h4>\n<p class=\"intro-text\">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.<\/p>\n<p><strong>Datasource<\/strong><\/p>\n<pre class=\"wrap:true lang:default decode:true\" style=\"font-size: 14px !important;\">Base URL: https:\/\/api.open-meteo.com\/v1<\/pre>\n<p><strong>Response<\/strong><\/p>\n<pre class=\"wrap:true lang:default decode:true\" style=\"font-size: 14px !important;\">{  \r\n  \"latitude\": -31.95,  \r\n  \"longitude\": 115.86,  \r\n  \"daily_units\": { \"temperature_2m_max\": \"\u00b0C\", \"precipitation_sum\": \"mm\" },  \r\n  \"daily\": {  \r\n    \"time\":               [\"2026-10-08\", \"2026-10-09\", \"2026-10-10\"],  \r\n    \"temperature_2m_max\": [24.1, 26.8, 22.3],  \r\n    \"temperature_2m_min\": [12.4, 14.0, 13.1],  \r\n    \"precipitation_sum\":  [0.0, 0.0, 4.2]  \r\n  }  \r\n}<\/pre>\n<p><strong>Dataset query<\/strong><\/p>\n<pre class=\"wrap:true lang:default decode:true\" style=\"font-size: 14px !important;\">{  \r\n  \"path\": \"forecast?latitude=-31.95&amp;longitude=115.86&amp;daily=temperature_2m_max,temperature_2m_min,precipitation_sum&amp;timezone=GMT\",  \r\n  \"shape\": {  \r\n    \"zip\": {  \r\n      \"columns\": {  \r\n        \"Location\": { \"literal\": \"Perth\" },  \r\n        \"Date\":     { \"path\": \"daily.time[*]\", \"format\": \"iso8601\" },  \r\n        \"Max (\u00b0C)\": { \"path\": \"daily.temperature_2m_max[*]\", \"type\": \"decimal\" },  \r\n        \"Min (\u00b0C)\": { \"path\": \"daily.temperature_2m_min[*]\", \"type\": \"decimal\" },  \r\n        \"Rain (mm)\":{ \"path\": \"daily.precipitation_sum[*]\", \"type\": \"decimal\" }  \r\n      }  \r\n    }  \r\n  }  \r\n}<\/pre>\n<table>\n<thead>\n<tr style=\"border: 1px solid #cccccc;\">\n<th><strong>Location<\/strong><\/th>\n<th><strong>Date<\/strong><\/th>\n<th><strong>Max (\u00b0C)<\/strong><\/th>\n<th><strong>Min (\u00b0C)<\/strong><\/th>\n<th><strong>Rain (mm)<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"border: 1px solid #cccccc;\">\n<td>Perth<\/td>\n<td>08\/10\/2026<\/td>\n<td>24.1<\/td>\n<td>12.4<\/td>\n<td>0<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td>Perth<\/td>\n<td>09\/10\/2026<\/td>\n<td>26.8<\/td>\n<td>14.0<\/td>\n<td>0<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td>Perth<\/td>\n<td>10\/10\/2026<\/td>\n<td>22.3<\/td>\n<td>13.1<\/td>\n<td>4.2<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<ul class=\"intro-text\">\n<li>Each column with a path reads one array; the arrays are combined item by item.<\/li>\n<li>The literal field adds the same value to every row, which is useful when you combine data from several locations.<\/li>\n<li>Dates with no time are read as midnight UTC.<\/li>\n<\/ul>\n<h4 id=\"dataset-filtered-by-a-parameter\">Dataset: Filtered by a Parameter<\/p>\n<\/h4>\n<p class=\"intro-text\">The dataset has a string parameter called category.<\/p>\n<pre class=\"wrap:true lang:default decode:true\" style=\"font-size: 14px !important;\">{  \r\n  \"path\": \"Products?$filter=CategoryName eq 'PARAM(category,string)'\",  \r\n  \"shape\": {  \r\n    \"rowsPath\": \"$.value[*]\",  \r\n    \"emit\": {  \r\n      \"ProductID\":    { \"path\": \"ProductID\", \"type\": \"int\" },  \r\n      \"ProductName\":  { \"path\": \"ProductName\" },  \r\n      \"UnitPrice\":    { \"path\": \"UnitPrice\", \"type\": \"decimal\" },  \r\n      \"Discontinued\": { \"path\": \"Discontinued\", \"type\": \"bool\" }  \r\n    }  \r\n  }  \r\n}<\/pre>\n<h4 id=\"dataset-list-of-selected-ids\">Dataset: List of Selected IDs<\/p>\n<\/h4>\n<p class=\"intro-text\">The dataset has a multi-value integer parameter called ids.<\/p>\n<pre class=\"wrap:true lang:default decode:true\" style=\"font-size: 14px !important;\">{  \r\n  \"path\": \"Products?$filter=ProductID in (PARAMS(ids,integer))\",  \r\n  \"shape\": { \"rowsPath\": \"$.value[*]\", \"emit\": {  \r\n    \"ProductID\":   { \"path\": \"ProductID\", \"type\": \"int\" },  \r\n    \"ProductName\": { \"path\": \"ProductName\" }  \r\n  } }  \r\n}<\/pre>\n<h4 id=\"dataset-nested-data-flattened-into-one-table\">Dataset: Nested Data Flattened into One Table<\/p>\n<\/h4>\n<p class=\"intro-text\">Each department contains its employees. The result has one row per employee, with the department name repeated on each row.<\/p>\n<p><strong>Response<\/strong><\/p>\n<pre class=\"wrap:true lang:default decode:true\" style=\"font-size: 14px !important;\">{ \"departments\": [  \r\n  { \"name\": \"Sales\", \"employees\": [  \r\n    { \"id\": 1, \"fullName\": \"A. Smith\" },  \r\n    { \"id\": 2, \"fullName\": \"B. Lee\" }  \r\n  ] }  \r\n] }<\/pre>\n<p><strong>Dataset query<\/strong><\/p>\n<pre class=\"wrap:true lang:default decode:true\" style=\"font-size: 14px !important;\">{  \r\n  \"path\": \"org\",  \r\n  \"shape\": { \"levels\": [  \r\n    { \"path\": \"$.departments[*]\",  \r\n      \"bind\": { \"department\": \"name\" } },  \r\n    { \"path\": \"employees[*]\", \"emit\": {  \r\n        \"Department\": { \"var\": \"department\" },  \r\n        \"EmployeeId\": { \"path\": \"id\", \"type\": \"int\" },  \r\n        \"Name\":       { \"path\": \"fullName\" }  \r\n    } }  \r\n  ] }  \r\n}<\/pre>\n<h4 id=\"dataset-all-pages-of-an-odata-feed\">Dataset: All Pages of an OData Feed<\/p>\n<\/h4>\n<p class=\"intro-text\">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.<\/p>\n<pre class=\"wrap:true lang:default decode:true\" style=\"font-size: 14px !important;\">{  \r\n  \"path\": \"Orders?$expand=Customer\",  \r\n  \"shape\": { \"rowsPath\": \"$.value[*]\", \"emit\": {  \r\n    \"OrderId\":  { \"path\": \"OrderID\", \"type\": \"int\" },  \r\n    \"Customer\": { \"path\": \"Customer.CompanyName\" },  \r\n    \"Ordered\":  { \"path\": \"OrderDate\", \"format\": \"iso8601\" }  \r\n  } }  \r\n}<\/pre>\n<h3 id=\"time-series-examples\">Time Series Examples<\/h3>\n<h4 id=\"ex-usgs\">Time Series: Readings Nested Inside Series (River Gauges)<\/p>\n<\/h4>\n<p class=\"intro-text\">USGS Water Services returns river flow and level readings. Each series has its tag-like name at the top of the response, while its readings are nested two levels further in.<\/p>\n<p><strong>Datasource<\/strong><\/p>\n<pre class=\"wrap:true lang:default decode:true\" style=\"font-size: 14px !important;\">Base URI: https:\/\/waterservices.usgs.gov\/nwis  \r\nRequest Path Template: iv\/?format=json&amp;sites=01646500&amp;parameterCd=00060,00065&amp;startDT={startTime}&amp;endDT={endTime}<\/pre>\n<p><strong>Response<\/strong><\/p>\n<pre class=\"wrap:true lang:default decode:true\" style=\"font-size: 14px !important;\">{  \r\n  \"value\": {  \r\n    \"timeSeries\": [  \r\n      {  \r\n        \"name\": \"USGS:01646500:00060:00000\",  \r\n        \"sourceInfo\": { \"siteName\": \"POTOMAC RIVER NEAR WASH, DC LITTLE FALLS PUMP STA\" },  \r\n        \"variable\": {  \r\n          \"variableDescription\": \"Discharge, cubic feet per second\",  \r\n          \"unit\": { \"unitCode\": \"ft3\/s\" }  \r\n        },  \r\n        \"values\": [ {  \r\n          \"value\": [  \r\n            { \"value\": \"10900\", \"qualifiers\": [\"P\"], \"dateTime\": \"2026-10-07T00:00:00.000-04:00\" },  \r\n            { \"value\": \"-999999\", \"qualifiers\": [\"P\", \"Ice\"], \"dateTime\": \"2026-10-07T00:15:00.000-04:00\" }  \r\n          ]  \r\n        } ]  \r\n      }  \r\n    ]  \r\n  }  \r\n}<\/pre>\n<p><strong>Shape Configuration<\/strong><\/p>\n<pre class=\"wrap:true lang:default decode:true\" style=\"font-size: 14px !important;\">{  \r\n  \"levels\": [  \r\n    { \"path\": \"$.value.timeSeries[*]\",  \r\n      \"bind\": {  \r\n        \"tagName\": \"name\",  \r\n        \"site\":    \"sourceInfo.siteName\",  \r\n        \"measure\": \"variable.variableDescription\",  \r\n        \"unit\":    \"variable.unit.unitCode\"  \r\n      } },  \r\n    { \"path\": \"values[0].value[*]\", \"emit\": {  \r\n        \"name\":        { \"var\": \"tagName\" },  \r\n        \"timestamp\":   { \"path\": \"dateTime\", \"format\": \"iso8601\" },  \r\n        \"value\":       { \"path\": \"value\", \"type\": \"decimal\",  \r\n                         \"nullSentinels\": [\"-999999\", \"-999999.0\"] },  \r\n        \"description\": { \"var\": \"measure\" },  \r\n        \"units\":       { \"var\": \"unit\" }  \r\n    } }  \r\n  ]  \r\n}<\/pre>\n<table>\n<thead>\n<tr style=\"border: 1px solid #cccccc;\">\n<th><strong>Tag<\/strong><\/th>\n<th><strong>Time (UTC)<\/strong><\/th>\n<th><strong>Value<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"border: 1px solid #cccccc;\">\n<td>USGS:01646500:00060:00000<\/td>\n<td>07\/10\/2026 04:00:00<\/td>\n<td>10900<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td>USGS:01646500:00060:00000<\/td>\n<td>07\/10\/2026 04:15:00<\/td>\n<td>(no data)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<ul class=\"intro-text\">\n<li>The first level visits each series and saves its name, units and description. The second level visits its readings.<\/li>\n<li>The values[0] path picks the first item of the values array, which is where USGS puts the readings.<\/li>\n<li>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.<\/li>\n<li>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\".<\/li>\n<li>Times include a UTC offset (-04:00), so they are converted to UTC correctly.<\/li>\n<\/ul>\n<h4 id=\"ex-weather-hourly\">Time Series: Tag Names as Property Names (Hourly Weather)<\/p>\n<\/h4>\n<p class=\"intro-text\">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.<\/p>\n<p><strong>Datasource<\/strong><\/p>\n<pre class=\"wrap:true lang:default decode:true\" style=\"font-size: 14px !important;\">Base URI: https:\/\/api.open-meteo.com\/v1  \r\nRequest Path Template: forecast?latitude=-31.95&amp;longitude=115.86&amp;hourly={tags}&amp;timeformat=unixtime&amp;start_hour={startTime}&amp;end_hour={endTime}  \r\nRequest Timestamp Format: yyyy-MM-ddTHH:mm  \r\nRequest Time Zone: UTC<\/pre>\n<p><strong>Response for the tags temperature_2m and wind_speed_10m<\/strong><\/p>\n<pre class=\"wrap:true lang:default decode:true\" style=\"font-size: 14px !important;\">{  \r\n  \"hourly_units\": { \"time\": \"unixtime\", \"temperature_2m\": \"\u00b0C\", \"wind_speed_10m\": \"km\/h\" },  \r\n  \"hourly\": {  \r\n    \"time\": [1791417600, 1791421200, 1791424800],  \r\n    \"temperature_2m\": [18.3, 19.1, 20.4],  \r\n    \"wind_speed_10m\": [12.2, 14.8, 16.1]  \r\n  }  \r\n}<\/pre>\n<p><strong>Shape Configuration<\/strong><\/p>\n<pre class=\"wrap:true lang:default decode:true\" style=\"font-size: 14px !important;\">{  \r\n  \"levels\": [  \r\n    { \"path\": \"$.hourly\", \"bindKey\": \"tagName\",  \r\n      \"zip\": { \"columns\": {  \r\n        \"name\": { \"var\": \"tagName\" },  \r\n        \"timestamp\": { \"path\": \"$.hourly.time[*]\", \"format\": \"unixSeconds\" },  \r\n        \"value\":     { \"path\": \"[*]\", \"type\": \"decimal\" }  \r\n      } } }  \r\n  ]  \r\n}<\/pre>\n<p><strong>Tag browsing<\/strong><\/p>\n<pre class=\"wrap:true lang:default decode:true\" style=\"font-size: 14px !important;\">Tag Discovery Path: forecast?latitude=-31.95&amp;longitude=115.86&amp;hourly=temperature_2m,relative_humidity_2m,wind_speed_10m,precipitation&amp;forecast_days=1  \r\nTag Discovery Shape:  \r\n{  \r\n  \"levels\": [  \r\n    { \"path\": \"$.hourly_units\", \"bindKey\": \"tagName\", \"emit\": {  \r\n        \"name\":  { \"var\": \"tagName\" },  \r\n        \"units\": { }  \r\n    } }  \r\n  ]  \r\n}<\/pre>\n<ul class=\"intro-text\">\n<li>The bindKey setting goes through each property of hourly, saving its name (temperature_2m) as tagName and moving into its array.<\/li>\n<li>Inside zip, [*] reads the current array, and $.hourly.time[*] reads the shared time array from the top of the response.<\/li>\n<li>The time array also becomes a series called time, but it's ignored because no tag has that name.<\/li>\n<li>The {tags} placeholder puts all requested tags into one request, which suits APIs that accept a comma-separated list.<\/li>\n<li>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.<\/li>\n<\/ul>\n<h4 id=\"time-series-flat-list\">Time Series: Flat List<\/p>\n<\/h4>\n<p class=\"intro-text\">One array of readings, with a nested value and a timestamp in milliseconds.<\/p>\n<p><strong>Response<\/strong><\/p>\n<pre class=\"wrap:true lang:default decode:true\" style=\"font-size: 14px !important;\">{ \"items\": [  \r\n  { \"id\": \"PMP-1.run\",  \r\n    \"ts\": 1718928000000,  \r\n    \"reading\": { \"value\": 12.4 },  \r\n    \"meta\": { \"q\": 100 } }  \r\n] }<\/pre>\n<p><strong>Shape Configuration<\/strong><\/p>\n<pre class=\"wrap:true lang:default decode:true\" style=\"font-size: 14px !important;\">{  \r\n  \"rowsPath\": \"$.items[*]\",  \r\n  \"emit\": {  \r\n    \"name\": { \"path\": \"id\" },  \r\n    \"timestamp\": { \"path\": \"ts\", \"format\": \"unixMilliseconds\" },  \r\n    \"value\": { \"path\": \"reading.value\", \"type\": \"decimal\" },  \r\n    \"confidence\": { \"path\": \"meta.q\", \"type\": \"int\" }  \r\n  }  \r\n}<\/pre>\n<h4 id=\"time-series-tag-names-as-keys\">Time Series: Tag Names as Keys<\/p>\n<\/h4>\n<p class=\"intro-text\">The response maps each tag name to its readings. bindKey saves each key as tagName.<\/p>\n<p><strong>Response<\/strong><\/p>\n<pre class=\"wrap:true lang:default decode:true\" style=\"font-size: 14px !important;\">{ \"data\": {  \r\n  \"TIC-101\": [ { \"t\": \"2026-06-21T00:00:00Z\", \"v\": 12.3 } ],  \r\n  \"FIC-200\": [ { \"t\": \"2026-06-21T00:00:00Z\", \"v\": 50.1 } ]  \r\n} }<\/pre>\n<p><strong>Shape Configuration<\/strong><\/p>\n<pre class=\"wrap:true lang:default decode:true\" style=\"font-size: 14px !important;\">{  \r\n  \"levels\": [  \r\n    { \"path\": \"$.data\", \"bindKey\": \"tagName\" },  \r\n    { \"path\": \"*\", \"emit\": {  \r\n        \"name\": { \"var\": \"tagName\" },  \r\n        \"timestamp\": { \"path\": \"t\", \"format\": \"iso8601\" },  \r\n        \"value\": { \"path\": \"v\", \"type\": \"decimal\" }  \r\n    } }  \r\n  ]  \r\n}<\/pre>\n<h4 id=\"time-series-deeply-nested-readings\">Time Series: Deeply Nested Readings<\/p>\n<\/h4>\n<p class=\"intro-text\">The tag name is three levels above the readings, and each reading is an array of [time, value, quality].<\/p>\n<p><strong>Response<\/strong><\/p>\n<pre class=\"wrap:true lang:default decode:true\" style=\"font-size: 14px !important;\">{ \"facilities\": [ {  \r\n  \"facilityId\": \"PLANT-1\",  \r\n  \"areas\": [ {  \r\n    \"areaName\": \"Compression\",  \r\n    \"instruments\": [ {  \r\n      \"tag\": \"TIC-101\",  \r\n      \"samples\": [  \r\n        [1718928000, 12.3, 100],  \r\n        [1718928060, 12.5, 90]  \r\n      ]  \r\n    } ]  \r\n  } ]  \r\n} ] }<\/pre>\n<p><strong>Shape Configuration<\/strong><\/p>\n<pre class=\"wrap:true lang:default decode:true\" style=\"font-size: 14px !important;\">{  \r\n  \"levels\": [  \r\n    { \"path\": \"$.facilities[*]\" },  \r\n    { \"path\": \"areas[*]\" },  \r\n    { \"path\": \"instruments[*]\",  \r\n      \"bind\": { \"tagName\": \"tag\" } },  \r\n    { \"path\": \"samples[*]\", \"emit\": {  \r\n        \"name\":       { \"var\": \"tagName\" },  \r\n        \"timestamp\":  { \"index\": 0, \"format\": \"unixSeconds\" },  \r\n        \"value\":      { \"index\": 1, \"type\": \"decimal\" },  \r\n        \"confidence\": { \"index\": 2, \"type\": \"int\", \"default\": 100 }  \r\n    } }  \r\n  ]  \r\n}<\/pre>\n<h4 id=\"time-series-separate-arrays-with-bad-values\">Time Series: Separate Arrays with Bad Values<\/p>\n<\/h4>\n<p class=\"intro-text\">Times and values are in parallel arrays, the time uses a day-first format, and -9999 marks a bad reading.<\/p>\n<p><strong>Response<\/strong><\/p>\n<pre class=\"wrap:true lang:default decode:true\" style=\"font-size: 14px !important;\">{ \"tag\": \"FIC-200\",  \r\n  \"trend\": {  \r\n    \"timestamps\": [\"21\/06\/2026 08:00:00\",  \r\n                   \"21\/06\/2026 08:05:00\",  \r\n                   \"21\/06\/2026 08:10:00\"],  \r\n    \"values\":     [50.2, -9999, 50.4],  \r\n    \"qualities\":  [100, 0, 90]  \r\n} }<\/pre>\n<p><strong>Shape Configuration<\/strong><\/p>\n<pre class=\"wrap:true lang:default decode:true\" style=\"font-size: 14px !important;\">{  \r\n  \"levels\": [  \r\n    { \"path\": \"$\", \"bind\": { \"tagName\": \"tag\" } },  \r\n    { \"path\": \"trend\", \"zip\": { \"columns\": {  \r\n        \"name\":       { \"var\": \"tagName\" },  \r\n        \"timestamp\":  { \"path\": \"timestamps[*]\",  \r\n                        \"format\": \"custom:dd\/MM\/yyyy HH:mm:ss\" },  \r\n        \"value\":      { \"path\": \"values[*]\", \"type\": \"decimal\",  \r\n                        \"nullSentinels\": [-9999] },  \r\n        \"confidence\": { \"path\": \"qualities[*]\", \"type\": \"int\" }  \r\n    } } }  \r\n  ]  \r\n}<\/pre>\n<p class=\"intro-text\">This produces three readings. The middle reading is treated as empty because -9999 is a null sentinel.<\/p>\n<h4 id=\"time-series-current-values-only\">Time Series: Current Values Only<\/p>\n<\/h4>\n<p class=\"intro-text\">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.<\/p>\n<p><strong>Request Path Template<\/strong><\/p>\n<pre class=\"wrap:true lang:default decode:true\" style=\"font-size: 14px !important;\">current?tags={tags}<\/pre>\n<p><strong>Shape Configuration<\/strong><\/p>\n<pre class=\"wrap:true lang:default decode:true\" style=\"font-size: 14px !important;\">{  \r\n  \"rowsPath\": \"$.values[*]\",  \r\n  \"emit\": {  \r\n    \"name\":  { \"path\": \"tag\" },  \r\n    \"value\": { \"path\": \"v\", \"type\": \"decimal\" }  \r\n  }  \r\n}<\/pre>\n<h4 id=\"time-series-graphql-with-oauth2\">Time Series: GraphQL with OAuth2<\/h4>\n<p><strong>Datasource settings<\/strong><\/p>\n<pre class=\"wrap:true lang:default decode:true\" style=\"font-size: 14px !important;\">Base URI: https:\/\/example.com\/graphql  \r\nHTTP Method: POST  \r\nRequest Body: {\"query\":\"{ readings(from:\\\"{startTime}\\\", to:\\\"{endTime}\\\", tags:[{tags}]) { tag ts value } }\"}  \r\nAuthentication Mode: OAuth2ClientCredentials  \r\nOAuth2 Token URL: https:\/\/example.com\/oauth\/token  \r\nOAuth2 Client Id: (your client ID)  \r\nOAuth2 Client Secret: (your client secret)  \r\nOAuth2 Scope: read:timeseries<\/pre>\n<p><strong>Shape Configuration<\/strong><\/p>\n<pre class=\"wrap:true lang:default decode:true\" style=\"font-size: 14px !important;\">{  \r\n  \"rowsPath\": \"$.data.readings[*]\",  \r\n  \"emit\": {  \r\n    \"name\":      { \"path\": \"tag\" },  \r\n    \"timestamp\": { \"path\": \"ts\", \"format\": \"unixSeconds\" },  \r\n    \"value\":     { \"path\": \"value\", \"type\": \"decimal\" }  \r\n  }  \r\n}<\/pre>\n<h2 id=\"troubleshooting\" class=\"page-subheading\">Troubleshooting<\/h2>\n<p class=\"intro-text\"><strong>Test Connection fails, but data requests work<br \/>\n<\/strong><\/p>\n<p class=\"intro-text\">Test Connection sends a GET request to the Base URL, which many APIs do not serve. Set Verification Path to an endpoint that returns success for a GET request.<\/p>\n<p class=\"intro-text\"><strong>\"The dataset query must be a JSON document with a 'shape'\"<\/p>\n<p><\/strong><\/p>\n<p class=\"intro-text\">The dataset query is not valid JSON or does not contain a shape. Check for missing commas and unescaped quotation marks. Inside body, escape quotation marks as \\\".<\/p>\n<p class=\"intro-text\"><strong>Some tags return no data in batch mode<br \/>\n<\/strong><\/p>\n<p class=\"intro-text\">When using {tags}, the shape must output name so that each returned value can be matched to the corresponding tag. The name must match the tag name, but the matching is not case-sensitive.<\/p>\n<p class=\"intro-text\"><strong>A request fails with a conversion error<\/p>\n<p><\/strong><\/p>\n<p class=\"intro-text\">Check that the field's type or format matches the returned data. For example, \"type\": \"int\" cannot convert a value such as \"n\/a\" to an integer. Add values that represent missing data to nullSentinels, or use \"type\": \"string\" where appropriate.<\/p>\n<p class=\"intro-text\"><strong>Times are shifted by a few hours<br \/>\n<\/strong><br \/>\nFor requests, check Request Time Zone and make sure the timestamp format includes the appropriate offset. For responses, a <strong>custom:<\/strong> format with no offset is read as UTC.<\/p>\n<p class=\"intro-text\"><strong>A whole-number column shows as a Decimal<br \/>\n<\/strong><br \/>\nAdd \"type\": \"int\" to the field.<\/p>\n<p class=\"intro-text\"><strong>A column is missing or empty<br \/>\n<\/strong><br \/>\nCheck the path against the actual response. Paths are case-sensitive. Use ['name'] for property names that contain dots or symbols.<\/p>\n<p class=\"intro-text\"><strong>Only part of the data is returned<br \/>\n<\/strong><br \/>\nThe API may be returning results in pages. Set Paging Style to match the API's paging method and check whether Max Pages has been reached.<\/p>\n<p class=\"intro-text\"><strong>Where to find error details<br \/>\n<\/strong><br \/>\nFor failed requests, check the reported request URL and HTTP status. Timeouts are also reported. Full error details are available in the server log.<\/p>\n<p class=\"intro-text\"><strong>Explorer does not offer Enable Paging<br \/>\n<\/strong><br \/>\nCheck that the dataset query contains FIRSTROW() or LASTROW() in the params list. After adding them, save the dataset and refresh the page.<\/p>\n<p class=\"intro-text\"><strong>The paging control shows \"Page 1 of n\/a\"<br \/>\n<\/strong><br \/>\nExplorer has no total row count. Check that the dataset query has <strong>totalCountPath <\/strong>included at the top level of the dataset query, alongside shape, and that it points to a whole number in the response. Also check that <strong>Enable Paging<\/strong> is on, because the total row count is only reported when it is enabled.<\/p>\n<p class=\"intro-text\"><strong>Rows repeat or are missing when moving between pages<br \/>\n<\/strong><br \/>\nThe service must return rows in a stable order. For <strong>NextLink<\/strong> services that use offset and limit, set the Offset Parameter and Limit Parameter to the parameter names used by the service so that the adaptor can move to the correct page.<\/p>\n<p class=\"intro-text\"><strong>Fewer rows than expected without Enable Paging<br \/>\n<\/strong><br \/>\nThe adaptor stops after the number of requests specified by Max Pages. Increase Max Pages, or enable paging to retrieve the data one page at a time.<\/p>\n<h2 id=\"limits\" class=\"page-subheading\">Limitations<\/h2>\n<p class=\"intro-text\">The Generic REST adaptors have the following limitations:<\/p>\n<ul class=\"intro-text\">\n<li>Both adaptors are read-only and cannot write data back to the REST service.<\/li>\n<li>Responses must be in JSON format. XML and CSV responses are not supported.<\/li>\n<li>Service-side paging is supported only for GET requests in the Dataset adaptor. For POST requests, the adaptor sends a single request and, when paging is enabled, returns the requested rows from the result. The Time Series adaptor makes one request per fetch, or one request per tag.<\/li>\n<li>The path syntax has no filters, recursive search or slices.<\/li>\n<li><strong>PageNumber<\/strong> paging always starts at page 1. APIs that number pages from 0 are not supported.<\/li>\n<li>Tag names are inserted into the URL without encoding. Tag names containing spaces or symbols such as &amp; or # may require additional handling.<\/li>\n<li>Enable Paging requires FIRSTROW() or LASTROW() in the dataset query\u2019s params list, as described in <a href=\"#paging\">Paging<\/a>.<\/li>\n<li>OAuth2 authentication supports the client-credentials flow only. Authentication flows that require sign in as an individual user are not supported.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>The Generic REST adaptors connect IFS OI Server to REST web services that return JSON. This article describes how to configure and use the Generic REST Time Series Adaptor and Generic REST Dataset Adaptor.<\/p>\n<p class=\"continue-reading-button\"> <a class=\"continue-reading-link\" href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/primers\/datasources\/generic-rest-adaptor\/\">Read more<i class=\"crycon-right-dir\"><\/i><\/a><\/p>\n","protected":false},"author":38,"featured_media":4352,"parent":3668,"menu_order":22,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[9],"tags":[20,1336,95],"class_list":["post-72661","page","type-page","status-publish","has-post-thumbnail","hentry","category-tech-ref","tag-dataset","tag-rest-adaptor","tag-time-series","Version-26r2","Product-srv"],"_links":{"self":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/72661","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/users\/38"}],"replies":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/comments?post=72661"}],"version-history":[{"count":59,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/72661\/revisions"}],"predecessor-version":[{"id":73055,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/72661\/revisions\/73055"}],"up":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/3668"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/media\/4352"}],"wp:attachment":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/media?parent=72661"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/categories?post=72661"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/tags?post=72661"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}