> ## 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.

# Aras Innovator Api

> Client-mode REST API connector for Aras Innovator PLM: query parts, read BOMs, where-used, CAD and document links, documents and files, problem reports, ECRs and ECNs, and turn an inspection or quality event into a problem report or a BOM line, through the Aras RESTful API (OData v4) with OAuth tokens

Technical Preview

## Overview

Client-mode REST API connector for Aras Innovator PLM: query parts, read BOMs, where-used, CAD and document links, documents and files, problem reports, ECRs and ECNs, and turn an inspection or quality event into a problem report or a BOM line, through the Aras RESTful API (OData v4) with OAuth tokens.

This is one of the templates in the Aras Innovator REST API app (`aras-innovator`). Deploy it alongside the other connectors of that app when they depend on each other (for example a token connector plus an API connector).

> [!NOTE]
>
> Not yet verified against the live vendor API: No Aras Innovator server, user, database or OAuth client on the factory box (no ARAS\_\* variables) and Aras offers no public Innovator sandbox or unauthenticated OData endpoint; the ready gate needs an authenticated live call (GetToken + QueryParts, or a broker MQTT round trip). Mock-server and public-source checks do not clear the gate.

## Auth

OAuth 2.0 Bearer from the Aras OAuth server (\<alias>/oauthserver/connect/token). ArasInnovatorAuth GetToken: password grant, scope Innovator, client\_id (IOMApp by default), username, password = MD5 hex hash (SHA on FIPS servers), database; returns access\_token (3600 s default), token\_type Bearer. RefreshToken: refresh\_token grant for offline\_access logins (14+ PKCE, client InnovatorClient). ArasInnovatorApi events take payload field authorization = 'Bearer \<token>'. DATABASE / AUTHUSER / AUTHPASSWORD headers are unsupported since 12.0.

Auth headers used by the template: `Authorization: {value.json.authorization}`.

## Template parameters

| Placeholder | Type | Description | Required |
| - | - | - | - |
| `RouteName` | string | Name of the Aras Innovator Api connector | no |
| `BaseUrl` | string | Aras Innovator Api base URL without trailing slash (e.g. https\://YOUR\_ARAS\_SERVER) | yes |

`BASE_ADDRESS` default: `https://YOUR_ARAS_SERVER`.

## Events

| Event | Method | Endpoint | Request topic | Response topic | Payload fields |
| - | - | - | - | - | - |
| `QueryParts` | GET | `/InnovatorServer/Server/odata/Part?$filter={value.json.filter}&$top={value.json.top}` | `mes/aras-innovator/parts/query` | `mes/aras-innovator/parts/query/response` | `authorization`, `filter`, `top` |
| `GetPart` | GET | `/InnovatorServer/Server/odata/Part('{value.json.id}')` | `mes/aras-innovator/part/get` | `mes/aras-innovator/part/get/response` | `authorization`, `id` |
| `GetPartBom` | GET | `/InnovatorServer/Server/odata/Part('{value.json.id}')/Part_BOM?$expand=related_id` | `mes/aras-innovator/part-bom/get` | `mes/aras-innovator/part-bom/get/response` | `authorization`, `id` |
| `GetPartWhereUsed` | GET | `/InnovatorServer/Server/odata/Part?$filter=[Part%20BOM]/related_id/item_number%20eq%20'{value.json.item_number}'&$select=id,item_number,name,state` | `mes/aras-innovator/part-where-used/get` | `mes/aras-innovator/part-where-used/get/response` | `authorization`, `item_number` |
| `GetPartCad` | GET | `/InnovatorServer/Server/odata/Part('{value.json.id}')/Part_CAD?$expand=related_id` | `mes/aras-innovator/part-cad/get` | `mes/aras-innovator/part-cad/get/response` | `authorization`, `id` |
| `GetPartDocuments` | GET | `/InnovatorServer/Server/odata/Part('{value.json.id}')/Part_Document?$expand=related_id` | `mes/aras-innovator/part-documents/get` | `mes/aras-innovator/part-documents/get/response` | `authorization`, `id` |
| `QueryDocuments` | GET | `/InnovatorServer/Server/odata/Document?$filter={value.json.filter}&$top={value.json.top}` | `mes/aras-innovator/documents/query` | `mes/aras-innovator/documents/query/response` | `authorization`, `filter`, `top` |
| `GetDocument` | GET | `/InnovatorServer/Server/odata/Document('{value.json.id}')` | `mes/aras-innovator/document/get` | `mes/aras-innovator/document/get/response` | `authorization`, `id` |
| `GetDocumentFiles` | GET | `/InnovatorServer/Server/odata/Document('{value.json.id}')/Document_File?$expand=related_id` | `mes/aras-innovator/document-files/get` | `mes/aras-innovator/document-files/get/response` | `authorization`, `id` |
| `GetFileInfo` | GET | `/InnovatorServer/Server/odata/File('{value.json.id}')` | `mes/aras-innovator/file/get` | `mes/aras-innovator/file/get/response` | `authorization`, `id` |
| `ListProblemReports` | GET | `/InnovatorServer/Server/odata/PR?$filter={value.json.filter}&$top={value.json.top}` | `mes/aras-innovator/problem-reports/list` | `mes/aras-innovator/problem-reports/list/response` | `authorization`, `filter`, `top` |
| `GetProblemReport` | GET | `/InnovatorServer/Server/odata/PR('{value.json.id}')?$expand=affected_item` | `mes/aras-innovator/problem-report/get` | `mes/aras-innovator/problem-report/get/response` | `authorization`, `id` |
| `CreateProblemReport` | POST | `/InnovatorServer/Server/odata/PR` | `mes/aras-innovator/problem-report/create` | `mes/aras-innovator/problem-report/create/response` | `authorization`, `request` |
| `ListEcrs` | GET | `/InnovatorServer/Server/odata/ECR?$filter={value.json.filter}&$top={value.json.top}` | `mes/aras-innovator/ecrs/list` | `mes/aras-innovator/ecrs/list/response` | `authorization`, `filter`, `top` |
| `ListEcns` | GET | `/InnovatorServer/Server/odata/ECN?$filter={value.json.filter}&$top={value.json.top}` | `mes/aras-innovator/ecns/list` | `mes/aras-innovator/ecns/list/response` | `authorization`, `filter`, `top` |
| `AddPartBomLine` | POST | `/InnovatorServer/Server/odata/Part_BOM` | `mes/aras-innovator/part-bom/create` | `mes/aras-innovator/part-bom/create/response` | `authorization`, `request` |
| `QueryItems` | GET | `/InnovatorServer/Server/odata/{value.json.itemtype}?$filter={value.json.filter}&$top={value.json.top}` | `mes/aras-innovator/items/query` | `mes/aras-innovator/items/query/response` | `authorization`, `filter`, `itemtype`, `top` |
| `QueryItemTypes` | GET | `/InnovatorServer/Server/odata/ItemType?$filter={value.json.filter}&$select=id,name,label` | `mes/aras-innovator/item-types/query` | `mes/aras-innovator/item-types/query/response` | `authorization`, `filter` |

## Deploy

Get the template card (JSON with `template` and `metadata`) from the broker, then deploy the connector:

```bash theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
mosquitto_pub -t '$SYS/Coreflux/Command' -m "-routeCode ARAS_INNOVATOR"
```

The deployable connector from the REST API app, with `BASE_ADDRESS` already filled in:

```lot theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
DEFINE ROUTE ArasInnovatorApi WITH TYPE REST_API
    ADD REST_API_CONFIG
        WITH BASE_ADDRESS "https://YOUR_ARAS_SERVER"
        WITH ENABLE_CLIENT "true"
        WITH USE_SSL "true"
        WITH REQUEST_TIMEOUT '60'
        WITH DEFAULT_CONTENT_TYPE "application/json"
    ADD EVENT QueryParts
        WITH SOURCE_TOPIC "mes/aras-innovator/parts/query"
        WITH DESTINATION_TOPIC "mes/aras-innovator/parts/query/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/InnovatorServer/Server/odata/Part?$filter={value.json.filter}&$top={value.json.top}"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "{value.json.authorization}"
    ADD EVENT GetPart
        WITH SOURCE_TOPIC "mes/aras-innovator/part/get"
        WITH DESTINATION_TOPIC "mes/aras-innovator/part/get/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/InnovatorServer/Server/odata/Part('{value.json.id}')"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "{value.json.authorization}"
    ADD EVENT GetPartBom
        WITH SOURCE_TOPIC "mes/aras-innovator/part-bom/get"
        WITH DESTINATION_TOPIC "mes/aras-innovator/part-bom/get/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/InnovatorServer/Server/odata/Part('{value.json.id}')/Part_BOM?$expand=related_id"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "{value.json.authorization}"
    ADD EVENT GetPartWhereUsed
        WITH SOURCE_TOPIC "mes/aras-innovator/part-where-used/get"
        WITH DESTINATION_TOPIC "mes/aras-innovator/part-where-used/get/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/InnovatorServer/Server/odata/Part?$filter=[Part%20BOM]/related_id/item_number%20eq%20'{value.json.item_number}'&$select=id,item_number,name,state"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "{value.json.authorization}"
    ADD EVENT GetPartCad
        WITH SOURCE_TOPIC "mes/aras-innovator/part-cad/get"
        WITH DESTINATION_TOPIC "mes/aras-innovator/part-cad/get/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/InnovatorServer/Server/odata/Part('{value.json.id}')/Part_CAD?$expand=related_id"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "{value.json.authorization}"
    ADD EVENT GetPartDocuments
        WITH SOURCE_TOPIC "mes/aras-innovator/part-documents/get"
        WITH DESTINATION_TOPIC "mes/aras-innovator/part-documents/get/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/InnovatorServer/Server/odata/Part('{value.json.id}')/Part_Document?$expand=related_id"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "{value.json.authorization}"
    ADD EVENT QueryDocuments
        WITH SOURCE_TOPIC "mes/aras-innovator/documents/query"
        WITH DESTINATION_TOPIC "mes/aras-innovator/documents/query/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/InnovatorServer/Server/odata/Document?$filter={value.json.filter}&$top={value.json.top}"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "{value.json.authorization}"
    ADD EVENT GetDocument
        WITH SOURCE_TOPIC "mes/aras-innovator/document/get"
        WITH DESTINATION_TOPIC "mes/aras-innovator/document/get/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/InnovatorServer/Server/odata/Document('{value.json.id}')"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "{value.json.authorization}"
    ADD EVENT GetDocumentFiles
        WITH SOURCE_TOPIC "mes/aras-innovator/document-files/get"
        WITH DESTINATION_TOPIC "mes/aras-innovator/document-files/get/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/InnovatorServer/Server/odata/Document('{value.json.id}')/Document_File?$expand=related_id"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "{value.json.authorization}"
    ADD EVENT GetFileInfo
        WITH SOURCE_TOPIC "mes/aras-innovator/file/get"
        WITH DESTINATION_TOPIC "mes/aras-innovator/file/get/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/InnovatorServer/Server/odata/File('{value.json.id}')"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "{value.json.authorization}"
    ADD EVENT ListProblemReports
        WITH SOURCE_TOPIC "mes/aras-innovator/problem-reports/list"
        WITH DESTINATION_TOPIC "mes/aras-innovator/problem-reports/list/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/InnovatorServer/Server/odata/PR?$filter={value.json.filter}&$top={value.json.top}"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "{value.json.authorization}"
    ADD EVENT GetProblemReport
        WITH SOURCE_TOPIC "mes/aras-innovator/problem-report/get"
        WITH DESTINATION_TOPIC "mes/aras-innovator/problem-report/get/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/InnovatorServer/Server/odata/PR('{value.json.id}')?$expand=affected_item"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "{value.json.authorization}"
    ADD EVENT CreateProblemReport
        WITH SOURCE_TOPIC "mes/aras-innovator/problem-report/create"
        WITH DESTINATION_TOPIC "mes/aras-innovator/problem-report/create/response"
        WITH METHOD "POST"
        WITH ENDPOINT "/InnovatorServer/Server/odata/PR"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "{value.json.authorization}"
            ADD "Content-Type" "application/json"
            ADD "Prefer" "return=representation"
        WITH BODY "{value.json.request}"
    ADD EVENT ListEcrs
        WITH SOURCE_TOPIC "mes/aras-innovator/ecrs/list"
        WITH DESTINATION_TOPIC "mes/aras-innovator/ecrs/list/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/InnovatorServer/Server/odata/ECR?$filter={value.json.filter}&$top={value.json.top}"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "{value.json.authorization}"
    ADD EVENT ListEcns
        WITH SOURCE_TOPIC "mes/aras-innovator/ecns/list"
        WITH DESTINATION_TOPIC "mes/aras-innovator/ecns/list/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/InnovatorServer/Server/odata/ECN?$filter={value.json.filter}&$top={value.json.top}"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "{value.json.authorization}"
    ADD EVENT AddPartBomLine
        WITH SOURCE_TOPIC "mes/aras-innovator/part-bom/create"
        WITH DESTINATION_TOPIC "mes/aras-innovator/part-bom/create/response"
        WITH METHOD "POST"
        WITH ENDPOINT "/InnovatorServer/Server/odata/Part_BOM"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "{value.json.authorization}"
            ADD "Content-Type" "application/json"
            ADD "Prefer" "return=representation"
        WITH BODY "{value.json.request}"
    ADD EVENT QueryItems
        WITH SOURCE_TOPIC "mes/aras-innovator/items/query"
        WITH DESTINATION_TOPIC "mes/aras-innovator/items/query/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/InnovatorServer/Server/odata/{value.json.itemtype}?$filter={value.json.filter}&$top={value.json.top}"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "{value.json.authorization}"
    ADD EVENT QueryItemTypes
        WITH SOURCE_TOPIC "mes/aras-innovator/item-types/query"
        WITH DESTINATION_TOPIC "mes/aras-innovator/item-types/query/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/InnovatorServer/Server/odata/ItemType?$filter={value.json.filter}&$select=id,name,label"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "{value.json.authorization}"
```

Deploy it with `-addRoute` (do not include `ADD METADATA`).

## Usage example

Call `QueryParts` by publishing a JSON payload to its request topic, and read the reply on the response topic:

```bash theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
mosquitto_sub -t 'mes/aras-innovator/parts/query/response' &
mosquitto_pub -t 'mes/aras-innovator/parts/query' -m '{"authorization": "<authorization>", "filter": "<filter>", "top": "<top>"}'
```

## Related

* [REST API Connectors](/latest/lot-language/routes/rest-api-routes)
* [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.