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

# IFS Cloud REST API

> Client-mode REST API connector for IFS Cloud OData v4 projections (Shop Orders, Equipment, Work Orders)

Technical Preview

## Overview

Client-mode REST API connector for IFS Cloud OData v4 projections (Shop Orders, Equipment, Work Orders). `BASE_ADDRESS` defaults to `https://YOUR_IFS_HOST/main/ifsapplications/projection/v1`. Auth: **OAuth 2.0 (IFS IAM) Bearer**. Pass secrets only at runtime via MQTT JSON placeholders or Hub `GET SECRET` — never commit real credentials.

## Auth

OAuth 2.0 (IFS IAM) Bearer. Prefer Hub secrets / `GET SECRET`. Never hard-code tokens into the `.lot`.

## Basic Syntax

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

DEFINE ROUTE IfsCloudRestApi WITH TYPE REST_API
    ADD REST_API_CONFIG
        WITH BASE_ADDRESS "https://YOUR_IFS_HOST/main/ifsapplications/projection/v1"
        WITH ENABLE_CLIENT "true"
        WITH USE_SSL "true"
        WITH REQUEST_TIMEOUT '30'
        WITH DEFAULT_CONTENT_TYPE "application/json"
        # Auth: Authorization Bearer {value.json.access_token} — prefer Hub secrets / GET SECRET.
        # Optional Basic: WITH USERNAME "YOUR_USER" / WITH PASSWORD GET SECRET "APP_PASSWORD"
    ADD EVENT Listshoporders
        WITH SOURCE_TOPIC "integrations/ifs-cloud/request/Listshoporders"
        WITH DESTINATION_TOPIC "integrations/ifs-cloud/response/Listshoporders"
        WITH METHOD "GET"
        WITH ENDPOINT "/ShopOrderHandling.svc/ShopOrders"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
    ADD EVENT Getshoporder
        WITH SOURCE_TOPIC "integrations/ifs-cloud/request/Getshoporder"
        WITH DESTINATION_TOPIC "integrations/ifs-cloud/response/Getshoporder"
        WITH METHOD "GET"
        WITH ENDPOINT "/ShopOrderHandling.svc/ShopOrders({value.json.OrderNo})"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
    ADD EVENT Reportoperation
        WITH SOURCE_TOPIC "integrations/ifs-cloud/request/Reportoperation"
        WITH DESTINATION_TOPIC "integrations/ifs-cloud/response/Reportoperation"
        WITH METHOD "POST"
        WITH ENDPOINT "/ShopOrderHandling.svc/ShopOrders({value.json.OrderNo})/IfsApp.ShopOrderHandling.ShopOrder_ReportOperation"
        WITH HEADERS
            ADD "Content-Type" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
        WITH BODY "{payload}"
    # ... additional EVENTs in package .lot ...
```

## MQTT topics

Request topics under `integrations/ifs-cloud/request/...`; responses on `integrations/ifs-cloud/response/...`.

## Template reference

Generated from the shipped broker template `ifs-cloud` (`-routeCode IFS_CLOUD`). It lists every event the template defines.

### Auth

OAuth 2.0 (IFS IAM) Bearer

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

### Template parameters

| Placeholder | Type | Description | Required |
| - | - | - | - |
| `RouteName` | string | Name of the IFS Cloud connector | no |
| `BaseUrl` | string | IFS Cloud base URL without trailing slash (e.g. https\://YOUR\_IFS\_HOST/main/ifsapplications/projection/v1) | yes |

`BASE_ADDRESS` default: `https://YOUR_IFS_HOST/main/ifsapplications/projection/v1`.

### Events

| Event | Method | Endpoint | Request topic | Response topic | Payload fields |
| - | - | - | - | - | - |
| `Listshoporders` | GET | `/ShopOrderHandling.svc/ShopOrders` | `integrations/ifs-cloud/request/Listshoporders` | `integrations/ifs-cloud/response/Listshoporders` | `access_token` |
| `Getshoporder` | GET | `/ShopOrderHandling.svc/ShopOrders({value.json.OrderNo})` | `integrations/ifs-cloud/request/Getshoporder` | `integrations/ifs-cloud/response/Getshoporder` | `OrderNo`, `access_token` |
| `Reportoperation` | POST | `/ShopOrderHandling.svc/ShopOrders({value.json.OrderNo})/IfsApp.ShopOrderHandling.ShopOrder_ReportOperation` | `integrations/ifs-cloud/request/Reportoperation` | `integrations/ifs-cloud/response/Reportoperation` | `OrderNo`, `access_token`, `body` |
| `Listequipmentobjects` | GET | `/EquipmentObjectHandling.svc/EquipmentObjects` | `integrations/ifs-cloud/request/Listequipmentobjects` | `integrations/ifs-cloud/response/Listequipmentobjects` | `access_token` |
| `Getequipmentobject` | GET | `/EquipmentObjectHandling.svc/EquipmentObjects({value.json.EquipmentObjectSeq})` | `integrations/ifs-cloud/request/Getequipmentobject` | `integrations/ifs-cloud/response/Getequipmentobject` | `EquipmentObjectSeq`, `access_token` |
| `Listinventoryparts` | GET | `/InventoryPartHandling.svc/InventoryParts` | `integrations/ifs-cloud/request/Listinventoryparts` | `integrations/ifs-cloud/response/Listinventoryparts` | `access_token` |
| `Listworkorders` | GET | `/WorkOrderHandling.svc/WorkOrders` | `integrations/ifs-cloud/request/Listworkorders` | `integrations/ifs-cloud/response/Listworkorders` | `access_token` |
| `Createworkorder` | POST | `/WorkOrderHandling.svc/WorkOrders` | `integrations/ifs-cloud/request/Createworkorder` | `integrations/ifs-cloud/response/Createworkorder` | `access_token`, `body` |

### 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 IFS_CLOUD"
```

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 IfsCloudRestApi WITH TYPE REST_API
    ADD REST_API_CONFIG
        WITH BASE_ADDRESS "https://YOUR_IFS_HOST/main/ifsapplications/projection/v1"
        WITH ENABLE_CLIENT "true"
        WITH USE_SSL "true"
        WITH REQUEST_TIMEOUT '30'
        WITH DEFAULT_CONTENT_TYPE "application/json"
    ADD EVENT Listshoporders
        WITH SOURCE_TOPIC "integrations/ifs-cloud/request/Listshoporders"
        WITH DESTINATION_TOPIC "integrations/ifs-cloud/response/Listshoporders"
        WITH METHOD "GET"
        WITH ENDPOINT "/ShopOrderHandling.svc/ShopOrders"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
    ADD EVENT Getshoporder
        WITH SOURCE_TOPIC "integrations/ifs-cloud/request/Getshoporder"
        WITH DESTINATION_TOPIC "integrations/ifs-cloud/response/Getshoporder"
        WITH METHOD "GET"
        WITH ENDPOINT "/ShopOrderHandling.svc/ShopOrders({value.json.OrderNo})"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
    ADD EVENT Reportoperation
        WITH SOURCE_TOPIC "integrations/ifs-cloud/request/Reportoperation"
        WITH DESTINATION_TOPIC "integrations/ifs-cloud/response/Reportoperation"
        WITH METHOD "POST"
        WITH ENDPOINT "/ShopOrderHandling.svc/ShopOrders({value.json.OrderNo})/IfsApp.ShopOrderHandling.ShopOrder_ReportOperation"
        WITH HEADERS
            ADD "Content-Type" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
        WITH BODY "{value.json.body}"
    ADD EVENT Listequipmentobjects
        WITH SOURCE_TOPIC "integrations/ifs-cloud/request/Listequipmentobjects"
        WITH DESTINATION_TOPIC "integrations/ifs-cloud/response/Listequipmentobjects"
        WITH METHOD "GET"
        WITH ENDPOINT "/EquipmentObjectHandling.svc/EquipmentObjects"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
    ADD EVENT Getequipmentobject
        WITH SOURCE_TOPIC "integrations/ifs-cloud/request/Getequipmentobject"
        WITH DESTINATION_TOPIC "integrations/ifs-cloud/response/Getequipmentobject"
        WITH METHOD "GET"
        WITH ENDPOINT "/EquipmentObjectHandling.svc/EquipmentObjects({value.json.EquipmentObjectSeq})"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
    ADD EVENT Listinventoryparts
        WITH SOURCE_TOPIC "integrations/ifs-cloud/request/Listinventoryparts"
        WITH DESTINATION_TOPIC "integrations/ifs-cloud/response/Listinventoryparts"
        WITH METHOD "GET"
        WITH ENDPOINT "/InventoryPartHandling.svc/InventoryParts"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
    ADD EVENT Listworkorders
        WITH SOURCE_TOPIC "integrations/ifs-cloud/request/Listworkorders"
        WITH DESTINATION_TOPIC "integrations/ifs-cloud/response/Listworkorders"
        WITH METHOD "GET"
        WITH ENDPOINT "/WorkOrderHandling.svc/WorkOrders"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
    ADD EVENT Createworkorder
        WITH SOURCE_TOPIC "integrations/ifs-cloud/request/Createworkorder"
        WITH DESTINATION_TOPIC "integrations/ifs-cloud/response/Createworkorder"
        WITH METHOD "POST"
        WITH ENDPOINT "/WorkOrderHandling.svc/WorkOrders"
        WITH HEADERS
            ADD "Content-Type" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
        WITH BODY "{value.json.body}"
```

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

### Usage example

Call `Listshoporders` 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 'integrations/ifs-cloud/response/Listshoporders' &
mosquitto_pub -t 'integrations/ifs-cloud/request/Listshoporders' -m '{"access_token": "<access_token>"}'
```

## Related

* [REST API Connectors](/latest/lot-language/routes/rest-api-routes)
* [REST API apps index](/latest/lot-language/routes/rest-api-apps)


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