> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coreflux.org/llms.txt
> Use this file to discover all available pages before exploring further.

# AVEVA CONNECT data services

> Client-mode REST API connector for AVEVA CONNECT data services (Data Hub / OSIsoft Cloud Services): OMF type/container/data ingest, SDS stream data GET/PUT, and stream list smoke

Technical Preview

## Overview

A client-mode connector for a **curated** slice of [AVEVA CONNECT data services](https://docs.aveva.com/bundle/connect-data-services-developer/page/developer-guide/sequential-data-store-dev/sds-quick-start.html) (formerly AVEVA Data Hub / OSIsoft Cloud Services) under your regional host `https://{region}.datahub.connect.aveva.com/api/v1/Tenants/{tenant}/Namespaces/{ns}`:

| Catalog connector event | Entity / path | Notes |
| - | - | - |
| (smoke) | `GET /Streams` | List SDS streams in the namespace |
| POST omf (type) | `POST /omf` + `MessageType: type` | OMF type → SDS type |
| POST omf (container) | `POST /omf` + `MessageType: container` | OMF container → SDS stream |
| POST omf (data) | `POST /omf` + `MessageType: data` | High-throughput async ingest (expects **202**) |
| GET Streams/\{id}/Data | `GET /Streams/{streamId}/Data?startIndex=` | Also `endIndex` / `count` |
| PUT Streams/\{id}/Data | `PUT /Streams/{streamId}/Data` | Update/upsert SDS values |

`BASE_ADDRESS` includes tenant and namespace (no trailing slash; endpoints start with `/`). Topics use `historian/aveva-connect-data-services/<object>/<verb>`. Default stub region is `uswe` (US West).

See the base guide: [REST API Connectors](/latest/lot-language/routes/rest-api-routes).

> [!NOTE]
>
> **Tenant + OAuth required.** There is no public CONNECT sandbox. Replace `YOUR_TENANT` / `YOUR_NAMESPACE`, pick your region, and supply an OAuth 2.0 **client credentials** access token. Prefer Hub secrets.

> [!NOTE]
>
> **OMF connection.** For `POST /omf`, map the client-credentials client to an **OMF connection** that targets the namespace (CONNECT portal: Data Management → Connections). Otherwise OMF ingress is unauthorized or not routed.

> [!NOTE]
>
> Prefer Hub secrets for tokens / client secrets. This template has not been verified against a live CONNECT tenant. Queue status remains **blocked** until an authenticated live smoke succeeds.

## Basic Syntax

```lot wrap theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
# Coreflux REST_API template — AVEVA CONNECT data services
# Auth: OAuth 2.0 client credentials → Bearer {value.json.api_token}
# BASE_ADDRESS: https://uswe.datahub.connect.aveva.com/api/v1/Tenants/YOUR_TENANT/Namespaces/YOUR_NAMESPACE

DEFINE ROUTE AvevaConnectDataServicesRestApi WITH TYPE REST_API
    ADD REST_API_CONFIG
        WITH BASE_ADDRESS "https://uswe.datahub.connect.aveva.com/api/v1/Tenants/YOUR_TENANT/Namespaces/YOUR_NAMESPACE"
        WITH ENABLE_CLIENT "true"
        WITH USE_SSL "true"
        WITH REQUEST_TIMEOUT '60'
        WITH DEFAULT_CONTENT_TYPE "application/json"
    ADD EVENT ListStreams
        WITH SOURCE_TOPIC "historian/aveva-connect-data-services/streams/list"
        WITH DESTINATION_TOPIC "historian/aveva-connect-data-services/streams/list/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/Streams"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "Bearer {value.json.api_token}"
    ADD EVENT PostOmfType
        WITH SOURCE_TOPIC "historian/aveva-connect-data-services/omf/type"
        WITH DESTINATION_TOPIC "historian/aveva-connect-data-services/omf/type/response"
        WITH METHOD "POST"
        WITH ENDPOINT "/omf"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Content-Type" "application/json"
            ADD "Authorization" "Bearer {value.json.api_token}"
            ADD "MessageType" "type"
            ADD "MessageFormat" "json"
            ADD "OmfVersion" "1.2"
        WITH BODY "{payload}"
    ADD EVENT PostOmfContainer
        WITH SOURCE_TOPIC "historian/aveva-connect-data-services/omf/container"
        WITH DESTINATION_TOPIC "historian/aveva-connect-data-services/omf/container/response"
        WITH METHOD "POST"
        WITH ENDPOINT "/omf"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Content-Type" "application/json"
            ADD "Authorization" "Bearer {value.json.api_token}"
            ADD "MessageType" "container"
            ADD "MessageFormat" "json"
            ADD "OmfVersion" "1.2"
        WITH BODY "{payload}"
    ADD EVENT PostOmfData
        WITH SOURCE_TOPIC "historian/aveva-connect-data-services/omf/data"
        WITH DESTINATION_TOPIC "historian/aveva-connect-data-services/omf/data/response"
        WITH METHOD "POST"
        WITH ENDPOINT "/omf"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Content-Type" "application/json"
            ADD "Authorization" "Bearer {value.json.api_token}"
            ADD "MessageType" "data"
            ADD "MessageFormat" "json"
            ADD "OmfVersion" "1.2"
        WITH BODY "{payload}"
    ADD EVENT GetStreamData
        WITH SOURCE_TOPIC "historian/aveva-connect-data-services/streams/data/get"
        WITH DESTINATION_TOPIC "historian/aveva-connect-data-services/streams/data/get/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/Streams/{value.json.streamId}/Data?startIndex={value.json.startIndex}&endIndex={value.json.endIndex}&count={value.json.count}"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "Bearer {value.json.api_token}"
    ADD EVENT PutStreamData
        WITH SOURCE_TOPIC "historian/aveva-connect-data-services/streams/data/put"
        WITH DESTINATION_TOPIC "historian/aveva-connect-data-services/streams/data/put/response"
        WITH METHOD "PUT"
        WITH ENDPOINT "/Streams/{value.json.streamId}/Data"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Content-Type" "application/json"
            ADD "Authorization" "Bearer {value.json.api_token}"
        WITH BODY "{payload}"
```

## Events

| Event | Method | Endpoint | Request topic | Response topic |
| - | - | - | - | - |
| ListStreams | GET | `/Streams` | `historian/aveva-connect-data-services/streams/list` | `.../response` |
| PostOmfType | POST | `/omf` (`MessageType: type`) | `.../omf/type` | `.../response` |
| PostOmfContainer | POST | `/omf` (`MessageType: container`) | `.../omf/container` | `.../response` |
| PostOmfData | POST | `/omf` (`MessageType: data`) | `.../omf/data` | `.../response` |
| GetStreamData | GET | `/Streams/{streamId}/Data?startIndex=&endIndex=&count=` | `.../streams/data/get` | `.../response` |
| PutStreamData | PUT | `/Streams/{streamId}/Data` | `.../streams/data/put` | `.../response` |

## Auth

1. Create a **Client-Credentials** client in CONNECT (Security → Clients) with roles that can read/write SDS streams (and OMF if ingesting).
2. For OMF, create an **OMF connection** and map that client to the target namespace(s).
3. Exchange credentials at the regional token endpoint, e.g.\
   `POST https://uswe.datahub.connect.aveva.com/identity/connect/token`\
   with `grant_type=client_credentials`, `client_id`, `client_secret`.
4. Discovery: `https://uswe.datahub.connect.aveva.com/identity/.well-known/openid-configuration`.
5. Pass the access token on each MQTT payload as `api_token` → header `Authorization: Bearer {value.json.api_token}`.
6. Prefer Hub secrets. Never commit `client_secret` or access tokens.

## Example payloads

**List streams (smoke):**

```json theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
{
  "api_token": "YOUR_OAUTH_ACCESS_TOKEN"
}
```

**OMF data message (body is OMF JSON; MessageType is set by the event headers):**

```json theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
[
  {
    "containerid": "SimpleStream",
    "values": [
      {
        "Time": "2026-10-04T10:00:00Z",
        "Measurement": 42.5
      }
    ]
  }
]
```

Publish that array as the MQTT payload (and include `api_token` in a wrapper only if your upstream strips non-body keys before `{payload}` — otherwise publish the OMF body alone and pass the token via a Hub secret injection pattern your broker supports). Practical pattern: put `api_token` alongside path fields when the connector uses `{value.json.*}` for path/query, and keep `{payload}` as the full MQTT JSON for PUT/POST when the API accepts extra fields being ignored — for OMF, prefer a clean OMF array body.

**Get stream data:**

```json theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
{
  "api_token": "YOUR_OAUTH_ACCESS_TOKEN",
  "streamId": "SimpleStream",
  "startIndex": "2026-10-04T00:00:00Z",
  "endIndex": "2026-10-04T23:59:59Z",
  "count": "1000"
}
```

**Put stream data:**

```json theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
[
  {
    "Time": "2026-10-04T10:00:00Z",
    "State": 0,
    "Measurement": 123.45
  }
]
```

Use `streamId` in the MQTT JSON for the path placeholder; shape the body as an SDS value array.

## Configuration checklist

1. Set `BASE_ADDRESS` region + tenant + namespace.
2. Store OAuth client id/secret (or a short-lived access token) in Hub secrets.
3. Map the client to an OMF connection before using `PostOmf*`.
4. Deploy the `.lot` with `-addRoute` (no `ADD METADATA` in the deployable file).
5. Smoke: publish to `historian/aveva-connect-data-services/streams/list` → expect HTTP 200 on the response topic.

## Sources

* [OMF Ingress](https://docs.aveva.com/bundle/connect-data-services-developer/page/api-reference/data-ingress/omf-ingress/omf-ingress-omf.html)
* [SDS Quick Start](https://docs.aveva.com/bundle/connect-data-services-developer/page/developer-guide/sequential-data-store-dev/sds-quick-start.html)
* [SDS Streams API](https://docs.aveva.com/bundle/connect-data-services-developer/page/api-reference/sequential-data-store/sds-streams.html)
* [CONNECT developer docs (GitHub)](https://github.com/aveva/CONNECT-data-services-developer-docs)
* [OMF samples](https://github.com/AVEVA/AVEVA-Samples-OMF)

## Related

* [REST API Connectors](/latest/lot-language/routes/rest-api-routes)
* [AVEVA PI Web API](/latest/lot-language/routes/rest-api-apps/aveva-pi-web-api) (on-prem sister historian package)
* [REST API Apps catalog](/latest/lot-language/routes/rest-api-apps)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.