# Documentation Overview

## Wrapped up

### The Benefits of IndustryApps

* Infrastructure managed by the IndustryApps platform, reducing overhead and complexity, a SaaS application ready to be deployed within days rather than months of development.&#x20;
* Data security standardised across the board with secured cloud integration, all data ownership secured for customers.
* Refined, clean data ready to be integrated and utilised in your SaaS applications through a plug & play experience.
* User management and permission system out of the box ready to be utilised by your applications.
* Faster Growth to global markets with reduced sales cycles.

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FoZZtXrGttvGXhbbqxtLq%2FScreenshot%202022-08-20%20at%2000.31.04.png?alt=media\&token=aa895596-dcec-4127-88fd-ceee78c3f2e1)

## What it looks like

IndustryApps exhibits your application on the Appstore according to which markets you'd like to expose your product. One of the many benefits of hosting the application is how the product is marketed via various channels such as Industry forums, Industrial magazines, SME work groups, Expert panels and influencer channels all the while no direct involvement is required until customer identification and subscription, resulting in reduced overhead with increase of exposure.

The application page consists of features, benefits, snapshots and additional information which markets your product for optimal reach and automated sales.

![Application information](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2F14MOeiR0vb4NvXNGW5KS%2FAsset%203.png?alt=media\&token=07f53c34-0f3c-4a15-b4b6-ec32bb48881b)

## What changes?

Your SaaS application does not require more than some minor modifications to fit to frame for platform integration. No architectural changes are needed, and months of investment into your application's development turn into weeks. Once integrated, your product will be globally accessible to hundreds of factories and industries waiting to utilise your solutions.

![Application changes while integrating onto IndustryApps](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FngfYhKHTpDdjAx8r1Ufa%2Foverview-3.png?alt=media\&token=d157e7bf-ebd9-4edf-a131-ea71e49285a5)

#### To find out more about UX, check out user experience.

{% content-ref url="/pages/fT0xxTkJrcib0CaNA7Dy" %}
[User Experience](/user-experience)
{% endcontent-ref %}


# Development Introduction

IndustryApps apps can be considered as lego block construction. Applications should be standardized by implementing some microservice patterns and packaged into IndustryApps AppStore.&#x20;

The idea can be explained in simple terms as the application is a lego block, which may exist standalone or joined with other applications to mature as standalone and form a block, finally, these blocks can plug and play in different ways to serve different business needs. This guide helps to understand the thought, and it also helps you in either developing an application from scratch or adapting an existing one.

## Quick Links

| [<img src="https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FWBK7z8hOafsCvw9MtxOv%2Fuser-check-regular-24%20(2).png?alt=media&amp;token=755b2294-23e1-4029-8b02-b5057ff6839d" alt="" data-size="line">Accessing user context, permissions & management in App](/authentication/accessing-data-exposed-by-the-platform) |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [<img src="https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FF79t2Df0y0EjOPuTRoRl%2Fdata-solid-24%20(1).png?alt=media&amp;token=190b85e4-af7f-43de-8df8-6129a5292248" alt="" data-size="line">Integrate Masterdata into your application](/apis-or-data-integration/how-to-access-masterdata)                          |
| [<img src="https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FFInInkJQiJ5VS3ZJlXSj%2Ftransfer-alt-regular-24.png?alt=media&amp;token=c0a95609-d9eb-460a-83ed-38381d97dbf2" alt="" data-size="line">Integrate Transactional data into your application](/apis-or-data-integration/how-to-access-transactional-data)      |
| [<img src="https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FOWBWxes1CILV8qm5jAon%2Fdocker-logo-24.png?alt=media&amp;token=2cca091b-df3d-4409-9669-d8892050326c" alt="" data-size="line">Docker with credentials in a `docker-compose.yml` file](/docker-information)                                                  |
| <img src="https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FwhRi06mVOweTsJmCkyy0%2Fcheck-square-solid-24.png?alt=media&amp;token=6a0476e5-6f86-4505-8c26-d2202796bf77" alt="" data-size="line">[Configuring App permissions](/onboarding-to-industryapps/onboard-application/configure-application/app-permission)     |


# Getting Started

Application development guidelines

## Development Process

<div align="center"><img src="https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FC66vBKqfpNACO36rnCtg%2Fnewa.png?alt=media&amp;token=e727ff48-eded-40b8-b50d-8108fcc27d0b" alt=""></div>

### [<mark style="color:red;">Registration</mark>](/onboarding-to-industryapps)

Register for a Vendors developer account to configure and setup the details for your applications which provide access to:

* Customisation of applications customer-facing information.
* Application Credentials which are required to publish, such as:
  * App Token
  * App Secret Code
  * App Code
  * App unique URL
* Access to Masterdata & Transactional data permissions.
* Configuration of application type, context, licensing, pricing and more.
* Publication of applications onto the IndustryApps store.

### [<mark style="color:orange;">Integrate</mark>](/apis-or-data-integration)

The application to be published on the IndustryApps platform has the option to integrate AAS & Submodel data which is collected by IndustryApps from its users to be utilised for application solutions.

* [**AAS & Submodel data**](/apis-or-data-integration)
  * Available by accessing Masterdata and Transactional data endpoints.
* [**Accessing Endpoints**](/authentication)
  * Require Application credentials such as App Token, App Secret Code, AppCode & User Token.
* [**Postman**](https://www.postman.com/industryappstech/workspace/industryapps-aas-gateway/overview)
  * Endpoints behaviour can be observed through the **IndustryApps Postman collection** or by navigating to [**Testing**](/testing).

### [<mark style="color:blue;">Connect</mark>](/connect-to-the-platform)

Externally hosted applications such as SaaS or other, can be connected to the IndustryApps platform by Eureka Service Discovery. Connection through Eureka are available through two options:

* **Configuring & Integrating Eureka endpoints** (Some app modification may be required).
* **Utilising the Pre-defined Sidecar**
  * Addition of the Sidecar does not require any changes to an existing application, simply adding the Sidecar on your dedicated `docker-compose.yml` file with the required app credentials or utilising the available Sidecar executable.

### [<mark style="color:purple;">Publish</mark>](/onboarding-to-industryapps/publish-to-marketplace)

Publish the application through the Vendor Developer dashboard, once the application status has been approved and all required information has been submitted the app will be available for testing and production deployment.

#### Get started by reviewing the fundamentals or jumping straight into integrating Platform available data and publishing onto the IndustryApps.

{% content-ref url="/pages/-Miqbh8eMLBdDD9PdrK-" %}
[Registration](/onboarding-to-industryapps)
{% endcontent-ref %}


# Fundamentals

There are no technology barriers for creating an application for the IndustryApps platform. The following tutorials provide examples on deploying applications onto IndustryApps by utilising Eureka Service Discovery and the Pre-defined Sidecar.

![Fundamentals Upcoming Tutorials](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FUN4wU7YMIlUvLdShpNJq%2FAsset%207.png?alt=media\&token=b89c4d78-347d-4044-bbe2-aae23ea1993c)


# Deploy an App via Pre-defined Sidecar

Introduction: Deploying an externally hosted app via Quick start tutorial.

An introduction to developing a simple full-stack application, then publishing it onto the platform using the pre-defined Sidecar through a step-by-step approach. The Tech stack used in the tutorial will be Python FastAPI for our server-side API, served by Nuxt JS, a sub framework of Vue JS. The app will output a JSON response, fetched and displayed on our client-side app.

{% hint style="info" %}
If you'd like to jump straight into the deployment tutorial with Docker, [skip here](/fundamentals/deploy-an-app-via-pre-defined-sidecar/sidecar-tutorial-docker-and-deploy).
{% endhint %}

Steps:

* Create a Developer account on the platform.
* Configure a simple FastApi stateless Restful API.
* Configure & Fetch our API data and display the response on Nuxt js.
* Write up a docker-compose build for the full-stack app, including the Sidecar.

Register a Developer account

To get access to the required information as part of publishing an app onto the platform, registration is required.

The required details to bear in mind:

* App Id
* App Secret Code
* App Code

**Follow the step by step instructions available to register:**

{% content-ref url="/pages/wHWXvp8UFyiwgHNW7r9t" %}
[Register Developer Account](/onboarding-to-industryapps/register-developer-account)
{% endcontent-ref %}

Complete Basic App Information and publish the application. Once you've completed this step, proceed to build the application.

{% content-ref url="/pages/HFgNX0wZvZ9qKFlmuHgI" %}
[App basic information](/onboarding-to-industryapps/onboard-application/submit-appstore-details/app-basic-information)
{% endcontent-ref %}


# Sidecar Tutorial: Server-side

{% hint style="info" %}
Python 3.10 Is required to follow the Quick Start Tutorial.
{% endhint %}

In this part of the Quick Start tutorial, the server-side API will be made. Follow the steps below to complete the server-side tutorial.

Create a directory for your application project:

`QuickApp`

Inside the project directory create a directory named `server` and create:

* requirements.txt

```
fastapi
uvicorn
```

In terminal `cd` into server directory and run commands:

```bash
# Create virtual environment for python project.
python -m venv venv
```

```bash
# Activate virtual environment
source venv/bin/activate 
```

```bash
# install required dependencies
pip install -r requirements.txt
```

Once these commands have been executed and dependencies have been installed, create and copy in the main.py file as illustrated below:

{% code title="main.py" %}

```python
# FastApi Setup for the Quick Start Tutorial
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
import uvicorn

# Initiates the FastApi instance
app = FastAPI()

# Enabling CORS to allow access for the Client-side App.
app.add_middleware(
    CORSMiddleware,
    allow_origins=["*"],
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)

# Route for our API on index page to send over a simple message.
@app.get("/")
async def index():
    return {"message": "Welcome to IndustryApps!"}
```

{% endcode %}

This is a minimal setup to run a FastApi stateless Restful compliant API, this simply returns a message `"Welcome to IndustryApps!"` when fetched later on the client-side.

The command `uvicorn main:app` starts the API in case you'd like to test it, which refers to:

* `main`: the file `main.py` (the Python "module").
* `app`: the object created inside of `main.py` with the line `app = FastAPI()`.

By following the link which pops up on terminal you should see the message displayed on the browser window:

<div align="left"><img src="https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2F2gJYuxjzzhIv83pfR45r%2FScreenshot%202022-08-04%20at%2000.33.44.png?alt=media&amp;token=7474c139-16d4-4d3c-83e9-b3f9729c5c2f" alt=""></div>

FastApi automatically documents its endpoints. By adding `/docs` endpoint to your API url, the available endpoints of the API will be visible.

![GET endpoint inside /docs of FastAPI](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FSh9C6AX6dUPjwjkEoxLg%2FScreenshot%202022-08-04%20at%2000.36.15.png?alt=media\&token=6ed4f33d-8d6c-45fd-9f49-58a44da51af9)

The application will be built and run through docker-compose later in the tutorial. The next step will be building the client-side app with <img src="https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FB0FoK4DvVcI5RFk66xDR%2Fvuejs.png?alt=media&amp;token=8c2824de-3d91-4776-82f4-2cb9b2b89556" alt="" data-size="line">Vue /Nuxt js.


# Sidecar Tutorial: Client-side

In this part of the introductory tutorial, we will be building the client-side app with Nuxt JS a supporting framework for Vue JS.

Inside your `QuickApp` project directory, create a directory for the client-side app:

```bash
mkdir app
cd app
```

Create a package.json file

```bash
touch package.json
```

Copy into the package.json file the necessary dependencies

```json
{
    "name": "my-app",
    "scripts": {
        "dev": "nuxt",
        "build": "nuxt build",
        "generate": "nuxt generate",
        "start": "nuxt start"
    },
    "dependencies": {
        "@nuxtjs/axios": "^5.13.6",
        "nuxt": "^2.15.8"
    }
}
```

{% hint style="info" %}
`scripts` define Nuxt commands that will be launched with the command `npm run <command>`
{% endhint %}

Add Nuxt to the project by executing the following command in terminal, which will install and add the necessary node modules to the project.

```bash
npm install nuxt
```

Add a Nuxt configuration file to the app project directory so that we can define global variables such as API URL and any additional plugins we'd like to add.

```
touch nuxt.config.js
```

Copy into `nuxt.config.js` the following configurations. The client-side will call the API on `port 5000` once we containerise the application.

{% code title="nuxt.config.js" %}

```json5
export default {
    publicRuntimeConfig: {
        baseURL: process.env.BASE_URL || 'http://0.0.0.0:5000/'
      },
    server: {
        port: process.env.NUXT_PORT,
        host: process.env.NUXT_HOST
    },
    buildModules: [
    ],
    modules: [
    "@nuxtjs/axios"
    ],
    components: true,
    
}
```

{% endcode %}

In order to fetch data from the server-side API, the app will use Axios. Install Axios onto the app project setup, by running the following command in terminal.

```bash
npm install @nuxtjs/axios
```

Now, we can create a pages directory which will automatically create routes for each .vue file inside the directory.

```bash
mkdir pages
```

Create an `index.vue` file which will be the primary page on the app.

```bash
touch pages/index.vue
```

Populate the `index.vue` file:

```javascript
<template>
    <div>
        <h1> {{ messages.message }} </h1>
    </div>
</template>

<script>
export default {
    async fetch() {
        this.messages = await this.$axios.$get(this.$config.baseURL);
    },
    data(){
        return {
            messages: [],
        };
    },
};
</script>

<style lang="scss" scoped>

</style>

```

The `index.vue` file in the pages directory will call our message in the server-side API and display it as a title.

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FJgta439lwIvPrZGOM27H%2FScreenshot%202022-08-04%20at%2022.21.01.png?alt=media\&token=be2124e1-28a8-4e9f-9922-b98ea2c1f3cf)

{% hint style="warning" %}
If you are testing the application prior to containerising with docker, you may need to change the IP of the server-side app in `nuxt.config.js` temporarily to fit its default (port `8000` instead of port`5000`).
{% endhint %}

This concludes the required setup for the client-side app. The following step will containerise the application with the IndustryApps pre-defined Sidecar.


# Sidecar Tutorial: Docker & Deploy

The last step in configuring the application is to containerise the app with Docker. First we create a `Dockerfile` for the server-side API and the client-side app then compose a build using the demonstrated `docker-compose.yml` file available below.

### <img src="https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FglSCB8Cldt7fOEfKHgfR%2Fpython.png?alt=media&amp;token=8e3078c1-0844-4638-9672-0aebd0b04d9e" alt="" data-size="line">Python FastApi Container

Add the `Dockerfile` to the server directory.

{% code title="server/Dockerfile" %}

```docker
# Python FastApi Docker Build
FROM python:3.10
# Alternatively you can use different tags from https://hub.docker.com/r/nginx/unit
WORKDIR /server

COPY ./server/requirements.txt /server/requirements.txt

RUN pip install --no-cache-dir --upgrade -r /server/requirements.txt

# server/backend/requirements.txt
COPY . /server

EXPOSE 5000
# 
CMD ["uvicorn", "server.main:app", "--host", "0.0.0.0", "--port", "5000"]
```

{% endcode %}

The server-side API will run on port 5000, the client-side application will call the API for requests on this designated port.

### <img src="https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FB0FoK4DvVcI5RFk66xDR%2Fvuejs.png?alt=media&amp;token=8c2824de-3d91-4776-82f4-2cb9b2b89556" alt="" data-size="line">Vue / Nuxt js Container

Add the `Dockerfile` to the app directory.

{% code title="app/Dockerfile" %}

```docker
# Nuxt JS Docker Build
FROM node:16

# create destination directory
WORKDIR /app

COPY . .

COPY ./package*.json ./

COPY ./package-lock.json ./

RUN npm install && npm run build

#Ports to expose for client-side app, & sidecar connection.
EXPOSE 8080
ENV NUXT_HOST=0.0.0.0
ENV NUXT_PORT=80

```

{% endcode %}

### Docker-compose Application

The docker-compose.yml file will be composed of three sections.&#x20;

* FastAPI - Server-side API, run on port 5000. Container is named 'fastapi' as the name suggests.
* Vue/Nuxt js - Client-side application named frontend, run on port 80. Running the client-side app on port 80 will allow for automatic rerouting to port 443 while adding an ssl certificate to your application rather than having it run on another port and require a configuration for a reroute to port 80 later on.
* Sidecar - Connects the application to IndustryApps with your unique credentials.

{% code title="docker-compose.yml" %}

```docker
# Docker-compose build with Sidecar
version: '3.3'

services:
    fastapi:
      build: ./server
      container_name: fastapi
      ports:
        - "5000:5000"
      command:  uvicorn server.backend.main:app --reload --workers 1 --host 0.0.0.0 --port 5000
      restart: always
      tty: true
      
      
    frontend:
      build: ./app
      working_dir: /app
      ports:
        - "80:80"
      environment:
        - HOST=0.0.0.0
      container_name: nuxt-app
      command: npm run dev
      restart: always
      tty: true

    sidecar:
      image: industryapps.azurecr.io/service-discovery-sidecar
      container_name: sidecar
      environment:
         NODE_ENV: production
         DEPLOYMENT_MODE: public
         EUREKA_INSTANCE_IP: { IP }
         EUREKA_INSTANCE_PORT: { PORT }
         EUREKA_INSTANCE_APP: { APPCODE }
         EUREKA_HOST: servicediscovery.uat.industryapps.net
         EUREKA_PORT: 443
         EUREKA_INSTANCE_HOST_NAME: { HOSTNAME }

networks:
  default:
    driver: bridge

```

{% endcode %}

Inside the `docker-compose.yml` file, add the necessary information which is tagged with curly braces ' `{  }` '.&#x20;

* **`IP`** -> The IP of the web service which you are running, such as on AWS EC2 Ubuntu, Lightsail instance or Azure Web services as an example.
* **`PORT`** -> The port which the app client-side is served at (e.g. Port 80).
* **`APPCODE`** -> Navigate to your Developer dashboard > Applications > {App Name} > App Data, the Application code will be available there.
* **`HOSTNAME`** -> The domain of the application such as: \
  `https://sample-app.com/<<AppCode>>`.

### Deployment

Once the docker-compose has been updated accordingly, the app can be run by:

Building the container:

* `docker-compose build`

Run the container:

* `docker-compose up`

The application will need to be connected with a hostname which is ssl certified. There are various affordable or free options available to upload your application to a web service to accommodate this requirement.&#x20;

#### Obtaining a Hostname and utilising a Web Service for hosting the application externally

For this tutorials purpose you can use [AWS Lightsail](https://aws.amazon.com/lightsail/), which offers Ubuntu Instances. After you've registered with AWS:

* &#x20;The Lightsail instance can receive a free certificate from [AWS ACM](https://aws.amazon.com/certificate-manager/) which can be used by the [Elastic load balancer](https://aws.amazon.com/elasticloadbalancing/).&#x20;
* The load balancer can connect to your Lightsail instance by [enabling VPC peering](https://lightsail.aws.amazon.com/ls/docs/en_us/articles/lightsail-how-to-set-up-vpc-peering-with-aws-resources) on your Lightsail Instance then copying the Lightsail instance Private IP into the [elastic load balancer](https://aws.amazon.com/elasticloadbalancing/) which has the ssl certificate.
* Once the web service instance has been configured, the built application can be moved to the web service instance through `scp which is a secure copy with directory structure kept.`

Example:

```
scp -i MyLightsailKey.pem -r /path/to/application/root/folder/ ubuntu@<<instance-ip>>
```

Once the application has been setup in the appropriate environment, by running the [docker-compose commands](#deployment), a status code 204 showing successful registration should notify the app has been connected.


# Deploy an App with Eureka

Build an App under 5 minutes.

This guide helps you in creating your first application with IndustryApps AppStore.

Before creating the application you need to complete the registration step as explained under [Register developer account](/onboarding-to-industryapps/register-developer-account).&#x20;

## How to develop an application <a href="#how-to-develop-an-application" id="how-to-develop-an-application"></a>

The application tutorial here is only to provide you a quick approach to create a simple hello world application using Eureka and view it inside IndustryApps. It would give you a quick understanding on the business model by utilising the Eureka Service Discovery.&#x20;

### # Step 1 Creating node application <a href="#step-1-creating-node-application" id="step-1-creating-node-application"></a>

`npm init -y`

### # Step 2 Implementing basic requirements <a href="#step-2-implementing-basic-requirements" id="step-2-implementing-basic-requirements"></a>

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FceuGtSfQjqPXw9KtvJTH%2Fapplication-registry.png?alt=media\&token=39d0fb8c-d88a-4ff6-aad8-df07080074aa)

#### # Step 2.1 Adding Dependencies <a href="#step-2-1-adding-dependencies" id="step-2-1-adding-dependencies"></a>

`npm install eureka-js-client express nodemon --save`

* eureka-js-client to implement registry sync
* express as application server
* nodemon to react with changes without reloading

#### # Step 2.2 Creating basic server and implementing application registry sync <a href="#step-2-2-creating-basic-server-and-implementing-application-registry-sync" id="step-2-2-creating-basic-server-and-implementing-application-registry-sync"></a>

```javascript
'use strict';

const express = require('express');
const Eureka = require('eureka-js-client').Eureka;
const APPLICATION_CODE = process.env.APPLICATION_CODE;
const APP_REGISTRY_HOST = process.env.APP_REGISTRY_HOST;
const APP_REGISTRY_PORT = process.env.APP_REGISTRY_PORT;
const APP_HOST = process.env.APP_HOST;
const APP_PORT = process.env.APP_PORT;
const app = express();

// example configuration
const client = new Eureka({
    // application instance information
    instance: {
        app: `${APPLICATION_CODE}`,
        hostName: APP_HOST,
        ipAddr: APP_HOST,
        statusPageUrl: `http://${APP_HOST}:${APP_PORT}`,
        vipAddress: `${APPLICATION_CODE}`,
        port: {
            $: APP_PORT,
            '@enabled': 'true',
        },
        dataCenterInfo: {
            '@class': 'com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo',
            name: 'MyOwn',
        },
        registerWithEureka: true,
        fetchRegistry: true,
    },
    eureka: {
        // eureka server host / port
        host: APP_REGISTRY_HOST,
        port: APP_REGISTRY_PORT,
        servicePath: '/eureka/apps/',
    },
});


client.logger.level('debug');
client.start(error => {
    console.log(error || 'NodeJS Started!');
    app.get('/', (req, res) => {
        res.sendFile(__dirname + '/index.html', err => console.log);
    });
});

app.listen(APP_PORT, APP_HOST);
console.log(`Running on http://${APP_HOST}:${APP_PORT}`);

```

#### # Step 2.3 Adding theming and basic components <a href="#step-2-3-adding-theming-and-basic-components" id="step-2-3-adding-theming-and-basic-components"></a>

```html
<html>
<head>
    <title>Sample App</title>
    <link href="/dam/public/iapp-ui-styles/v.1.0.0/main.css">
    <script src="/dam/public/iapp-generics/v.1.0.1/iapp-generics.js"></script>
</head>
<body>
    <iapps-require-module>
        <iapps-module name="basic"></iapps-module>
    </iapps-require-module>
    <iapps-header-sidebar></iapps-header-sidebar>
    <div class="content-area bg-grey">
        <h1>Hello from sample app</h1>
    </div>
</body>
</html>
```

{% hint style="info" %}
Following urls `/dam/public/iapp-ui-styles/v.1.0.0/main.css` and`/dam/public/iapp-generics/v.1.0.1/iapp-generics.js` will be resolved when you access the application via local gateway.
{% endhint %}

### # Step 3 Packing as Docker image <a href="#step-3-packing-as-docker-image" id="step-3-packing-as-docker-image"></a>

```
FROM node:carbon

# create the app directory for inside the Docker image
WORKDIR /usr/src/app

# install app dependencies from the package.json (and the package-lock.json)
COPY package*.json ./

RUN npm install

# bundle app source inside Docker image
COPY . .

# expose port 8080 to have it mapped by Docker daemon
EXPOSE 8080

# define the command to run the app (it's the npm start script from the package.json)
# npm start
CMD [ "npm", "start" ]
```

### # Step 4 Access platform with credentials <a href="#step-5-access-platform-with-credentials" id="step-5-access-platform-with-credentials"></a>

When accessing the URL of the platform provided by the team you will find a screen like below.

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FnU20RPLZgTsh1QsvmLKx%2Fsample-app-platform-screen.png?alt=media\&token=b9fe9f30-12eb-4f80-851b-b81f781a7920)

When clicking on the menu item

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FMp84Da82TcM7wiQM9rgB%2Fsample-app-screen.png?alt=media\&token=80130763-7485-499d-a649-b10b48854676)

you will be redirected to your app. Screenshot based on above snippet is given below.


# Design Guidance

Style guide and CSS support

IndustryApps style guide is documented in the below page. Applications available on the IndustryApps platform should follow a consistent style guide, please take care to review the following resource as reference.

{% embed url="<https://zeroheight.com/4689a5cf1/p/12d8a2-industryapps-design-system>" %}


# Authentication

### Onboard an existing application

Onboarding an existing application that does not require data context from its users or the platform does not require additional authentication beyond application credentials passed through Eureka or the Pre-defined Sidecar. To utilise collected AAS & Submodel data, further configuration is required.

### User Context

The IndustryApps platform allows hosted applications to interact with users through a user management and permission system, which is available through the dedicated `platform-api.js` API that can be integrated into your application.&#x20;

An authentication token unique to a user is required to utilise AAS & Submodel data collected by users. Additional information can be found in [Accessing data exposed by the platform](/authentication/accessing-data-exposed-by-the-platform).

The API requires the application to be interacted on the platform. Outside of the platform scope, application authentication is automatically denied. Thus, our dedicated team provides a demo customer portal for testing purposes once the application has been onboarded to the platform.

### Application Identification

To utilise data integration exposed by the platform, the application is required to post a request for an access token to a dedicated endpoint. The access token expires 30 seconds after each response by the endpoint.&#x20;

Each request to the platform endpoints requires both an application access token and a user token available by the user management and permission API. Additional information can be found in [Data Integration](/apis-or-data-integration).


# Accessing data exposed by the platform

You can access the data exposed by the platform through the IndustryApps **AAS Gateway**, which has REST endpoints provided by the IndustryApps Platform.  You will get an `AppID` and `AppSecretCode` when you register your application to IndustryApps in the Solution Provider portal. These credentials can be used to create an `AccessToken` . This AccessToken needs to be sent with every request of API. Along with this, you need to provide the`UserToken`which you will get from the below integration.

#### &#x20;Platform javascript API <a href="#id-2-1-platform-javascript-api" id="id-2-1-platform-javascript-api"></a>

import `platform-api.js` into main file (index.html) and invoke `getPlatformContext()` method. It will return an object with params:

* auth\_token
* euser
* plant\_selected
* language\_selected
* plant\_list
* company\_code
* roles

{% code title="index.html" %}

```html
<script src="https://cdn.uat.industryapps.net/cdn/js/v1/platform-api.js" type="text/javascript"></script>
```

{% endcode %}

```
// Example in Vue js
export default {
    head: {
        script: [
            { hid: 'getPlatformContext', 
            src: 'https://cdn.uat.industryapps.net/cdn/js/v1/platform-api.js', 
            defer: true }
        ]
    }
}

```

**API documentation**

**Methods**

`getPlatformContext() → {Object}` This function returns an object with params auth\_token, euser, plant\_selected, language\_selected, plant\_list, company\_code, roles.

Returns: `platformContext` Type:

```
-Object
```

```
// Call getPlatformContext() after adding the CDN script.
const userData = getPlatformContext();
// e.g. auth_token callable at: userData.auth_token
```

**Type Definitions**

<table><thead><tr><th width="203.9090909090909">Name</th><th width="150">Type</th><th>Description</th></tr></thead><tbody><tr><td>auth_token</td><td>string</td><td>Token to be used in the header of every service call (UserToken)</td></tr><tr><td>euser</td><td>string</td><td>User code of logged in user</td></tr><tr><td>language_selected</td><td>string</td><td>Language code of selected language, default is 'en'</td></tr><tr><td>plant_selected</td><td>string</td><td>Id of selected plant</td></tr><tr><td>plant_list</td><td>object array</td><td>plant list</td></tr><tr><td>company_code</td><td>string</td><td>Current company code</td></tr><tr><td>roles</td><td>string array</td><td>User roles</td></tr></tbody></table>

#### Sample Response

```json
{
    "auth_token": "eb837c91-bee4-4011-8af5-1f7af649be92",
    "euser": "heera@xeiex.com",
    "plant_selected": "1",
    "language_selected": "en",
    "plant_list": [
        {
            "plantId": 2,
            "plantName": "Kilsyth",
            "plantCode": "5698",
            "defaultPlant": false
        },
        {
            "plantId": 1,
            "plantName": "Brisbane 01",
            "plantCode": "0987",
            "defaultPlant": true
        }
    ],
    "company_code": "1234",
    "roles": [
        "GRP_M_ADD",
        "TOOL_CRD_VIEW",
        "SOP_A_VIEW",
        "TSOP_M_ADD",
        "QSOP_IU_DEL",
        "OPR_ACT_ADD",
        "VENDOR_M_EDIT",
        "PROC_TYP_M_DEL",
        "QSOP_V_VIEW",
        "COM_M_EDIT",
        "DTC_EDIT",
        "8e08d9_Add_VIEW",
        "MACH_M_EDIT",
        "SOP_M_ADD",
        "QC_VIEW"
    ]
}
```


# Single Sign-On

{% hint style="info" %}
Single Sign-on is currently being upgraded, additional features will continue to be implemented.
{% endhint %}

SSO Authentication, in collaboration with IndustryApps, allows users to access authorised only application resources by integrating IndustryApps login single sign-on into your application. The feature can be integrated as an addition to your externally hosted application's currently held single sign-on options.

## IndustryApps Single Sign-on (SSO)

Once SSO is set up, third-party app users can sign into IndustryApps and access their resources without requiring an additional sign-in. SSO redirects to the IndustryApps login portal, requesting the users' credentials such as username and password, which gives users access to their authentication restricted resources.

{% hint style="warning" %}
Single Sign-on does not grant permissions for applications for Data Integration. To utilise [Masterdata](/apis-or-data-integration/how-to-access-masterdata), [Transactional data](/apis-or-data-integration/how-to-access-transactional-data) and [Submodel data](/apis-or-data-integration/submodel-index) please see [Data Integration](/apis-or-data-integration).
{% endhint %}

### IndustryApps SSO Model

![SSO Model](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2Fwuki4XhlJqQben8ggeGD%2FSSO-PORTAL.png?alt=media\&token=9d219d08-cb0f-4f86-8233-43e94fc5af1c)

### SSO Example in your Third-party Application

![Sign-in Options](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FjeeUK2tKGmJf6CAUN8pr%2Flogin-page-updated.png?alt=media\&token=ed841471-bd9d-40ff-96d7-2cbfdd433abf)

## Integrating SSO

The upcoming examples illustrates how SSO can be integrated within your applications' code with IndustryApps SSO in the following technologies.

Configure and Utilise Client-side Applications such as:

* Angular
* Vue

Accept JWT with Server-side Applications such as:

* Java Spring 5
* Python Django

### **Credentials**

To utilize SSO the following credentials are required to be implemented in your application configuration:

* **Issuer**

For **Development** purposes please utilise the UAT environment URI available below:

{% code overflow="wrap" %}

```url
https://auth.uat.industryapps.net/auth/realms/IndustryApps
```

{% endcode %}

For **Production**, please utilise the environment URI available below:

```
https://auth.industryapps.net/auth/realms/IndustryApps
```

* **ClientID**

Each Application which utilises Single Sign-on will be provided a dedicated ClientID during onboarding which acknowledges access.

* **Redirect URI**

The application will require a redirect URI to navigate back after authentication has been completed. The structure of the URI should be implemented as seen below.

***Development:***

```
https://democustomer.uat.industryapps.net/<APPCODE>/
```

***Deployment:***

```
https://democustomer.industryapps.net/<APPCODE>/
```

Deployment will contain the environment URI of the platform customer portal instead of the demo-customer portal.&#x20;

### Optional

**Client Secret**

If your application is currently utilizing an identity and access management service provider which requires a client secret, use the client secret code available on your Platform Dashboard. **By default it is not required.**

<figure><img src="https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FakwSEY3N11zBOwLAEZS9%2FScreenshot%202022-09-30%20at%2011.47.09.png?alt=media&amp;token=8175cdeb-8ff1-40d4-af20-22ad29c98758" alt=""><figcaption><p><strong>Applications > My_APP > App Information</strong></p></figcaption></figure>

**Metadata URL**

In cases such as an identity provider requiring a `.well-known/openid-configuration` URL please use the following credential:

For **development** purposes please utilise the UAT environment URI available below:

```
https://auth.uat.industryapps.net/auth/realms/IndustryApps/.well-known/openid-configuration
```

For **deployment**, please utilise the environment URI available below:

```
https://auth.industryapps.net/auth/realms/IndustryApps/.well-known/openid-configuration
```


# Angular

How to integrate Single Sign-on with Angular and Java Spring 5 frameworks

## Integrating SSO with <img src="https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FBmtqrLljO6DgXHOOiiJB%2Fangular-icon.svg?alt=media&amp;token=a679de04-b93e-4329-905e-c0a31c76ac92" alt="" data-size="line">Angular

The following example illustrates how SSO can be integrated within your applications' code. The example shows how would an application using `Angular` enable the SSO feature via **OpenID-Connect.**

### Angular Guide for SSO OpenID-Connect

This Angular guide requires the following dependency via npm:

* `angular-oauth2-oidc`

**Run in terminal:**

```
npm install angular-oauth2-oidc --save
```

Add an `environment.ts` file to your project directory. This will contain the required credentials to connect to IndustryApps Keycloak OpenID-Connect.

{% code title="environment.ts" overflow="wrap" lineNumbers="true" %}

```javascript
export const environment = {
  production: true,
  envName: 'local',
  keycloak: {
    // Url of the Identity Provider
    issuer: 'https://auth.uat.industryapps.net/auth/realms/IndustryApps',

    // URL of the SPA to redirect the user to after login (Development Env)
    redirectUri: 'https://democustomer.uat.industryapps.net/<APPCODE>/',

    // The SPA's id. 
    // The SPA is registerd with this id at the auth-serverß
    clientId: 'APPID',

    responseType: 'code',
    // set the scope for the permissions the client should request
    // The first three are defined by OIDC.
    scope: 'openid profile email',
    // Remove the requirement of using Https to simplify the demo
    // THIS SHOULD NOT BE USED IN PRODUCTION
    // USE A CERTIFICATE FOR YOUR IDP
    // IN PRODUCTION
    requireHttps: false,
    // at_hash is not present in JWT token
    showDebugInformation: true,
    disableAtHashCheck: true
  }
};

```

{% endcode %}

Include an authconfig sub-directory in your project directory. Create an authconfig.module.ts file which initialises an oauth2-oidc module as illustrated below:

{% code title="authconfig.module.ts" overflow="wrap" lineNumbers="true" %}

```javascript
import { NgModule, APP_INITIALIZER } from '@angular/core';
import { HttpClientModule } from '@angular/common/http';
import { OAuthModule, AuthConfig } from 'angular-oauth2-oidc';

import { AuthConfigService } from './auth-config.service';
import { authConfig, OAuthModuleConfig } from './auth.config';

export function init_app(authConfigService: AuthConfigService) {
    return () => authConfigService.initAuth();
}

@NgModule({
  imports: [ HttpClientModule, OAuthModule.forRoot() ],
  providers: [
    AuthConfigService,
    { provide: AuthConfig, useValue: authConfig },
    OAuthModuleConfig,
    { 
      provide: APP_INITIALIZER, 
      useFactory: init_app, 
      deps: [ AuthConfigService ], 
      multi: true
    }
  ]
})
export class AuthConfigModule { }

```

{% endcode %}

Add an `auth.config.ts` file in the `authconfig` sub-directory. `auth.config.ts` would utilise the environment variables configured in the `environment.ts` file made previously.

{% code title="auth.config.ts" overflow="wrap" lineNumbers="true" %}

```javascript
import { AuthConfig } from 'angular-oauth2-oidc';
import { environment } from '../../environments/environment';

export const authConfig: AuthConfig = {

    // Url of the Identity Provider
    issuer: environment.keycloak.issuer,

    // URL of the SPA to redirect the user to after login
    redirectUri: environment.keycloak.redirectUri,

    // The SPA's id. 
    // The SPA is registerd with this id at the auth-serverß
    clientId: environment.keycloak.clientId,

    responseType: environment.keycloak.responseType,
    // set the scope for the permissions the client should request
    // The first three are defined by OIDC.
    scope: environment.keycloak.scope,
    // Remove the requirement of using Https to simplify the demo
    // THIS SHOULD NOT BE USED IN PRODUCTION
    // USE A CERTIFICATE FOR YOUR IDP
    // IN PRODUCTION
    requireHttps: environment.keycloak.requireHttps,
    // at_hash is not present in JWT token
    showDebugInformation: environment.keycloak.showDebugInformation,
    disableAtHashCheck: environment.keycloak.disableAtHashCheck
};


export class OAuthModuleConfig {
    resourceServer: OAuthResourceServerConfig = {sendAccessToken: false};
}

export class OAuthResourceServerConfig {
    /**
     * Urls for which calls should be intercepted.
     * If there is an ResourceServerErrorHandler registered, it is used for them.
     * If sendAccessToken is set to true, the access_token is send to them too.
     */
    allowedUrls?: Array<string>;
    sendAccessToken = true;
    customUrlValidation?: (url: string) => boolean;
}
```

{% endcode %}

Add an `auth-config.service.ts` file to the `authconfig` sub-directory which sets up OAuthService. `auth-config.service.ts` initialises a login page if authorisation is required otherwise initialises the app instance.

{% code title="auth-config.service.ts" overflow="wrap" lineNumbers="true" %}

```javascript
import { Injectable } from '@angular/core';
import { AuthConfig, NullValidationHandler, OAuthService } from 'angular-oauth2-oidc';
import { filter } from 'rxjs/operators';

@Injectable()
export class AuthConfigService {
    
    private _decodedAccessToken: any;
    private _decodedIDToken: any;
    get decodedAccessToken() { return this._decodedAccessToken; }
    get decodedIDToken() { return this._decodedIDToken; }

    constructor(
      private readonly oauthService: OAuthService,
      private readonly authConfig: AuthConfig,
    ) {}

    async initAuth(): Promise<any> {
      return new Promise<void>((resolveFn, rejectFn) => {
        // setup oauthService
        this.oauthService.configure(this.authConfig);
        this.oauthService.setStorage(localStorage);
        this.oauthService.tokenValidationHandler = new NullValidationHandler();
  
        // subscribe to token events
        this.oauthService.events
          .pipe(filter((e: any) => {
            return e.type === 'token_received';
          }))
          .subscribe(() => this.handleNewToken());
          
        // continue initializing app or redirect to login-page
        
        this.oauthService.loadDiscoveryDocumentAndLogin().then(isLoggedIn => {
          if (isLoggedIn) {
            this.oauthService.setupAutomaticSilentRefresh();
            resolveFn();
          } else {
            this.oauthService.initImplicitFlow();
            rejectFn();
          }
        });
        
      });
    }
  
    private handleNewToken() {
      this._decodedAccessToken = this.oauthService.getAccessToken();
      this._decodedIDToken = this.oauthService.getIdToken();
    }

}
```

{% endcode %}

Add `auth-config.service.spec.ts` to the `authconfig` sub-directory which is the last requirement to be added in the authconfig sub-directory.

{% code title="auth-config.service.spec.ts" overflow="wrap" lineNumbers="true" %}

```javascript
import { TestBed } from '@angular/core/testing';

import { AuthConfigService } from './auth-config.service';

describe('AuthConfigService', () => {
  let service: AuthConfigService;

  beforeEach(() => {
    TestBed.configureTestingModule({});
    service = TestBed.inject(AuthConfigService);
  });

  it('should be created', () => {
    expect(service).toBeTruthy();
  });
});

```

{% endcode %}

So far the addition of the `authconfig` sub-directory includes:

{% code title="authconfig" %}

```bash
.
├── auth-config.service.spec.ts
├── auth-config.service.ts
├── auth.config.ts
└── authconfig.module.ts
```

{% endcode %}

Be sure to import the environment into the `main.ts` file in your app directory. e.g.&#x20;

{% code overflow="wrap" lineNumbers="true" %}

```javascript
import { environment } from './environments/environment';
```

{% endcode %}

A full `main.ts` file example is illustrated below, given you've designated both an `environment.prod.ts` version and `environment.ts` file in an environments sub-directory.

{% code title="main.ts" overflow="wrap" lineNumbers="true" %}

```javascript
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { AppModule } from './app/app.module';
import { environment } from './environments/environment';

if (environment.production) {
  enableProdMode();
}

platformBrowserDynamic().bootstrapModule(AppModule)
  .catch(err => console.error(err));

```

{% endcode %}

A full demo sample client-side Angular app is available below provided as a reference.

{% embed url="<https://github.com/IndustryApps/SSODemo-Angular>" %}


# Vue

How to integrate Single Sign-on with Vue and Django frameworks

## Integrating SSO with <img src="https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FjLss1ehMkIR6SCZypVmr%2Ficons8-vue-js-48.png?alt=media&amp;token=b57e48e6-7437-43c2-9cc0-d3d9177f011b" alt="" data-size="line">Vue

The following guide provides a demo example to utilise SSO OpenID-Connect with Vue for IndustryApps. Additional adjustments may be required depending on your current configurations.

This Vue guide requires the following dependency installations via npm or yarn:

* `"keycloak-js"`
* `"vue-router"`

Once the required dependencies have been installed, a router folder should be created or a router addition should be implemented to include authentication directories.

{% code title="index.js" overflow="wrap" lineNumbers="true" %}

```javascript
import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/components/Home'
import AuthorisedPage from '@/components/AuthorisedPage';

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Home',
      component: Home
    },
    {
      path: '/auth',
      name: 'AuthorisedPage',
      component: AuthorisedPage
    }
  ],
  mode:'history'
})


```

{% endcode %}

A model folder can be created in the client-side app project directory with keycloak configurations embedded with the required Industryapps Keycloak credentials which will then point to IndustryApps Keycloak resources.

Two files are to be added for this guide.

{% code title="Config.js" overflow="wrap" lineNumbers="true" %}

```javascript
export const CookieName = "Keycloak_Auth";
export const Config = {
    // URI is designated for development environment
    "url": "https://auth.uat.industryapps.net/auth/realms/IndustryApps",
    "realm": "IndustryApps",
    "clientId": "my-client-id"
}
```

{% endcode %}

The `Functions.js` file would contain functions which retrieve a user, create and utilise a Cookie for Keycloak which passes credentials.

{% code title="Functions.js" overflow="wrap" lineNumbers="true" %}

```javascript
export const getCurrentUser = () => {
    if (GetCookieValue("Keycloak_Auth")) {
      return true;
    }
    return false;
}
export const GetCookieValue = (cookiename) => {
    console.log(cookiename)
    let getCookie = document.cookie.match(new RegExp('(^| )' + cookiename + '=([^;]+)'));
    if (getCookie) {
        return getCookie[2];
    } else {
        return false;
    }
}
export const SetCookieValue = (cookiename, value) => {
    let date = new Date();
    let daysToExpire = 1;
    date.setTime(date.getTime() + (daysToExpire * 24 * 60 * 60 * 1000));
    document.cookie = cookiename + "=" + value + "; expires=" + date.toGMTString() + "; path=/";
    return true;
}
export const parseToken = function(token) {
    if(token === ""){
        return null;
    }
    var base64Url = token.split('.')[1];
    var base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');
    var authObject = decodeURIComponent(atob(base64).split('').map(function(c) {
        return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
    }).join(''));
    return JSON.parse(authObject);
};
```

{% endcode %}

Create a file named Home.vue in inside the Components directory, the file should contain Keycloak initialisation for a login, which then directs and decides on the appropriate flows for authentication. The home page would simply contain a button in this case. On click triggers an event for logging in through IndustryApps via Keycloak OpenID-Connect.

{% code title="Home.vue" overflow="wrap" lineNumbers="true" %}

```javascript
<template>
  <div class="mdWrapper">
      <button class="btn-normal" v-on:click="authenticateLogin">Login</button>
  </div>
</template>

<script>
  import Keycloak from 'keycloak-js'
  import { CookieName, Config } from '../model/Config';
  import { SetCookieValue } from '../model/Functions';
  // keycloak initialisation options
  let keycloak = Keycloak(Config);
  export default {
    name: 'Home',
    created: function(){
      keycloak.init({ flow: 'implicit', checkLoginIframe: false }).then((authenticated) => {
        try{
          if(!authenticated) {
            console.log("Not Authenticated");
            return false;
          } else {
            console.log("Authenticated");
          }
          SetCookieValue(CookieName, keycloak.token);
          this.$router.push({name: 'AuthorisedPage'})
        }
        catch(error){
          console.log("Authentication failed, Error: \n" + error);
        }
      })
    },
    methods: {
      authenticateLogin: function(){
        keycloak.login({ redirectUri: window.location.origin })
      }
    }
  }
</script>

```

{% endcode %}

Create a demo page for an authorised user named AuthorisedPage.vue

{% code title="AuthorisedPage.vue" overflow="wrap" lineNumbers="true" %}

```javascript
<template>
  <div class="wrapper">
      <h5>{{username}}</h5>
  </div>
</template>

<script>
  import { CookieName } from '../model/Config';
  import { parseToken, GetCookieValue } from '../model/Functions';
  export default {
    name: 'AuthorisedPage',
    created: function(){
      if(!GetCookieValue(CookieName)){
        this.$router.push({name: 'Home'});
      }
    },
    data: function(){
      return {
        username: parseToken(GetCookieValue(CookieName)).username
      }
    }
  }
</script>

```

{% endcode %}


# Java Spring: Accepting JWT

## Accepting JWT Tokens from IndustryApps

### Configuring your Third-Party Application to accept JWT tokens acquired from IndustryApps

JWT tokens would either be acquired from your Third-Party App’s existing Authentication system or from IndustryApp’s Keycloak authentication configuration.&#x20;

{% hint style="info" %}
Keycloak is an open source software product to allow single sign-on with Identity and Access Management aimed at modern applications and services.
{% endhint %}

### Handling multiple JWT issuers with Spring Security 5

The following example illustrates how to provision multiple JWT issuers with the resource server in **Spring Security 5** with `WebSecurityConfigurerAdapter`.&#x20;

{% hint style="info" %}
Additional information about `WebSecurityConfigurerAdapter` in Spring 5 [can be found here.](https://docs.spring.io/spring-security/site/docs/current/api/org/springframework/security/config/annotation/web/configuration/WebSecurityConfigurerAdapter.html)
{% endhint %}

```java
_@Override 
    protected void configure(HttpSecurity http) throws Exception {
      JwtIssuerAuthenticationManagerResolver authenticationManagerResolver = new JwtIssuerAuthenticationManagerResolver( 
                "https://iapp-keycloak/auth/realms/iapp-realm", 
                "http://thirdparty-app-existing-auth2/openid" 
        ); 
    http.cors() 
                .and() 
                .authorizeRequests() 
                .anyRequest() 
                .authenticated() 
                .and() 
                .oauth2ResourceServer(oauth2 -> oauth2.authenticationManagerResolver(authenticationManagerResolver)) 
                .csrf() 
                .disable(); 
    } 
```

#### Controller

Inside the controller implement the following:

```java
@GetMapping(value = "/user/profile", produces = MediaType.APPLICATION_JSON_VALUE) 
    public User getUserProfile(@AuthenticationPrincipal Jwt principal, HttpServletRequest request) { 
        return new User("1", principal.getClaimAsString("preferred_username")); 
    } 
```

This controller configuration will allow requests routed either via an IndustryApps JWT token or with your Third-Party Applications' JWT token.

#### Existing User Role Mapping with the IndustryApp JWT Token

For checking user roles we have to map your Third-Party App’s roles into Springs' UserDetailsService function using the JwtTokenFilter function feature to allow recognition of the roles.


# Python Django: Accepting JWT

## Accepting JWT Tokens from IndustryApps

### Configuring your Third-Party Application to accept JWT tokens acquired from IndustryApps

JWT tokens would either be acquired from your Third-Party App’s existing Authentication system or from IndustryApp’s Keycloak authentication configuration.&#x20;

{% hint style="info" %}
Keycloak is an open source software product to allow single sign-on with Identity and Access Management aimed at modern applications and services.
{% endhint %}

### Handling multiple JWT issuers with Django, Python

In this case, handling multiple JWT issuers for SSO can be configured by utilising `django-allauth` package (i.e `pip install django-allauth`).

Inside `settings.py` add in the required config for `allauth`, if this has not been added already.

{% code title="settings.py" overflow="wrap" lineNumbers="true" %}

```python
INSTALLED_APPS = [
    ...
    # The following apps are required:
    'django.contrib.auth',
    'django.contrib.messages',
    'django.contrib.sites',

    'allauth',
    'allauth.account',
    'allauth.socialaccount',
    # if allauth is already installed, then keycloak as a provider should be added
    'allauth.socialaccount.providers.keycloak',
]
```

{% endcode %}

Django `allauth` requires the context request processor, inside `OPTIONS`.

```
'OPTIONS': {
            'context_processors': [
                # Already defined Django-related contexts here

                # `allauth` needs this from django
                'django.template.context_processors.request',
            ],
```

`AUTHENTICATION_BACKENDS` inside `settings.py` should include the following configuration.

```
AUTHENTICATION_BACKENDS = [
    ...
    # required for login by username in Django admin, regardless of `allauth` config
    'django.contrib.auth.backends.ModelBackend',

    # `allauth` specific authentication methods, such as login by e-mail etc
    'allauth.account.auth_backends.AuthenticationBackend',
    ...
]

```

As Django Admin uses the `auth contrib` application, the SSO can be integrated through the python-social-auth setting defined in the `settings.py` configuration file.

{% code title="settings.py" overflow="wrap" lineNumbers="true" %}

```python
SOCIALACCOUNT_PROVIDERS = {
    'keycloak': {
        'KEYCLOAK_URL': "https://iapp-keycloak/auth/realms/iapp-realm",
        'KEYCLOAK_REALM': 'IndustryApps'
    }
}

```

{% endcode %}

Inside `urls.py` be sure to include the url pattern for `allauth`.

{% code title="urls.py" overflow="wrap" lineNumbers="true" %}

```python
urlpatterns = [
    ....
    path('accounts/', include('allauth.urls')),
]
```

{% endcode %}

{% hint style="info" %}
Additional information about `django-allauth` in Django, Python [can be found here.](https://django-allauth.readthedocs.io/en/latest/overview.html)
{% endhint %}


# User and Role Identification

Determine Logged in user and his role

The current user is one of the distinguishing parameters that every application must be aware of.  In IndustryApps, the current user is only an identifier, let's say `userId` . The `userId` is associated with a company identified by `companyId` . both these attributes combine to provide uniqueness to a request.&#x20;

Every user has roles that are associated with your application. Suppose you are bringing an application for warehouse handling, let's say Purchase Order Calendar, and your application has the following rights `VIEW_PO_CALENDAR` , `ADD_PO_CALENDAR` and `UPDDATE_PO_CALENDAR` . To identify a User you only need the `userID` , `companyId` , and a list of rights.&#x20;

While registering your application with the IndustryApps platform you can add all the rights corresponding to your application. We assign these rights to some users and allow them to visit your application with limited rights.&#x20;

Now let's describe this with the example of the Purchase Order Calendar. The application should be implemented in such a way that if the current user has \[*VIEW\_PO\_CALENDAR*] then you can allow him to VIEW the Purchase order calendar and not allowing to EDIT it and if rights contain \[ *VIEW\_PO\_CALENDAR*, *ADD\_PO\_CALENDAR*] then you should allow him to VIEW and ADD to Purchase order calendar.&#x20;

We follow the practice of making the application stateless. We pass to identify the details of the user associated with each request. You can get the current user responsible for the request from the platform API.

### Application Localization

Localization is one of the important features that every application must be aware of. Every application must react to the localization changes to the platform. Whenever a user switches the language the application will get a refresh request. You can get the currently selected language at the client side from the `platform-api.js`&#x20;


# APIs | Data Integration

Apps can access all IndustryApps Master Data as [Asset Administration Shells](/common-faq/what-is-an-asset-administration-shell).

AAS works with an on-demand access permission management system in IndustryApps. Apps can request access to different asset types, which the subscribed customer can allow or deny for each asset in their plant. Only the customer allowed assets will be accessible to the Apps.

An App's access permission is evaluated by an access token. Endpoints in the following sections illustrate how to access AAS & Submodel data categories via Masterdata, Transactional data.

### **Getting Access Token**

Access token can be generated using a REST API.

## Token Generation

<mark style="color:green;">`POST`</mark> `https://auth.uat.industryapps.net/auth/realms/IndustryApps/protocol/openid-connect/token`

Access Token generated in the response will be set in all AAS master data request header.

#### Headers

| Name                                           | Type                              | Description         |
| ---------------------------------------------- | --------------------------------- | ------------------- |
| content-type<mark style="color:red;">\*</mark> | application/x-www-form-urlencoded | Submit data as form |

#### Request Body

| Name                                             | Type                | Description                                   |
| ------------------------------------------------ | ------------------- | --------------------------------------------- |
| grant\_type<mark style="color:red;">\*</mark>    | client\_credentials |                                               |
| client\_id<mark style="color:red;">\*</mark>     | String              | Will be available in the App Information page |
| client\_secret<mark style="color:red;">\*</mark> | String              | Will be available in the App Information page |

{% tabs %}
{% tab title="200: OK Authorization Success" %}

```javascript
{
    "access_token":"eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJrcmJUeXU4b1lVUjZPcHlrd0pIMDNfN1IxS194MHU1ZnUwQ3hlSGliTThrIn0.eyJleHAiOjE2MjE4NTE5NTQsImlhdCI6MTYyMTg1MTY1NCwianRpIjoiMzZjMDE2NTYtODhkNC00NDIxLThiYmQtMDhjMDE1MGMwYjFkIiwiaXNzIjoiaHR0cHM6Ly9hdXRoLmRldi5pbmR1c3RyeWFwcHMubmV0L2F1dGgvcmVhbG1zL0FwcFN0b3JlIiwiYXVkIjoiYWNjb3VudCIsInN1YiI6IjlmM2UzMmM2LWYyMjMtNDNjMy04YjkwLTA2NDc3Nzg4ZTcyNyIsInR5cCI6IkJlYXJlciIsImF6cCI6InNlbnNvci5tb2ludG9yIiwiYWNyIjoiMSIsInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJvZmZsaW5lX2FjY2VzcyIsInVtYV9hdXRob3JpemF0aW9uIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsic2Vuc29yLm1vaW50b3IiOnsicm9sZXMiOlsidW1hX3Byb3RlY3Rpb24iXX0sImFjY291bnQiOnsicm9sZXMiOlsibWFuYWdlLWFjY291bnQiLCJtYW5hZ2UtYWNjb3VudC1saW5rcyIsInZpZXctcHJvZmlsZSJdfX0sInNjb3BlIjoicHJvZmlsZSBlbWFpbCIsImNsaWVudEhvc3QiOiIxNzIuMjUuMC4xIiwiY2xpZW50SWQiOiJzZW5zb3IubW9pbnRvciIsImVtYWlsX3ZlcmlmaWVkIjpmYWxzZSwicHJlZmVycmVkX3VzZXJuYW1lIjoic2VydmljZS1hY2NvdW50LXNlbnNvci5tb2ludG9yIiwiY2xpZW50QWRkcmVzcyI6IjE3Mi4yNS4wLjEifQ.pKSqIFb9VcmbQQe-tBbKELuV-EWSeRSa6BhlVQs3iwKS6vExtoBkauFV1stNLt1SE_KMNpY4UcOqua_p0hnm51jwy-U55NMlSyxIysarA1Kkylc8UScYfk6R4vBXLcaaJBA8qvGvBSf_ZjR1pCQqGwPL-EXOqojP49PCtsfDaMkDZ70037Yj7s7aISRFSm6jNOem679_Qi52WupSyIyqUv8u4S-licXOPO6Na-4X_NwKhByE9ET_Zw9zZFxFremcahafLyMQcU36dD8UrNx7DRIF06vQsMkAhbQ4FhT16uXjbAY_-usUfif882lUy9HmJDRRl-sZU_Obnj4v0-4nGA",
    "expires_in":300,
    "refresh_expires_in":0,
    "token_type":"Bearer",
    "not-before-policy":0,
    "scope":"profile email"
}
```

{% endtab %}

{% tab title="401: Unauthorized Authorization Failed" %}

```javascript
{
"error": "unauthorized_client",
"error_description": "message"
}
```

{% endtab %}
{% endtabs %}

Generated Access Token is valid for only 300 seconds. It should be refreshed in the interval or it should be regenerated.

### Accessing Data

Rest APIs for AAS, Submodels, and SubmodelElements have a generic URL pattern.\
All IDs in URL Params (*eg: aasId*) should be URL Encoded.

You can use APIs described below to access the data. You can also use our [postman public workspace](https://www.postman.com/industryappstech/workspace/industryapps-aas-gateway) to see and experience the APIs.

{% embed url="<https://youtu.be/X2kpFY6UcS0>" %}
APIs Postman Demo
{% endembed %}

####


# Submodel Index

The categories below indicate the available Submodel data that can be extracted from users depending on allowed permission authorisation by the given users. Each given category has a sub-category with a designated description of what each type provides in a JSON format.

<figure><img src="https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2F4WoUDHZSji6xhUFqSLQk%2Fsteps-submodels.png?alt=media&amp;token=c4be7f6f-d8e4-48f9-9995-95bf0fc6b950" alt=""><figcaption></figcaption></figure>

## Product

{% tabs %}
{% tab title="Nameplate" %}

| Type                           | Description                               |
| ------------------------------ | ----------------------------------------- |
| ManufacturerName               | Manufacturer Name                         |
| Address                        | Address information of a business partner |
| SerialNumber                   | Serial Number                             |
| ManufacturerProductDesignation | Short description of the product          |
| YearOfConstruction             | Year Of Construction                      |
| ManufacturerProductFamily      | Manufacturer Product Family               |
| {% endtab %}                   |                                           |

{% tab title="TechnicalData" %}

| Type                   | Description                                                                                                         |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------- |
| FurtherInformation     | Further information on the product, the validity of the information provided and this data record                   |
| Generalinformation     | General information, for example ordering and manufacturer information                                              |
| ProductClassifications | Product classifications by association of product classes with common classification systems                        |
| TechnicalProperties    | Technical and product properties. Individual characteristics that describe the product and its technical properties |
| {% endtab %}           |                                                                                                                     |

{% tab title="OperationalData" %}

| Type           | Description        |
| -------------- | ------------------ |
| MQTTProtocol   | Messaging protocol |
| OPC-UAProtocol | Messaging protocol |
| TAGS           | Connection Tags    |
| {% endtab %}   |                    |

{% tab title="Documentation" %}

| Type               | Description         |
| ------------------ | ------------------- |
| ECAD               | ECAD                |
| IMAGES             | IMAGES              |
| TechnicalDocuments | TECHNICAL DOCUMENTS |
| 3DMODELS           | 3DMODELS            |
| OperatingManuals   | OPERATING MANUALS   |
| {% endtab %}       |                     |

{% tab title="Identification" %}

| Type         | Description    |
| ------------ | -------------- |
| Status       | Product Status |
| Site         | Site AAS       |
| Company      | Company AAS    |
| PartName     | Part Name      |
| PartNumber   | Part Number    |
| ProductCode  | Product Code   |
| {% endtab %} |                |

{% tab title="BasicData" %}

<table><thead><tr><th>Type</th><th width="383">Description</th></tr></thead><tbody><tr><td>grossWeight</td><td>Gross Weight</td></tr><tr><td>ValidTo</td><td>Product valid until DATE</td></tr><tr><td>NetWeight</td><td>Net Weight</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

## Tool

{% tabs %}
{% tab title="Nameplate" %}

| Type                           | Description                               |
| ------------------------------ | ----------------------------------------- |
| ManufacturerName               | Manufacturer Name                         |
| Address                        | Address information of a business partner |
| SerialNumber                   | Serial Number                             |
| ManufacturerProductDesignation | Short description of the product          |
| YearOfConstruction             | Year Of Construction                      |
| ManufacturerProductFamily      | Manufacturer Product Family               |
| {% endtab %}                   |                                           |

{% tab title="TechnicalData" %}

| Type                   | Description                                                                                                         |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------- |
| FurtherInformation     | Further information on the product, the validity of the information provided and this data record                   |
| Generalinformation     | General information, for example ordering and manufacturer information                                              |
| ProductClassifications | Product classifications by association of product classes with common classification systems                        |
| TechnicalProperties    | Technical and product properties. Individual characteristics that describe the product and its technical properties |
| {% endtab %}           |                                                                                                                     |

{% tab title="OperationalData" %}

| Type           | Description        |
| -------------- | ------------------ |
| MQTTProtocol   | Messaging protocol |
| OPC-UAProtocol | Messaging protocol |
| TAGS           | Connection Tags    |
| {% endtab %}   |                    |

{% tab title="Documentation" %}

| Type               | Description         |
| ------------------ | ------------------- |
| ECAD               | ECAD                |
| IMAGES             | Images              |
| TechnicalDocuments | TECHNICAL DOCUMENTS |
| 3DMODELS           | 3D Models           |
| OperatingManuals   | OPERATING MANUALS   |
| {% endtab %}       |                     |

{% tab title="Identification" %}

| Type         | Description |
| ------------ | ----------- |
| Site         | Site AAS    |
| Company      | Company AAS |
| ToolName     | Tool Name   |
| ToolCode     | Tool Code   |
| Status       | Tool Status |
| {% endtab %} |             |

{% tab title="BasicData" %}

| Type          | Description     |
| ------------- | --------------- |
| ProcessType   | Process Type    |
| LifeTime      | Tool LifeTime   |
| Dimensions    | Tool Dimensions |
| Weight        | Tool Weight     |
| {% endtab %}  |                 |
| {% endtabs %} |                 |

## Machine

{% tabs %}
{% tab title="Nameplate" %}

| Type                           | Description                               |
| ------------------------------ | ----------------------------------------- |
| ManufacturerName               | Manufacturer Name                         |
| Address                        | Address information of a business partner |
| SerialNumber                   | Serial Number                             |
| ManufacturerProductDesignation | Short description of the product          |
| YearOfConstruction             | Year Of Construction                      |
| ManufacturerProductFamily      | Manufacturer Product Family               |
| {% endtab %}                   |                                           |

{% tab title="TechnicalData" %}

| Type                   | Description                                                                                                         |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------- |
| FurtherInformation     | Further information on the product, the validity of the information provided and this data record                   |
| Generalinformation     | General information, for example ordering and manufacturer information                                              |
| ProductClassifications | Product classifications by association of product classes with common classification systems                        |
| TechnicalProperties    | Technical and product properties. Individual characteristics that describe the product and its technical properties |
| {% endtab %}           |                                                                                                                     |

{% tab title="OperationalData" %}

| Type           | Description        |
| -------------- | ------------------ |
| MQTTProtocol   | Messaging protocol |
| OPC-UAProtocol | Messaging protocol |
| TAGS           | Connection Tags    |
| {% endtab %}   |                    |

{% tab title="Documentation" %}

| Type               | Description         |
| ------------------ | ------------------- |
| ECAD               | ECAD                |
| IMAGES             | Images              |
| TechnicalDocuments | Technical Documents |
| 3DMODELS           | 3D Models           |
| OperatingManuals   | Operating Manuals   |
| {% endtab %}       |                     |

{% tab title="Identification" %}

| Type          | Description    |
| ------------- | -------------- |
| Status        | Machine status |
| Site          | Site AAS       |
| Company       | Company AAS    |
| MachineName   | Machine Name   |
| MachineCode   | Machine Code   |
| MachineNumber | Machine Number |
| {% endtab %}  |                |

{% tab title="BasicData" %}

| Type            | Description             |
| --------------- | ----------------------- |
| MachineSize     | Machine Size            |
| FirstWorkingDay | First Working Day       |
| ProcessType     | Process Type            |
| ProductionLine  | Machine Production Line |
| {% endtab %}    |                         |
| {% endtabs %}   |                         |

## Company

{% tabs %}
{% tab title="Nameplate" %}

| Type                           | Description                               |
| ------------------------------ | ----------------------------------------- |
| ManufacturerName               | Manufacturer Name                         |
| Address                        | Address information of a business partner |
| SerialNumber                   | Serial Number                             |
| ManufacturerProductDesignation | Short description of the product          |
| YearOfConstruction             | Year Of Construction                      |
| ManufacturerProductFamily      | Manufacturer Product Family               |
| {% endtab %}                   |                                           |

{% tab title="TechnicalData" %}

| Type                   | Description                                                                                                         |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------- |
| FurtherInformation     | Further information on the product, the validity of the information provided and this data record                   |
| Generalinformation     | General information, for example ordering and manufacturer information                                              |
| ProductClassifications | Product classifications by association of product classes with common classification systems                        |
| TechnicalProperties    | Technical and product properties. Individual characteristics that describe the product and its technical properties |
| {% endtab %}           |                                                                                                                     |

{% tab title="OperationalData" %}

| Type           | Description        |
| -------------- | ------------------ |
| MQTTProtocol   | Messaging protocol |
| OPC-UAProtocol | Messaging protocol |
| TAGS           | Connection Tags    |
| {% endtab %}   |                    |

{% tab title="Documentation" %}

| Type               | Description         |
| ------------------ | ------------------- |
| ECAD               | ECAD                |
| IMAGES             | Images              |
| TechnicalDocuments | Technical Documents |
| 3DMODELS           | 3D Models           |
| OperatingManuals   | Operating Manuals   |
| {% endtab %}       |                     |

{% tab title="Identification" %}

| Type            | Description                 |
| --------------- | --------------------------- |
| IndustrySegment | Industry Segment            |
| CompanyName     | Company Name                |
| Country         | Country location of Company |
| CompanyID       | Company ID                  |
| Website         | Company Website             |
| {% endtab %}    |                             |
| {% endtabs %}   |                             |

## Site

{% tabs %}
{% tab title="Nameplate" %}

| Type                           | Description                               |
| ------------------------------ | ----------------------------------------- |
| ManufacturerName               | Manufacturer Name                         |
| Address                        | Address information of a business partner |
| SerialNumber                   | Serial Number                             |
| ManufacturerProductDesignation | Short description of the product          |
| YearOfConstruction             | Year Of Construction                      |
| ManufacturerProductFamily      | Manufacturer Product Family               |
| {% endtab %}                   |                                           |

{% tab title="TechnicalData" %}

| Type                   | Description                                                                                                         |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------- |
| FurtherInformation     | Further information on the product, the validity of the information provided and this data record                   |
| Generalinformation     | General information, for example ordering and manufacturer information                                              |
| ProductClassifications | Product classifications by association of product classes with common classification systems                        |
| TechnicalProperties    | Technical and product properties. Individual characteristics that describe the product and its technical properties |
| {% endtab %}           |                                                                                                                     |

{% tab title="OperationalData" %}

| Type           | Description        |
| -------------- | ------------------ |
| MQTTProtocol   | Messaging protocol |
| OPC-UAProtocol | Messaging protocol |
| TAGS           | Connection Tags    |
| {% endtab %}   |                    |

{% tab title="Documentation" %}

| Type               | Description         |
| ------------------ | ------------------- |
| ECAD               | ECAD                |
| IMAGES             | Images              |
| TechnicalDocuments | Technical Documents |
| 3DMODELS           | 3D Models           |
| OperatingManuals   | Operating Manuals   |
| {% endtab %}       |                     |

{% tab title="Identification" %}

| Type          | Description                               |
| ------------- | ----------------------------------------- |
| Geotag        | GeoTag                                    |
| Company       | Company AAS                               |
| Address       | Address information of a business partner |
| GLN           | GLN                                       |
| SiteImage     | Site Image                                |
| PlantName     | Plant Name                                |
| PlantCode     | Plant Code                                |
| PlantID       | Plant ID                                  |
| {% endtab %}  |                                           |
| {% endtabs %} |                                           |

## User

{% tabs %}
{% tab title="Nameplate" %}

| Type                           | Description                               |
| ------------------------------ | ----------------------------------------- |
| ManufacturerName               | Manufacturer Name                         |
| Address                        | Address information of a business partner |
| SerialNumber                   | Serial Number                             |
| ManufacturerProductDesignation | Short description of the product          |
| YearOfConstruction             | Year Of Construction                      |
| ManufacturerProductFamily      | Manufacturer Product Family               |
| {% endtab %}                   |                                           |

{% tab title="TechnicalData" %}

| Type                   | Description                                                                                                         |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------- |
| FurtherInformation     | Further information on the product, the validity of the information provided and this data record                   |
| Generalinformation     | General information, for example ordering and manufacturer information                                              |
| ProductClassifications | Product classifications by association of product classes with common classification systems                        |
| TechnicalProperties    | Technical and product properties. Individual characteristics that describe the product and its technical properties |
| {% endtab %}           |                                                                                                                     |

{% tab title="OperationalData" %}

| Type           | Description        |
| -------------- | ------------------ |
| MQTTProtocol   | Messaging protocol |
| OPC-UAProtocol | Messaging protocol |
| TAGS           | Connection Tags    |
| {% endtab %}   |                    |

{% tab title="Documentation" %}

| Type               | Description         |
| ------------------ | ------------------- |
| ECAD               | ECAD                |
| IMAGES             | Images              |
| TechnicalDocuments | Technical Documents |
| 3DMODELS           | 3D Models           |
| OperatingManuals   | Operating Manuals   |
| {% endtab %}       |                     |

{% tab title="Identification" %}

| Type         | Description     |
| ------------ | --------------- |
| EmailId      | User Email ID   |
| Company      | Company Name    |
| DefaultSite  | Default Site    |
| FirstName    | User First Name |
| UserID       | User ID         |
| Country      | User Country    |
| Sites        | User Sites      |
| LastName     | User Last Name  |
| Status       | Status          |
| {% endtab %} |                 |

{% tab title="BasicData" %}

| Type              | Description        |
| ----------------- | ------------------ |
| AuthorisationType | Authorisation Type |
| GroupCode         | Group Code         |
| {% endtab %}      |                    |
| {% endtabs %}     |                    |


# Masterdata

Industry 4.0 AAS Data

### **The following endpoints can be utilised to access AAS, Submodel Data.**

#### **Listing all Assets**

## Gets all assets

<mark style="color:blue;">`GET`</mark> `https://aasregistry.uat.industryapps.net/api/v1/registry`

Gets all assets as a list of AAS Descriptor

{% tabs %}
{% tab title="200: OK Success Response" %}

```javascript
[
  {
    "idShort": "string",
    "identification": {
      "id": "string",
      "idType": "Custom"
    },
    "administration": {
      "version": "string",
      "revision": "string"
    },
    "description": [
      {
        "language": "string",
        "text": "string"
      }
    ],
    "asset": {
      "idShort": "string",
      "category": "string",
      "description": [
        {
          "language": "string",
          "text": "string"
        }
      ],
      "parent": {
        "keys": [
          {
            "type": "Asset",
            "idType": "Custom",
            "value": "string",
            "local": true
          }
        ]
      },
      "modelType": {
        "name": "Asset"
      },
      "identification": {
        "id": "string",
        "idType": "Custom"
      },
      "administration": {
        "version": "string",
        "revision": "string"
      },
      "embeddedDataSpecifications": [
        {
          "dataSpecification": {
            "keys": [
              {
                "type": "Asset",
                "idType": "Custom",
                "value": "string",
                "local": true
              }
            ]
          },
          "dataSpecificationContent": {
            "value": "string",
            "valueId": {
              "keys": [
                {
                  "type": "Asset",
                  "idType": "Custom",
                  "value": "string",
                  "local": true
                }
              ]
            },
            "valueType": "anyUri",
            "dataType": "DATE",
            "definition": [
              {
                "language": "string",
                "text": "string"
              }
            ],
            "preferredName": [
              {
                "language": "string",
                "text": "string"
              }
            ],
            "shortName": [
              {
                "language": "string",
                "text": "string"
              }
            ],
            "sourceOfDefinition": "string",
            "symbol": "string",
            "unit": "string",
            "unitId": {
              "keys": [
                {
                  "type": "Asset",
                  "idType": "Custom",
                  "value": "string",
                  "local": true
                }
              ]
            },
            "valueFormat": "string",
            "valueList": {
              "valueReferencePairTypes": [
                {
                  "value": "string",
                  "valueId": {
                    "keys": [
                      {
                        "type": "Asset",
                        "idType": "Custom",
                        "value": "string",
                        "local": true
                      }
                    ]
                  },
                  "valueType": "anyUri"
                }
              ]
            },
            "levelType": [
              "Min"
            ]
          }
        }
      ],
      "kind": "Type",
      "assetIdentificationModel": {
        "keys": [
          {
            "type": "Asset",
            "idType": "Custom",
            "value": "string",
            "local": true
          }
        ]
      },
      "billOfMaterial": {
        "keys": [
          {
            "type": "Asset",
            "idType": "Custom",
            "value": "string",
            "local": true
          }
        ]
      }
    },
    "endpoints": [
      {
        "address": "string",
        "type": "string",
        "parameters": {}
      }
    ],
    "submodelDescriptors": [
      {
        "idShort": "string",
        "identification": {
          "id": "string",
          "idType": "Custom"
        },
        "administration": {
          "version": "string",
          "revision": "string"
        },
        "description": [
          {
            "language": "string",
            "text": "string"
          }
        ],
        "semanticId": {
          "keys": [
            {
              "type": "Asset",
              "idType": "Custom",
              "value": "string",
              "local": true
            }
          ]
        },
        "endpoints": [
          {
            "address": "string",
            "type": "string",
            "parameters": {}
          }
        ]
      }
    ]
  }
]
```

{% endtab %}
{% endtabs %}

#### **Get AAS List**

## Get AAS List

<mark style="color:blue;">`GET`</mark> `https://aasgateway.uat.industryapps.net/aasList`

**Gets all Asset AAS filtered by provided parameters**

#### Query Parameters

| Name                                        | Type   | Description                                                                                                                                                                                                                                                                                       |
| ------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| AssetType<mark style="color:red;">\*</mark> | String | <p>Asset Type Code. Allowed asset types are</p><p><strong>machine</strong></p><p><strong>tool</strong></p><p><strong>product</strong></p><p><strong>material</strong></p><p><strong>component</strong></p><p><strong>user</strong></p><p><strong>company</strong></p><p><strong>site</strong></p> |
| PlantCode<mark style="color:red;">\*</mark> | String | Underlying Plant Code                                                                                                                                                                                                                                                                             |

#### Headers

| Name                                            | Type               | Description                                                                                                               |
| ----------------------------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | Bearer auth\_token | Provide the [generated token](/apis-or-data-integration)                                                                  |
| UserToken<mark style="color:red;">\*</mark>     | Bearer user\_token | Provide the token received from the [user data javascript method](/authentication/accessing-data-exposed-by-the-platform) |

{% tabs %}
{% tab title="200: OK Success response" %}

```javascript
[
  {
    "idShort": "string",
    "category": "string",
    "description": [
      {
        "language": "string",
        "text": "string"
      }
    ],
    "parent": {
      "keys": [
        {
          "type": "Asset",
          "idType": "Custom",
          "value": "string",
          "local": true
        }
      ]
    },
    "modelType": {
      "name": "Asset"
    },
    "identification": {
      "id": "string",
      "idType": "Custom"
    },
    "administration": {
      "version": "string",
      "revision": "string"
    },
    "embeddedDataSpecifications": [
      {
        "dataSpecification": {
          "keys": [
            {
              "type": "Asset",
              "idType": "Custom",
              "value": "string",
              "local": true
            }
          ]
        },
        "dataSpecificationContent": {
          "value": "string",
          "valueId": {
            "keys": [
              {
                "type": "Asset",
                "idType": "Custom",
                "value": "string",
                "local": true
              }
            ]
          },
          "valueType": "anyUri",
          "dataType": "DATE",
          "definition": [
            {
              "language": "string",
              "text": "string"
            }
          ],
          "preferredName": [
            {
              "language": "string",
              "text": "string"
            }
          ],
          "shortName": [
            {
              "language": "string",
              "text": "string"
            }
          ],
          "sourceOfDefinition": "string",
          "symbol": "string",
          "unit": "string",
          "unitId": {
            "keys": [
              {
                "type": "Asset",
                "idType": "Custom",
                "value": "string",
                "local": true
              }
            ]
          },
          "valueFormat": "string",
          "valueList": {
            "valueReferencePairTypes": [
              {
                "value": "string",
                "valueId": {
                  "keys": [
                    {
                      "type": "Asset",
                      "idType": "Custom",
                      "value": "string",
                      "local": true
                    }
                  ]
                },
                "valueType": "anyUri"
              }
            ]
          },
          "levelType": [
            "Min"
          ]
        }
      }
    ],
    "derivedFrom": {
      "keys": [
        {
          "type": "Asset",
          "idType": "Custom",
          "value": "string",
          "local": true
        }
      ]
    },
    "asset": {
      "keys": [
        {
          "type": "Asset",
          "idType": "Custom",
          "value": "string",
          "local": true
        }
      ]
    },
    "submodels": [
      {
        "keys": [
          {
            "type": "Asset",
            "idType": "Custom",
            "value": "string",
            "local": true
          }
        ]
      }
    ],
    "views": [
      {
        "idShort": "string",
        "category": "string",
        "description": [
          {
            "language": "string",
            "text": "string"
          }
        ],
        "parent": {
          "keys": [
            {
              "type": "Asset",
              "idType": "Custom",
              "value": "string",
              "local": true
            }
          ]
        },
        "modelType": {
          "name": "Asset"
        },
        "embeddedDataSpecifications": [
          {
            "dataSpecification": {
              "keys": [
                {
                  "type": "Asset",
                  "idType": "Custom",
                  "value": "string",
                  "local": true
                }
              ]
            },
            "dataSpecificationContent": {
              "value": "string",
              "valueId": {
                "keys": [
                  {
                    "type": "Asset",
                    "idType": "Custom",
                    "value": "string",
                    "local": true
                  }
                ]
              },
              "valueType": "anyUri",
              "dataType": "DATE",
              "definition": [
                {
                  "language": "string",
                  "text": "string"
                }
              ],
              "preferredName": [
                {
                  "language": "string",
                  "text": "string"
                }
              ],
              "shortName": [
                {
                  "language": "string",
                  "text": "string"
                }
              ],
              "sourceOfDefinition": "string",
              "symbol": "string",
              "unit": "string",
              "unitId": {
                "keys": [
                  {
                    "type": "Asset",
                    "idType": "Custom",
                    "value": "string",
                    "local": true
                  }
                ]
              },
              "valueFormat": "string",
              "valueList": {
                "valueReferencePairTypes": [
                  {
                    "value": "string",
                    "valueId": {
                      "keys": [
                        {
                          "type": "Asset",
                          "idType": "Custom",
                          "value": "string",
                          "local": true
                        }
                      ]
                    },
                    "valueType": "anyUri"
                  }
                ]
              },
              "levelType": [
                "Min"
              ]
            }
          }
        ],
        "semanticId": {
          "keys": [
            {
              "type": "Asset",
              "idType": "Custom",
              "value": "string",
              "local": true
            }
          ]
        },
        "containedElements": [
          {
            "keys": [
              {
                "type": "Asset",
                "idType": "Custom",
                "value": "string",
                "local": true
              }
            ]
          }
        ]
      }
    ],
    "conceptDictionaries": [
      {
        "idShort": "string",
        "category": "string",
        "description": [
          {
            "language": "string",
            "text": "string"
          }
        ],
        "parent": {
          "keys": [
            {
              "type": "Asset",
              "idType": "Custom",
              "value": "string",
              "local": true
            }
          ]
        },
        "modelType": {
          "name": "Asset"
        },
        "embeddedDataSpecifications": [
          {
            "dataSpecification": {
              "keys": [
                {
                  "type": "Asset",
                  "idType": "Custom",
                  "value": "string",
                  "local": true
                }
              ]
            },
            "dataSpecificationContent": {
              "value": "string",
              "valueId": {
                "keys": [
                  {
                    "type": "Asset",
                    "idType": "Custom",
                    "value": "string",
                    "local": true
                  }
                ]
              },
              "valueType": "anyUri",
              "dataType": "DATE",
              "definition": [
                {
                  "language": "string",
                  "text": "string"
                }
              ],
              "preferredName": [
                {
                  "language": "string",
                  "text": "string"
                }
              ],
              "shortName": [
                {
                  "language": "string",
                  "text": "string"
                }
              ],
              "sourceOfDefinition": "string",
              "symbol": "string",
              "unit": "string",
              "unitId": {
                "keys": [
                  {
                    "type": "Asset",
                    "idType": "Custom",
                    "value": "string",
                    "local": true
                  }
                ]
              },
              "valueFormat": "string",
              "valueList": {
                "valueReferencePairTypes": [
                  {
                    "value": "string",
                    "valueId": {
                      "keys": [
                        {
                          "type": "Asset",
                          "idType": "Custom",
                          "value": "string",
                          "local": true
                        }
                      ]
                    },
                    "valueType": "anyUri"
                  }
                ]
              },
              "levelType": [
                "Min"
              ]
            }
          }
        ],
        "conceptDescriptions": [
          {
            "keys": [
              {
                "type": "Asset",
                "idType": "Custom",
                "value": "string",
                "local": true
              }
            ]
          }
        ]
      }
    ],
    "security": {
      "accessControlPolicyPoints": {
        "policyAdministrationPoint": {
          "localAccessControl": {
            "selectableSubjectAttributes": {
              "keys": [
                {
                  "type": "Asset",
                  "idType": "Custom",
                  "value": "string",
                  "local": true
                }
              ]
            },
            "defaultSubjectAttributes": {
              "keys": [
                {
                  "type": "Asset",
                  "idType": "Custom",
                  "value": "string",
                  "local": true
                }
              ]
            },
            "selectablePermissions": {
              "keys": [
                {
                  "type": "Asset",
                  "idType": "Custom",
                  "value": "string",
                  "local": true
                }
              ]
            },
            "defaultPermissions": {
              "keys": [
                {
                  "type": "Asset",
                  "idType": "Custom",
                  "value": "string",
                  "local": true
                }
              ]
            },
            "selectableEnvironmentAttributes": {
              "keys": [
                {
                  "type": "Asset",
                  "idType": "Custom",
                  "value": "string",
                  "local": true
                }
              ]
            },
            "defaultEnvironmentAttributes": {
              "keys": [
                {
                  "type": "Asset",
                  "idType": "Custom",
                  "value": "string",
                  "local": true
                }
              ]
            },
            "accessPermissionRule": [
              {
                "idShort": "string",
                "category": "string",
                "description": [
                  {
                    "language": "string",
                    "text": "string"
                  }
                ],
                "parent": {
                  "keys": [
                    {
                      "type": "Asset",
                      "idType": "Custom",
                      "value": "string",
                      "local": true
                    }
                  ]
                },
                "modelType": {
                  "name": "Asset"
                },
                "qualifiers": [
                  {
                    "modelType": {
                      "name": "Asset"
                    }
                  }
                ],
                "targetSubjectAttributes": [
                  {
                    "subjectAttributes": [
                      {
                        "keys": [
                          {
                            "type": "Asset",
                            "idType": "Custom",
                            "value": "string",
                            "local": true
                          }
                        ]
                      }
                    ]
                  }
                ],
                "permissionsPerObject": [
                  {
                    "object": {
                      "keys": [
                        {
                          "type": "Asset",
                          "idType": "Custom",
                          "value": "string",
                          "local": true
                        }
                      ]
                    },
                    "targetObjectAttributes": {
                      "objectAttribute": [
                        {
                          "idShort": "string",
                          "category": "string",
                          "description": [
                            {
                              "language": "string",
                              "text": "string"
                            }
                          ],
                          "parent": {
                            "keys": [
                              {
                                "type": "Asset",
                                "idType": "Custom",
                                "value": "string",
                                "local": true
                              }
                            ]
                          },
                          "modelType": {
                            "name": "Asset"
                          },
                          "embeddedDataSpecifications": [
                            {
                              "dataSpecification": {
                                "keys": [
                                  {
                                    "type": "Asset",
                                    "idType": "Custom",
                                    "value": "string",
                                    "local": true
                                  }
                                ]
                              },
                              "dataSpecificationContent": {
                                "value": "string",
                                "valueId": {
                                  "keys": [
                                    {
                                      "type": "Asset",
                                      "idType": "Custom",
                                      "value": "string",
                                      "local": true
                                    }
                                  ]
                                },
                                "valueType": "anyUri",
                                "dataType": "DATE",
                                "definition": [
                                  {
                                    "language": "string",
                                    "text": "string"
                                  }
                                ],
                                "preferredName": [
                                  {
                                    "language": "string",
                                    "text": "string"
                                  }
                                ],
                                "shortName": [
                                  {
                                    "language": "string",
                                    "text": "string"
                                  }
                                ],
                                "sourceOfDefinition": "string",
                                "symbol": "string",
                                "unit": "string",
                                "unitId": {
                                  "keys": [
                                    {
                                      "type": "Asset",
                                      "idType": "Custom",
                                      "value": "string",
                                      "local": true
                                    }
                                  ]
                                },
                                "valueFormat": "string",
                                "valueList": {
                                  "valueReferencePairTypes": [
                                    {
                                      "value": "string",
                                      "valueId": {
                                        "keys": [
                                          {
                                            "type": "Asset",
                                            "idType": "Custom",
                                            "value": "string",
                                            "local": true
                                          }
                                        ]
                                      },
                                      "valueType": "anyUri"
                                    }
                                  ]
                                },
                                "levelType": [
                                  "Min"
                                ]
                              }
                            }
                          ],
                          "semanticId": {
                            "keys": [
                              {
                                "type": "Asset",
                                "idType": "Custom",
                                "value": "string",
                                "local": true
                              }
                            ]
                          },
                          "qualifiers": [
                            {
                              "modelType": {
                                "name": "Asset"
                              }
                            }
                          ],
                          "kind": "Template",
                          "value": "string",
                          "valueId": {
                            "keys": [
                              {
                                "type": "Asset",
                                "idType": "Custom",
                                "value": "string",
                                "local": true
                              }
                            ]
                          },
                          "valueType": "anyUri"
                        }
                      ]
                    },
                    "permission": [
                      {
                        "permission": {
                          "keys": [
                            {
                              "type": "Asset",
                              "idType": "Custom",
                              "value": "string",
                              "local": true
                            }
                          ]
                        },
                        "kindOfPermission": "Allow"
                      }
                    ]
                  }
                ]
              }
            ]
          },
          "externalAccessControl": true
        },
        "policyDecisionPoint": {
          "externalPolicyDecisionPoints": true
        },
        "policyEnforcementPoint": {
          "externalPolicyEnforcementPoint": true
        },
        "policyInformationPoints": {
          "internalInformationPoint": [
            {
              "keys": [
                {
                  "type": "Asset",
                  "idType": "Custom",
                  "value": "string",
                  "local": true
                }
              ]
            }
          ],
          "externalInformationPoint": true
        }
      },
      "certificate": [
        {
          "blobCertificate": {
            "idShort": "string",
            "category": "string",
            "description": [
              {
                "language": "string",
                "text": "string"
              }
            ],
            "parent": {
              "keys": [
                {
                  "type": "Asset",
                  "idType": "Custom",
                  "value": "string",
                  "local": true
                }
              ]
            },
            "modelType": {
              "name": "Asset"
            },
            "embeddedDataSpecifications": [
              {
                "dataSpecification": {
                  "keys": [
                    {
                      "type": "Asset",
                      "idType": "Custom",
                      "value": "string",
                      "local": true
                    }
                  ]
                },
                "dataSpecificationContent": {
                  "value": "string",
                  "valueId": {
                    "keys": [
                      {
                        "type": "Asset",
                        "idType": "Custom",
                        "value": "string",
                        "local": true
                      }
                    ]
                  },
                  "valueType": "anyUri",
                  "dataType": "DATE",
                  "definition": [
                    {
                      "language": "string",
                      "text": "string"
                    }
                  ],
                  "preferredName": [
                    {
                      "language": "string",
                      "text": "string"
                    }
                  ],
                  "shortName": [
                    {
                      "language": "string",
                      "text": "string"
                    }
                  ],
                  "sourceOfDefinition": "string",
                  "symbol": "string",
                  "unit": "string",
                  "unitId": {
                    "keys": [
                      {
                        "type": "Asset",
                        "idType": "Custom",
                        "value": "string",
                        "local": true
                      }
                    ]
                  },
                  "valueFormat": "string",
                  "valueList": {
                    "valueReferencePairTypes": [
                      {
                        "value": "string",
                        "valueId": {
                          "keys": [
                            {
                              "type": "Asset",
                              "idType": "Custom",
                              "value": "string",
                              "local": true
                            }
                          ]
                        },
                        "valueType": "anyUri"
                      }
                    ]
                  },
                  "levelType": [
                    "Min"
                  ]
                }
              }
            ],
            "semanticId": {
              "keys": [
                {
                  "type": "Asset",
                  "idType": "Custom",
                  "value": "string",
                  "local": true
                }
              ]
            },
            "qualifiers": [
              {
                "modelType": {
                  "name": "Asset"
                }
              }
            ],
            "kind": "Template",
            "value": "string",
            "mimeType": "string"
          },
          "containedExtension": [
            {
              "keys": [
                {
                  "type": "Asset",
                  "idType": "Custom",
                  "value": "string",
                  "local": true
                }
              ]
            }
          ],
          "lastCertificate": true
        }
      ],
      "requiredCertificateExtension": [
        {
          "keys": [
            {
              "type": "Asset",
              "idType": "Custom",
              "value": "string",
              "local": true
            }
          ]
        }
      ]
    }
  }
]
```

{% endtab %}

{% tab title="401: Unauthorized Authorization failed" %}

```javascript
unauthorized
```

{% endtab %}
{% endtabs %}

#### **Get AAS**

## Get an AAS

<mark style="color:blue;">`GET`</mark> `https://aasgateway.uat.industryapps.net/aasList/{aasId}`

Get a specific asset AAS by its aasId

#### Path Parameters

| Name                                    | Type | Description                                                             |
| --------------------------------------- | ---- | ----------------------------------------------------------------------- |
| aasId<mark style="color:red;">\*</mark> |      | URL encoded aasId. eg: *urn:industryapps:i40:aas:1:1:product%23NRW0989* |

#### Headers

| Name                                            | Type               | Description                                                                                                               |
| ----------------------------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | Bearer auth\_token | Provide the [generated token](/apis-or-data-integration)                                                                  |
| UserToken<mark style="color:red;">\*</mark>     | Bearer user\_token | Provide the token received from the [user data javascript method](/authentication/accessing-data-exposed-by-the-platform) |

{% tabs %}
{% tab title="200: OK Success Response" %}

```javascript
{
  "idShort": "string",
  "category": "string",
  "description": [
    {
      "language": "string",
      "text": "string"
    }
  ],
  "parent": {
    "keys": [
      {
        "type": "Asset",
        "idType": "Custom",
        "value": "string",
        "local": true
      }
    ]
  },
  "modelType": {
    "name": "Asset"
  },
  "identification": {
    "id": "string",
    "idType": "Custom"
  },
  "administration": {
    "version": "string",
    "revision": "string"
  },
  "embeddedDataSpecifications": [
    {
      "dataSpecification": {
        "keys": [
          {
            "type": "Asset",
            "idType": "Custom",
            "value": "string",
            "local": true
          }
        ]
      },
      "dataSpecificationContent": {
        "value": "string",
        "valueId": {
          "keys": [
            {
              "type": "Asset",
              "idType": "Custom",
              "value": "string",
              "local": true
            }
          ]
        },
        "valueType": "anyUri",
        "dataType": "DATE",
        "definition": [
          {
            "language": "string",
            "text": "string"
          }
        ],
        "preferredName": [
          {
            "language": "string",
            "text": "string"
          }
        ],
        "shortName": [
          {
            "language": "string",
            "text": "string"
          }
        ],
        "sourceOfDefinition": "string",
        "symbol": "string",
        "unit": "string",
        "unitId": {
          "keys": [
            {
              "type": "Asset",
              "idType": "Custom",
              "value": "string",
              "local": true
            }
          ]
        },
        "valueFormat": "string",
        "valueList": {
          "valueReferencePairTypes": [
            {
              "value": "string",
              "valueId": {
                "keys": [
                  {
                    "type": "Asset",
                    "idType": "Custom",
                    "value": "string",
                    "local": true
                  }
                ]
              },
              "valueType": "anyUri"
            }
          ]
        },
        "levelType": [
          "Min"
        ]
      }
    }
  ],
  "derivedFrom": {
    "keys": [
      {
        "type": "Asset",
        "idType": "Custom",
        "value": "string",
        "local": true
      }
    ]
  },
  "asset": {
    "keys": [
      {
        "type": "Asset",
        "idType": "Custom",
        "value": "string",
        "local": true
      }
    ]
  },
  "submodels": [
    {
      "keys": [
        {
          "type": "Asset",
          "idType": "Custom",
          "value": "string",
          "local": true
        }
      ]
    }
  ],
  "views": [
    {
      "idShort": "string",
      "category": "string",
      "description": [
        {
          "language": "string",
          "text": "string"
        }
      ],
      "parent": {
        "keys": [
          {
            "type": "Asset",
            "idType": "Custom",
            "value": "string",
            "local": true
          }
        ]
      },
      "modelType": {
        "name": "Asset"
      },
      "embeddedDataSpecifications": [
        {
          "dataSpecification": {
            "keys": [
              {
                "type": "Asset",
                "idType": "Custom",
                "value": "string",
                "local": true
              }
            ]
          },
          "dataSpecificationContent": {
            "value": "string",
            "valueId": {
              "keys": [
                {
                  "type": "Asset",
                  "idType": "Custom",
                  "value": "string",
                  "local": true
                }
              ]
            },
            "valueType": "anyUri",
            "dataType": "DATE",
            "definition": [
              {
                "language": "string",
                "text": "string"
              }
            ],
            "preferredName": [
              {
                "language": "string",
                "text": "string"
              }
            ],
            "shortName": [
              {
                "language": "string",
                "text": "string"
              }
            ],
            "sourceOfDefinition": "string",
            "symbol": "string",
            "unit": "string",
            "unitId": {
              "keys": [
                {
                  "type": "Asset",
                  "idType": "Custom",
                  "value": "string",
                  "local": true
                }
              ]
            },
            "valueFormat": "string",
            "valueList": {
              "valueReferencePairTypes": [
                {
                  "value": "string",
                  "valueId": {
                    "keys": [
                      {
                        "type": "Asset",
                        "idType": "Custom",
                        "value": "string",
                        "local": true
                      }
                    ]
                  },
                  "valueType": "anyUri"
                }
              ]
            },
            "levelType": [
              "Min"
            ]
          }
        }
      ],
      "semanticId": {
        "keys": [
          {
            "type": "Asset",
            "idType": "Custom",
            "value": "string",
            "local": true
          }
        ]
      },
      "containedElements": [
        {
          "keys": [
            {
              "type": "Asset",
              "idType": "Custom",
              "value": "string",
              "local": true
            }
          ]
        }
      ]
    }
  ],
  "conceptDictionaries": [
    {
      "idShort": "string",
      "category": "string",
      "description": [
        {
          "language": "string",
          "text": "string"
        }
      ],
      "parent": {
        "keys": [
          {
            "type": "Asset",
            "idType": "Custom",
            "value": "string",
            "local": true
          }
        ]
      },
      "modelType": {
        "name": "Asset"
      },
      "embeddedDataSpecifications": [
        {
          "dataSpecification": {
            "keys": [
              {
                "type": "Asset",
                "idType": "Custom",
                "value": "string",
                "local": true
              }
            ]
          },
          "dataSpecificationContent": {
            "value": "string",
            "valueId": {
              "keys": [
                {
                  "type": "Asset",
                  "idType": "Custom",
                  "value": "string",
                  "local": true
                }
              ]
            },
            "valueType": "anyUri",
            "dataType": "DATE",
            "definition": [
              {
                "language": "string",
                "text": "string"
              }
            ],
            "preferredName": [
              {
                "language": "string",
                "text": "string"
              }
            ],
            "shortName": [
              {
                "language": "string",
                "text": "string"
              }
            ],
            "sourceOfDefinition": "string",
            "symbol": "string",
            "unit": "string",
            "unitId": {
              "keys": [
                {
                  "type": "Asset",
                  "idType": "Custom",
                  "value": "string",
                  "local": true
                }
              ]
            },
            "valueFormat": "string",
            "valueList": {
              "valueReferencePairTypes": [
                {
                  "value": "string",
                  "valueId": {
                    "keys": [
                      {
                        "type": "Asset",
                        "idType": "Custom",
                        "value": "string",
                        "local": true
                      }
                    ]
                  },
                  "valueType": "anyUri"
                }
              ]
            },
            "levelType": [
              "Min"
            ]
          }
        }
      ],
      "conceptDescriptions": [
        {
          "keys": [
            {
              "type": "Asset",
              "idType": "Custom",
              "value": "string",
              "local": true
            }
          ]
        }
      ]
    }
  ],
  "security": {
    "accessControlPolicyPoints": {
      "policyAdministrationPoint": {
        "localAccessControl": {
          "selectableSubjectAttributes": {
            "keys": [
              {
                "type": "Asset",
                "idType": "Custom",
                "value": "string",
                "local": true
              }
            ]
          },
          "defaultSubjectAttributes": {
            "keys": [
              {
                "type": "Asset",
                "idType": "Custom",
                "value": "string",
                "local": true
              }
            ]
          },
          "selectablePermissions": {
            "keys": [
              {
                "type": "Asset",
                "idType": "Custom",
                "value": "string",
                "local": true
              }
            ]
          },
          "defaultPermissions": {
            "keys": [
              {
                "type": "Asset",
                "idType": "Custom",
                "value": "string",
                "local": true
              }
            ]
          },
          "selectableEnvironmentAttributes": {
            "keys": [
              {
                "type": "Asset",
                "idType": "Custom",
                "value": "string",
                "local": true
              }
            ]
          },
          "defaultEnvironmentAttributes": {
            "keys": [
              {
                "type": "Asset",
                "idType": "Custom",
                "value": "string",
                "local": true
              }
            ]
          },
          "accessPermissionRule": [
            {
              "idShort": "string",
              "category": "string",
              "description": [
                {
                  "language": "string",
                  "text": "string"
                }
              ],
              "parent": {
                "keys": [
                  {
                    "type": "Asset",
                    "idType": "Custom",
                    "value": "string",
                    "local": true
                  }
                ]
              },
              "modelType": {
                "name": "Asset"
              },
              "qualifiers": [
                {
                  "modelType": {
                    "name": "Asset"
                  }
                }
              ],
              "targetSubjectAttributes": [
                {
                  "subjectAttributes": [
                    {
                      "keys": [
                        {
                          "type": "Asset",
                          "idType": "Custom",
                          "value": "string",
                          "local": true
                        }
                      ]
                    }
                  ]
                }
              ],
              "permissionsPerObject": [
                {
                  "object": {
                    "keys": [
                      {
                        "type": "Asset",
                        "idType": "Custom",
                        "value": "string",
                        "local": true
                      }
                    ]
                  },
                  "targetObjectAttributes": {
                    "objectAttribute": [
                      {
                        "idShort": "string",
                        "category": "string",
                        "description": [
                          {
                            "language": "string",
                            "text": "string"
                          }
                        ],
                        "parent": {
                          "keys": [
                            {
                              "type": "Asset",
                              "idType": "Custom",
                              "value": "string",
                              "local": true
                            }
                          ]
                        },
                        "modelType": {
                          "name": "Asset"
                        },
                        "embeddedDataSpecifications": [
                          {
                            "dataSpecification": {
                              "keys": [
                                {
                                  "type": "Asset",
                                  "idType": "Custom",
                                  "value": "string",
                                  "local": true
                                }
                              ]
                            },
                            "dataSpecificationContent": {
                              "value": "string",
                              "valueId": {
                                "keys": [
                                  {
                                    "type": "Asset",
                                    "idType": "Custom",
                                    "value": "string",
                                    "local": true
                                  }
                                ]
                              },
                              "valueType": "anyUri",
                              "dataType": "DATE",
                              "definition": [
                                {
                                  "language": "string",
                                  "text": "string"
                                }
                              ],
                              "preferredName": [
                                {
                                  "language": "string",
                                  "text": "string"
                                }
                              ],
                              "shortName": [
                                {
                                  "language": "string",
                                  "text": "string"
                                }
                              ],
                              "sourceOfDefinition": "string",
                              "symbol": "string",
                              "unit": "string",
                              "unitId": {
                                "keys": [
                                  {
                                    "type": "Asset",
                                    "idType": "Custom",
                                    "value": "string",
                                    "local": true
                                  }
                                ]
                              },
                              "valueFormat": "string",
                              "valueList": {
                                "valueReferencePairTypes": [
                                  {
                                    "value": "string",
                                    "valueId": {
                                      "keys": [
                                        {
                                          "type": "Asset",
                                          "idType": "Custom",
                                          "value": "string",
                                          "local": true
                                        }
                                      ]
                                    },
                                    "valueType": "anyUri"
                                  }
                                ]
                              },
                              "levelType": [
                                "Min"
                              ]
                            }
                          }
                        ],
                        "semanticId": {
                          "keys": [
                            {
                              "type": "Asset",
                              "idType": "Custom",
                              "value": "string",
                              "local": true
                            }
                          ]
                        },
                        "qualifiers": [
                          {
                            "modelType": {
                              "name": "Asset"
                            }
                          }
                        ],
                        "kind": "Template",
                        "value": "string",
                        "valueId": {
                          "keys": [
                            {
                              "type": "Asset",
                              "idType": "Custom",
                              "value": "string",
                              "local": true
                            }
                          ]
                        },
                        "valueType": "anyUri"
                      }
                    ]
                  },
                  "permission": [
                    {
                      "permission": {
                        "keys": [
                          {
                            "type": "Asset",
                            "idType": "Custom",
                            "value": "string",
                            "local": true
                          }
                        ]
                      },
                      "kindOfPermission": "Allow"
                    }
                  ]
                }
              ]
            }
          ]
        },
        "externalAccessControl": true
      },
      "policyDecisionPoint": {
        "externalPolicyDecisionPoints": true
      },
      "policyEnforcementPoint": {
        "externalPolicyEnforcementPoint": true
      },
      "policyInformationPoints": {
        "internalInformationPoint": [
          {
            "keys": [
              {
                "type": "Asset",
                "idType": "Custom",
                "value": "string",
                "local": true
              }
            ]
          }
        ],
        "externalInformationPoint": true
      }
    },
    "certificate": [
      {
        "blobCertificate": {
          "idShort": "string",
          "category": "string",
          "description": [
            {
              "language": "string",
              "text": "string"
            }
          ],
          "parent": {
            "keys": [
              {
                "type": "Asset",
                "idType": "Custom",
                "value": "string",
                "local": true
              }
            ]
          },
          "modelType": {
            "name": "Asset"
          },
          "embeddedDataSpecifications": [
            {
              "dataSpecification": {
                "keys": [
                  {
                    "type": "Asset",
                    "idType": "Custom",
                    "value": "string",
                    "local": true
                  }
                ]
              },
              "dataSpecificationContent": {
                "value": "string",
                "valueId": {
                  "keys": [
                    {
                      "type": "Asset",
                      "idType": "Custom",
                      "value": "string",
                      "local": true
                    }
                  ]
                },
                "valueType": "anyUri",
                "dataType": "DATE",
                "definition": [
                  {
                    "language": "string",
                    "text": "string"
                  }
                ],
                "preferredName": [
                  {
                    "language": "string",
                    "text": "string"
                  }
                ],
                "shortName": [
                  {
                    "language": "string",
                    "text": "string"
                  }
                ],
                "sourceOfDefinition": "string",
                "symbol": "string",
                "unit": "string",
                "unitId": {
                  "keys": [
                    {
                      "type": "Asset",
                      "idType": "Custom",
                      "value": "string",
                      "local": true
                    }
                  ]
                },
                "valueFormat": "string",
                "valueList": {
                  "valueReferencePairTypes": [
                    {
                      "value": "string",
                      "valueId": {
                        "keys": [
                          {
                            "type": "Asset",
                            "idType": "Custom",
                            "value": "string",
                            "local": true
                          }
                        ]
                      },
                      "valueType": "anyUri"
                    }
                  ]
                },
                "levelType": [
                  "Min"
                ]
              }
            }
          ],
          "semanticId": {
            "keys": [
              {
                "type": "Asset",
                "idType": "Custom",
                "value": "string",
                "local": true
              }
            ]
          },
          "qualifiers": [
            {
              "modelType": {
                "name": "Asset"
              }
            }
          ],
          "kind": "Template",
          "value": "string",
          "mimeType": "string"
        },
        "containedExtension": [
          {
            "keys": [
              {
                "type": "Asset",
                "idType": "Custom",
                "value": "string",
                "local": true
              }
            ]
          }
        ],
        "lastCertificate": true
      }
    ],
    "requiredCertificateExtension": [
      {
        "keys": [
          {
            "type": "Asset",
            "idType": "Custom",
            "value": "string",
            "local": true
          }
        ]
      }
    ]
  }
}

```

{% endtab %}

{% tab title="401: Unauthorized Authorization failed" %}

```javascript
unauthorized
```

{% endtab %}
{% endtabs %}

#### **Get Submodel List**

## Get AAS Submodel List

<mark style="color:blue;">`GET`</mark> `https://aasgateway.uat.industryapps.net/aasList/{aasId}/aas/submodels`

Returns a list of submodel objects

#### Path Parameters

| Name                                    | Type   | Description                                                             |
| --------------------------------------- | ------ | ----------------------------------------------------------------------- |
| aasId<mark style="color:red;">\*</mark> | String | URL encoded aasId. eg: *urn:industryapps:i40:aas:1:1:product%23NRW0989* |

#### Headers

| Name                                            | Type               | Description                                                                                                               |
| ----------------------------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | Bearer auth\_token | Provide the [generated token](/apis-or-data-integration)                                                                  |
| UserToken<mark style="color:red;">\*</mark>     | Bearer user\_token | Provide the token received from the [user data javascript method](/authentication/accessing-data-exposed-by-the-platform) |

{% tabs %}
{% tab title="200: OK Success Response" %}

```javascript
[
  {
    "idShort": "string",
    "kind": "Instance",
    "semanticId": {
      "keys": [
        {
          "type": "Undefined",
          "idType": "Undefined",
          "value": "string",
          "local": true
        }
      ]
    },
    "submodelElements": [
      {
        "idShort": "string",
        "semanticId": {
          "keys": [
            {
              "type": "Undefined",
              "idType": "Undefined",
              "value": "string",
              "local": true
            }
          ]
        },
        "constraints": [
          {
            "modelType": {
              "name": "string"
            }
          }
        ],
        "description": [
          {
            "language": "string",
            "text": "string"
          }
        ],
        "category": "string",
        "kind": "Instance",
        "modelType": {
          "name": "string"
        },
        "embeddedDataSpecifications": [
          {
            "hasDataSpecification": {
              "keys": [
                {
                  "type": "Undefined",
                  "idType": "Undefined",
                  "value": "string",
                  "local": true
                }
              ]
            },
            "dataSpecificationContent": {}
          }
        ]
      }
    ],
    "modelType": {
      "name": "string"
    },
    "embeddedDataSpecifications": [
      {
        "hasDataSpecification": {
          "keys": [
            {
              "type": "Undefined",
              "idType": "Undefined",
              "value": "string",
              "local": true
            }
          ]
        },
        "dataSpecificationContent": {}
      }
    ],
    "qualifiers": [
      {
        "modelType": {
          "name": "string"
        }
      }
    ],
    "identification": {
      "id": "string",
      "idType": "Undefined"
    },
    "administration": {
      "version": "string",
      "revision": "string"
    },
    "category": "string",
    "description": [
      {
        "language": "string",
        "text": "string"
      }
    ]
  }
]

```

{% endtab %}

{% tab title="401: Unauthorized Authorization failed" %}

```javascript
unauthorized
```

{% endtab %}
{% endtabs %}

#### **Get Submodel**

## Get an AAS Submodel

<mark style="color:blue;">`GET`</mark> `https://aasgateway.uat.industryapps.net/aasList/{aasId}/aas/submodels/{submodelIdShort}`

Get a Submodel of an AAS by submodelId

#### Path Parameters

| Name                                              | Type   | Description                                                             |
| ------------------------------------------------- | ------ | ----------------------------------------------------------------------- |
| aasId<mark style="color:red;">\*</mark>           | String | URL encoded aasId. eg: *urn:industryapps:i40:aas:1:1:product%23NRW0989* |
| submodelIdShort<mark style="color:red;">\*</mark> | String | IdShort of the Submodel. eg: *nameplate*                                |

#### Headers

| Name                                            | Type               | Description                                                                                                               |
| ----------------------------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------- |
| UserToken<mark style="color:red;">\*</mark>     | Bearer user\_token | Provide the token received from the [user data javascript method](/authentication/accessing-data-exposed-by-the-platform) |
| Authorization<mark style="color:red;">\*</mark> | Bearer auth\_token | Provide the [generated token](/apis-or-data-integration)                                                                  |

{% tabs %}
{% tab title="200: OK Success response" %}

```javascript
{
  "idShort": "string",
  "kind": "Instance",
  "semanticId": {
    "keys": [
      {
        "type": "Undefined",
        "idType": "Undefined",
        "value": "string",
        "local": true
      }
    ]
  },
  "submodelElements": [
    {
      "semanticId": {
        "keys": [
          {
            "type": "Undefined",
            "idType": "Undefined",
            "value": "string",
            "local": true
          }
        ]
      },
      "kind": "Instance",
      "modelType": {}
    }
  ],
  "modelType": {},
  "embeddedDataSpecifications": [
    {
      "hasDataSpecification": {
        "keys": [
          {
            "type": "Undefined",
            "idType": "Undefined",
            "value": "string",
            "local": true
          }
        ]
      },
      "dataSpecificationContent": {}
    }
  ],
  "qualifiers": [
    {
      "modelType": {}
    }
  ],
  "identification": {
    "id": "string",
    "idType": "Undefined"
  },
  "administration": {
    "version": "string",
    "revision": "string"
  },
  "category": "string",
  "description": [
    {
      "language": "string",
      "text": "string"
    }
  ]
}
```

{% endtab %}

{% tab title="401: Unauthorized Authorization failed" %}

```javascript
unauthorized
```

{% endtab %}
{% endtabs %}

#### **Get SubmodelElement List**

## Get all submodel elements of a submodel

<mark style="color:blue;">`GET`</mark> `https://aasgateway.uat.industryapps.net/aasList/{aasId}/aas/submodels/{submodelIdShort}/submodel/submodelElements`

Returns all elements of a submodel as a list

#### Path Parameters

| Name                                              | Type   | Description                                                             |
| ------------------------------------------------- | ------ | ----------------------------------------------------------------------- |
| aasId<mark style="color:red;">\*</mark>           | String | URL encoded aasId. eg: *urn:industryapps:i40:aas:1:1:product%23NRW0989* |
| submodelIdShort<mark style="color:red;">\*</mark> | String | IdShort of the Submodel. eg: *nameplate*                                |

#### Headers

| Name                                            | Type               | Description                                                                                                               |
| ----------------------------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | Bearer auth\_token | Provide the [generated token](/apis-or-data-integration)                                                                  |
| UserToken<mark style="color:red;">\*</mark>     | Bearer user\_token | Provide the token received from the [user data javascript method](/authentication/accessing-data-exposed-by-the-platform) |

{% tabs %}
{% tab title="200: OK Success Response" %}

```javascript
[
  {
    "idShort": "string",
    "semanticId": {
      "keys": [
        {
          "type": "Undefined",
          "idType": "Undefined",
          "value": "string",
          "local": true
        }
      ]
    },
    "qualifiers": [
      {
        "modelType": {
          "name": "string"
        }
      }
    ],
    "kind": "Instance",
    "modelType": {
      "name": "string"
    },
    "embeddedDataSpecifications": [
      {
        "hasDataSpecification": {
          "keys": [
            {
              "type": "Undefined",
              "idType": "Undefined",
              "value": "string",
              "local": true
            }
          ]
        },
        "dataSpecificationContent": {}
      }
    ],
    "category": "string",
    "description": [
      {
        "language": "string",
        "text": "string"
      }
    ]
  }
]
```

{% endtab %}

{% tab title="401: Unauthorized Authorization failed" %}

```javascript
unauthorized
```

{% endtab %}
{% endtabs %}

#### **Get SubmodelElement**

## Get a specific SubmodelElement

<mark style="color:blue;">`GET`</mark> `https://aasgateway.uat.industryapps.net/aasList/{aasId}/aas/submodels/{submodelIdShort}/submodel/submodelElements/{submodelElementIdShort}`

Returns a submodel element

#### Path Parameters

| Name                                                     | Type   | Description                                                             |
| -------------------------------------------------------- | ------ | ----------------------------------------------------------------------- |
| aasId<mark style="color:red;">\*</mark>                  | String | URL encoded aasId. eg: *urn:industryapps:i40:aas:1:1:product%23NRW0989* |
| submodelIdShort<mark style="color:red;">\*</mark>        | String | IdShort of the Submodel. eg: *nameplate*                                |
| submodelElementIdShort<mark style="color:red;">\*</mark> | String | IdShort of the Submodel Element. eg: *ManufacturerName*                 |

#### Headers

| Name                                            | Type               | Description                                                                                                               |
| ----------------------------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | Bearer auth\_token | Provide the [generated token](/apis-or-data-integration)                                                                  |
| UserToken<mark style="color:red;">\*</mark>     | Bearer user\_token | Provide the token received from the [user data javascript method](/authentication/accessing-data-exposed-by-the-platform) |

{% tabs %}
{% tab title="200: OK Success Response" %}

```javascript
{
  "idShort": "string",
  "semanticId": {
    "keys": [
      {
        "type": "Undefined",
        "idType": "Undefined",
        "value": "string",
        "local": true
      }
    ]
  },
  "qualifiers": [
    {
      "modelType": {
        "name": "string"
      }
    }
  ],
  "kind": "Instance",
  "modelType": {
    "name": "string"
  },
  "embeddedDataSpecifications": [
    {
      "hasDataSpecification": {
        "keys": [
          {
            "type": "Undefined",
            "idType": "Undefined",
            "value": "string",
            "local": true
          }
        ]
      },
      "dataSpecificationContent": {}
    }
  ],
  "category": "string",
  "description": [
    {
      "language": "string",
      "text": "string"
    }
  ]
}
```

{% endtab %}

{% tab title="401: Unauthorized Authorization failed" %}

```javascript
unauthporized
```

{% endtab %}
{% endtabs %}

#### &#x20; <br>


# Transactional data

Transactional operations data

### Generation Access Token

Access token can be generated using a REST API.

## Token Generation

<mark style="color:green;">`POST`</mark> `https://auth.uat.industryapps.net/auth/realms/IndustryApps/protocol/openid-connect/token`

Access Token generated in the response will be set in all AAS master data request header.

#### Headers

| Name                                           | Type                              | Description         |
| ---------------------------------------------- | --------------------------------- | ------------------- |
| content-type<mark style="color:red;">\*</mark> | application/x-www-form-urlencoded | Submit data as form |

#### Request Body

| Name                                             | Type                | Description                                   |
| ------------------------------------------------ | ------------------- | --------------------------------------------- |
| grant\_type<mark style="color:red;">\*</mark>    | client\_credentials |                                               |
| client\_id<mark style="color:red;">\*</mark>     | String              | Will be available in the App Information page |
| client\_secret<mark style="color:red;">\*</mark> | String              | Will be available in the App Information page |

{% tabs %}
{% tab title="200: OK Authorization Success" %}

```javascript
{
    "access_token":"eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJrcmJUeXU4b1lVUjZPcHlrd0pIMDNfN1IxS194MHU1ZnUwQ3hlSGliTThrIn0.eyJleHAiOjE2MjE4NTE5NTQsImlhdCI6MTYyMTg1MTY1NCwianRpIjoiMzZjMDE2NTYtODhkNC00NDIxLThiYmQtMDhjMDE1MGMwYjFkIiwiaXNzIjoiaHR0cHM6Ly9hdXRoLmRldi5pbmR1c3RyeWFwcHMubmV0L2F1dGgvcmVhbG1zL0FwcFN0b3JlIiwiYXVkIjoiYWNjb3VudCIsInN1YiI6IjlmM2UzMmM2LWYyMjMtNDNjMy04YjkwLTA2NDc3Nzg4ZTcyNyIsInR5cCI6IkJlYXJlciIsImF6cCI6InNlbnNvci5tb2ludG9yIiwiYWNyIjoiMSIsInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJvZmZsaW5lX2FjY2VzcyIsInVtYV9hdXRob3JpemF0aW9uIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsic2Vuc29yLm1vaW50b3IiOnsicm9sZXMiOlsidW1hX3Byb3RlY3Rpb24iXX0sImFjY291bnQiOnsicm9sZXMiOlsibWFuYWdlLWFjY291bnQiLCJtYW5hZ2UtYWNjb3VudC1saW5rcyIsInZpZXctcHJvZmlsZSJdfX0sInNjb3BlIjoicHJvZmlsZSBlbWFpbCIsImNsaWVudEhvc3QiOiIxNzIuMjUuMC4xIiwiY2xpZW50SWQiOiJzZW5zb3IubW9pbnRvciIsImVtYWlsX3ZlcmlmaWVkIjpmYWxzZSwicHJlZmVycmVkX3VzZXJuYW1lIjoic2VydmljZS1hY2NvdW50LXNlbnNvci5tb2ludG9yIiwiY2xpZW50QWRkcmVzcyI6IjE3Mi4yNS4wLjEifQ.pKSqIFb9VcmbQQe-tBbKELuV-EWSeRSa6BhlVQs3iwKS6vExtoBkauFV1stNLt1SE_KMNpY4UcOqua_p0hnm51jwy-U55NMlSyxIysarA1Kkylc8UScYfk6R4vBXLcaaJBA8qvGvBSf_ZjR1pCQqGwPL-EXOqojP49PCtsfDaMkDZ70037Yj7s7aISRFSm6jNOem679_Qi52WupSyIyqUv8u4S-licXOPO6Na-4X_NwKhByE9ET_Zw9zZFxFremcahafLyMQcU36dD8UrNx7DRIF06vQsMkAhbQ4FhT16uXjbAY_-usUfif882lUy9HmJDRRl-sZU_Obnj4v0-4nGA",
    "expires_in":300,
    "refresh_expires_in":0,
    "token_type":"Bearer",
    "not-before-policy":0,
    "scope":"profile email"
}
```

{% endtab %}

{% tab title="401: Unauthorized Authorization Failed" %}

```javascript
{
"error": "unauthorized_client",
"error_description": "message"
}
```

{% endtab %}
{% endtabs %}

### Transactional APIs

**Purchase Order List**

## Purchase Order List

<mark style="color:green;">`POST`</mark> `https://connect.dev.industryapps.net/platform-api/v1/inbound/purchase-order-list`&#x20;

Returns all purchase orders

#### Headers

| Name                                            | Type               | Description                                                                                                               |
| ----------------------------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | Bearer auth\_token | Provide the [generated token](/apis-or-data-integration)                                                                  |
| UserToken<mark style="color:red;">\*</mark>     | Bearer user\_token | Provide the token received from the [user data javascript method](/authentication/accessing-data-exposed-by-the-platform) |

#### Request Body

| Name                                        | Type                                    | Description                                                                                    |
| ------------------------------------------- | --------------------------------------- | ---------------------------------------------------------------------------------------------- |
| plantList<mark style="color:red;">\*</mark> | \[1]                                    | List of plant IDs                                                                              |
| metadata<mark style="color:red;">\*</mark>  | { "pagePosition" : 1, "pageSize" : 15 } | Page number and position for paged response                                                    |
| toDate                                      | String                                  | filter by to date (timestamp)                                                                  |
| fromDate                                    | String                                  | filter by from date (timestamp)                                                                |
| frequency                                   | String                                  | <p>Allowed values are</p><p>D - Daily</p><p>W - Weekily</p><p>M - Monthly</p><p>Y - Yearly</p> |

**Purchase Order Details**

## Purchase Order Details

<mark style="color:green;">`POST`</mark> `https://connect.dev.industryapps.net/platform-api/v1/inbound/purchase-order-details`

#### Headers

| Name                                            | Type               | Description                                                                                                               |
| ----------------------------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | Bearer auth\_token | Provide the [generated token](/apis-or-data-integration)                                                                  |
| UserToken<mark style="color:red;">\*</mark>     | Bearer user\_token | Provide the token received from the [user data javascript method](/authentication/accessing-data-exposed-by-the-platform) |

#### Request Body

| Name                                      | Type   | Description       |
| ----------------------------------------- | ------ | ----------------- |
| orderId<mark style="color:red;">\*</mark> | String | Order Id          |
| today                                     | String | timestamp now     |
| plantList                                 | \[1]   | List of plant IDs |

**Production Order List**

## Production Order List

<mark style="color:green;">`POST`</mark> `https://connect.dev.industryapps.net /platform-api/v1/manufacturing/production-order-list`

List of Production Orders

#### Headers

| Name                                            | Type               | Description                                                                                                               |
| ----------------------------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | Bearer auth\_token | Provide the [generated token](/apis-or-data-integration)                                                                  |
| UserToken<mark style="color:red;">\*</mark>     | Bearer user\_token | Provide the token received from the [user data javascript method](/authentication/accessing-data-exposed-by-the-platform) |

#### Request Body

| Name                                            | Type                                    | Description                                                                                              |
| ----------------------------------------------- | --------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| fromDate                                        | String                                  | filter by from date (timestamp)                                                                          |
| toDate                                          | String                                  | filter by to date (timestamp)                                                                            |
| rangeType                                       | 5D                                      |                                                                                                          |
| type                                            | A                                       |                                                                                                          |
| workOrderNo                                     | String                                  | WorkOrder number                                                                                         |
| lineId                                          | String                                  |                                                                                                          |
| status                                          | String                                  | <p>Allowed Status are</p><p>P - Pending</p><p>S - Scheduled</p><p>I - In Progress</p><p>C - Complete</p> |
| productCode                                     | String                                  | Product Code                                                                                             |
| toolId                                          | String                                  | Tool Id                                                                                                  |
| machineId                                       | String                                  | Machine Id                                                                                               |
| metadata<mark style="color:red;">\*</mark>      | { "pageSize" : 10, "pagePosition" : 1 } | Page number and position for paged response                                                              |
| processTypeId<mark style="color:red;">\*</mark> | 1                                       | <p>Process Type Id</p><p>1 - Diecasting</p><p>2 - Shotblasting</p><p>3 - Trimming</p>                    |
| plantList<mark style="color:red;">\*</mark>     | \[1]                                    | List of plant IDs                                                                                        |

**Production Order Details**

## Production Order Details

<mark style="color:green;">`POST`</mark> `https://connect.dev.industryapps.net /platform-api/v1/manufacturing/production-orderdetails`

#### Headers

| Name                                            | Type               | Description                                                                                                               |
| ----------------------------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | Bearer auth\_token | Provide the [generated token](/apis-or-data-integration)                                                                  |
| UserToken<mark style="color:red;">\*</mark>     | Bearer user\_token | Provide the token received from the [user data javascript method](/authentication/accessing-data-exposed-by-the-platform) |

#### Request Body

| Name                                               | Type                         | Description       |
| -------------------------------------------------- | ---------------------------- | ----------------- |
| requestParameter<mark style="color:red;">\*</mark> | { "SubWorkOrderID" : 13616 } | WorkOrder Id      |
| plantList<mark style="color:red;">\*</mark>        | \[1]                         | List of plant IDs |


# Docker Information

Containerising, configuring and pushing your applications.

If you are looking to push your application to IndustryApps via Docker, you can integrate your application credentials into a `docker-compose.yml` file. The following compositions offer sample templates that may be used while pushing your application categorised by server-side languages.

The docker-compose.yml file will need to contain an image name appropriate to your application should you decide to push your container onto the IndustryApps platform directly.&#x20;

Navigate to:

&#x20;Applications > `{App Name}` > App Data, the required name will be available as shown below:

![Unique application container image name](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2Fy9cH4l3Rtz9rgD13JtOF%2FScreenshot%202022-07-27%20at%2006.00.55.png?alt=media\&token=1c676a78-5499-40eb-ba1f-7a345de02af9)

### Things to note when containerising your application

The IndustryApps system expects the apps to be containerised and pushed to our container registry. When containerising the app please take care of below points.

* The application start command should be added in the *`ENTRYPOINT.`*
* Application should be running on port `80.`
* The **Eureka Server URL** and **hostname** should be set as environment variable - `EUREKA_SERVER` and `HOSTNAME.`
* If the application is hosted externally, the hostname and status check which point to the platform require ssl certification for a successful registration.

To Deploy onto the IndustryApps docker registry, tag your applications' docker composition as seen below.

```
docker build --tag industryapps.azurecr.io/<my_company>/<APPID>
```

You may simply copy your applications unique URI from 'Applications > `{App Name}` > App Data' as seen above.

To Push your container onto the registry, execute the following command in terminal. Copy into the terminal the unique URI.

```
docker push industryapps.azurecr.io/<my_company>/<APPID>
```

Additionally, please be sure to configure the context URL for your client-side application in your `index.html` file as a relative path. An example shown below illustrates how this can be accomplished with Angular.

```html
<head>
    <meta charset="utf-8">
    <title>Application</title>
    <base href=".">
    ...
</head>
```

{% hint style="warning" %}
If the application container image is pushed onto the platform, be sure to configure the application under a sub-directory inside your application directories designated as your applications'`APPCODE`.

`https://your-domain.com/{APPCODE}/`
{% endhint %}


# Ruby Stack

The example below demonstrates a composition of Ruby, PostgreSQL & Redis with the pre-defined Sidecar.

<img src="https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FP3wSZyekJOcBmzooIxbY%2Fpostgresql.png?alt=media&amp;token=f29a86fb-3916-4124-b394-1da5ba071d02" alt="" data-size="line">![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FUSS5oQGSWDLCt550dAuu%2Ficons8-jewel-24.png?alt=media\&token=8b681755-49ef-4dfc-a4c8-54dfc0060124)<img src="https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FOuJ3PqhWCkvKEOxu14eq%2Ficons8-redis-48.png?alt=media&amp;token=d07991cb-26cb-4fd6-986f-858790f289c9" alt="" data-size="line">

{% code title="docker-compose.yml" %}

```docker
# Docker Compose Example code for Ruby
 image: industryapps.azurecr.io/<<app-name>>
    restart: always
    ports:
      - 8080:8080
    environment:
      DATABASE_HOST: db
      DATABASE_NAME: <<db-name>>
      DATABASE_USERNAME: <<db-user>>
      DATABASE_PASSWORD: <<db-password>>
      DATABASE_PORT: 5432
      REDIS_URL: redis://redis:6379/0
      INAPPS_AUTH_API_BASE_URI: https://auth.uat.industryapps.netplea
      INAPPS_AASGATEWAY_API_BASE_URI: https://aasgateway.uat.industryapps.net
      INAPPS_CLIENT_CREDENTIALS_ID: <<app-id>>
      INAPPS_CLIENT_CREDENTIALS_SECRET: <<app-secret-code>>
      INAPPS_APP_CODE: /<<app-code>>
      RAILS_ENV: production
      RAILS_LOG_TO_STDOUT: "true"
      INAPPS_MASTER_API_BASE_URI: https://democustomer.uat.industryapps.net/masterMiddleware
    logging:
      driver: "json-file"
      options:
        max-file: "5"
        max-size: "10m"
  db:
    image: postgres:13.4-alpine
    restart: always
    environment:
      POSTGRES_USER: <<db-user>>
      POSTGRES_PASSWORD: <<db-password>>
    volumes:
      - ./db-data:/var/lib/postgresql/data
  redis:
    image: redis
    restart: always

  sidecar:
    image: industryapps.azurecr.io/service-discovery-sidecar
    container_name: { my-apps-name-sidecar }
    restart: always
    environment:
      NODE_ENV: production
      DEPLOYMENT_MODE: public
      EUREKA_INSTANCE_IP: { IP }
      EUREKA_INSTANCE_PORT: 8080 # PORT
      EUREKA_INSTANCE_APP: { APPCODE }
      EUREKA_INSTANCE_HOST_NAME: <your_domain>/
      EUREKA_INSTANCE_HOME_PAGE_URL: https://<your_domain>/{APPCODE}
      EUREKA_HOST: servicediscovery.uat.industryapps.net
      EUREKA_PORT: 443
      
```

{% endcode %}

Inside the `docker-compose.yml` file, add the necessary information which is tagged with curly braces ' `{  }` '.&#x20;

* **`IP`** -> The IP of the web service which you are running, such as on AWS EC2 Ubuntu, Lightsail instance or Azure Web services as an example.
* **`PORT`** -> The port which the app client-side is served at (e.g. Port 80).
* **`APPCODE`** -> Navigate to Developer dashboard > Applications > {App Name} > App Data, the Application code will be available there.
* **`HOSTNAME`** -> Can be found on the Developer dashboard, the boilerplate is the hostname  of the application: `https://<your_domain>/{APPCODE}`

{% hint style="info" %}
If the application container is pushed onto IndustryApps, the HOSTNAME is the Application ID.
{% endhint %}

[Additional information about Production deployment can be found here.](/connect-to-the-platform/production-deployment)


# Golang Stack

The example below demonstrates a composition of Go, PostgreSQL with the pre-defined Sidecar.

<img src="https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FTkKxwrOLRHJyw3F3awiM%2Fgolang_logo_icon_171074.png?alt=media&amp;token=0b03c1a6-ce99-4be9-89fa-66604862c699" alt="" data-size="line"><img src="https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FP3wSZyekJOcBmzooIxbY%2Fpostgresql.png?alt=media&amp;token=f29a86fb-3916-4124-b394-1da5ba071d02" alt="" data-size="line">

{% code title="docker-compose.yml" %}

```docker
version: "3.8"

services:
  web:
    container_name: go-app
    build: ./
    ports:
      - "5000:5000"
    environment:
      DD_DB_HOST: db
    command: /server
    depends_on:
      - db
  db:
    container_name: go-app-db
    image: postgres:14.1-alpine
    ports:
      - "5432:5432"
    environment:
      POSTGRES_USER: goland
      POSTGRES_PASSWORD: goland
      POSTGRES_DB: goland
    volumes:
      - ./init.sql:/docker-entrypoint-initdb.d/init.sql
      
  sidecar:
    image: industryapps.azurecr.io/service-discovery-sidecar
    container_name: { my-apps-name-sidecar }
    restart: always
    environment:
      NODE_ENV: production
      DEPLOYMENT_MODE: public
      EUREKA_INSTANCE_IP: { IP }
      EUREKA_INSTANCE_PORT: { PORT }
      EUREKA_INSTANCE_APP: { app-code }
      EUREKA_INSTANCE_HOST_NAME: { my-app-domain }/
      EUREKA_INSTANCE_HOME_PAGE_URL: https://<your_domain>/{APPCODE}
      EUREKA_HOST: servicediscovery.uat.industryapps.net
      EUREKA_PORT: 443
      
networks:
   default:
      driver: bridge
```

{% endcode %}

Inside the `docker-compose.yml` file, add the necessary information which is tagged with curly braces ' `{  }` '.&#x20;

* **`IP`** -> The IP of the web service which you are running, such as on AWS EC2 Ubuntu, Lightsail instance or Azure Web services as an example.
* **`PORT`** -> The port which the app client-side is served at (e.g. Port 80).
* **`APPCODE`** -> Navigate to Developer dashboard > Applications > {App Name} > App Data, the Application code will be available there.
* **`HOSTNAME`** -> Can be found on the Developer dashboard, the boilerplate is the hostname  of the application: `https://<your_domain>/{APPCODE}`

{% hint style="info" %}
If the application container is pushed onto IndustryApps, the HOSTNAME is the Application ID.
{% endhint %}

[Additional information about Production deployment can be found here.](/connect-to-the-platform/production-deployment)


# Node JS Stack

The example below demonstrates a MEAN stack sample `docker-compose.yml` with the pre-defined Sidecar.

<img src="https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2F1oHQNserxDPTh8bdCfnz%2Fnodejs.png?alt=media&amp;token=240d7eec-27b7-4a13-88c5-c6668ed745ea" alt="" data-size="line"><img src="https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FxXH7p52lItETuEI5Xor9%2Fangular.png?alt=media&amp;token=6b6e02f5-91fb-469e-824d-730726560e65" alt="" data-size="line"><img src="https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FUi8mjPwuuVly1ft2hGYo%2Fmongodb.png?alt=media&amp;token=34a70a3e-8608-4c18-a640-fb333dc0c150" alt="" data-size="line">

{% code title="docker-compose.yml" %}

```docker
# MEAN stack sample docker-compose file
version: "3"
services:
  ui:
   build:
      context: ./ui
      dockerfile: Dockerfile.dev
   ports:
      - 4200:4200
   container_name: mean-ui
   networks:
      - mean-stack-net
   volumes:
      - ./ui/src:/usr/app/src
      - ./ui/public:/usr/app/public
   depends_on:
      - api
   stdin_open: true
   tty: true

  api:
   build:
    context: ./api
    dockerfile: Dockerfile.dev
   ports:
      - 3080:3080
   container_name: mean-api
   networks:
      - mean-stack-net
   volumes:
      - ./api/src:/usr/app/src
   depends_on:
      - db

  db:
    image: mongo
    ports:
      - 27017:27017
    container_name: mongo-db
    networks:
      - mean-stack-net
    volumes:
      - mongo-data:/data/db
  
  sidecar:
    image: industryapps.azurecr.io/service-discovery-sidecar
    container_name: { my-apps-name-sidecar }
    restart: always
    environment:
      NODE_ENV: production
      DEPLOYMENT_MODE: public
      EUREKA_INSTANCE_IP: { IP }
      EUREKA_INSTANCE_PORT: { PORT }
      EUREKA_INSTANCE_APP: { app-code }
      EUREKA_INSTANCE_HOST_NAME: { my-app-domain }/
      EUREKA_INSTANCE_HOME_PAGE_URL: https://<your_domain>/{APPCODE}
      EUREKA_HOST: servicediscovery.uat.industryapps.net
      EUREKA_PORT: 443
  

networks:
  mean-stack-net:
    driver: bridge

volumes:
  mongo-data:
    driver: local
```

{% endcode %}

Inside the `docker-compose.yml` file, add the necessary information which is tagged with curly braces ' `{  }` '.&#x20;

* **`IP`** -> The IP of the web service which you are running, such as on AWS EC2 Ubuntu, Lightsail instance or Azure Web services as an example.
* **`PORT`** -> The port which the app client-side is served at (e.g. Port 80).
* **`APPCODE`** -> Navigate to Developer dashboard > Applications > {App Name} > App Data, the Application code will be available there.
* **`HOSTNAME`** -> Can be found on the Developer dashboard, the boilerplate is the hostname  of the application: `https://<your_domain>/{APPCODE}`

{% hint style="info" %}
If the application container is pushed onto IndustryApps, the HOSTNAME is the Application ID.
{% endhint %}

[Additional information about Production deployment can be found here.](/connect-to-the-platform/production-deployment)


# Java Spring Stack

The example below demonstrates a Spring stack sample `docker-compose.yml` with the pre-defined Sidecar.

<img src="https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FO2RXiTfjPOkdSJkP1fYa%2Fjava.png?alt=media&amp;token=0cc7bff0-6d5f-46ec-8868-dd54339b7d6e" alt="" data-size="line"><img src="https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FTif22cqD4xeTVmyvX9nk%2Fspring-boot.png?alt=media&amp;token=e197ec7e-a147-4243-b2ae-db3a2da579fc" alt="" data-size="line"><img src="https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FP2to0MQLC4q5HbZLTCnY%2Ficons8-react-30.png?alt=media&amp;token=95fe774a-4549-4240-a753-25a85914ea9f" alt="" data-size="line">

{% code title="docker-compose.yml" %}

```docker
# Spring Stack docker-compose file example
version: '3.8'

# Define services
services:
  # App backend service
  app-server:
    build:
      context: app-server 
      dockerfile: Dockerfile
    ports:
      - "8080:8080" 
    restart: always
    depends_on: 
      - db 
    environment: 
      SPRING_DATASOURCE_URL: jdbc:mysql://${MYSQL_HOST:localhost}:3306/db_example
      SPRING_DATASOURCE_USERNAME: my-user
      SPRING_DATASOURCE_PASSWORD: my-password     

  # Frontend Service 
  app-client:
    build:
      context: app-client 
      dockerfile: Dockerfile
      args:
        REACT_APP_API_BASE_URL: https://ip:8080/api
    ports:
      - "80:80" 
    restart: always
    depends_on:
      - app-server

  # Database Service (MySQL)
  db:
    image: mysql:5.7
    ports:
      - "3306:3306"
    restart: always
    environment:
      MYSQL_DATABASE: db
      MYSQL_USER: my-db-user
      MYSQL_PASSWORD: my-db-password
      MYSQL_ROOT_PASSWORD: root
    volumes:
      - db-data:/var/lib/mysql
    
  sidecar:
    image: industryapps.azurecr.io/service-discovery-sidecar
    container_name: { my-apps-name-sidecar }
    restart: always
    environment:
      NODE_ENV: production
      DEPLOYMENT_MODE: public
      EUREKA_INSTANCE_IP: { IP }
      EUREKA_INSTANCE_PORT: { PORT }
      EUREKA_INSTANCE_APP: { app-code }
      EUREKA_INSTANCE_HOST_NAME: { my-app-domain }/
      EUREKA_INSTANCE_HOME_PAGE_URL: https://<your_domain>/{APPCODE}
      EUREKA_HOST: servicediscovery.uat.industryapps.net
      EUREKA_PORT: 443
      
volumes:
  db-data:

networks:
   default:
      driver: bridge
```

{% endcode %}

Inside the `docker-compose.yml` file, add the necessary information which is tagged with curly braces ' `{  }` '.&#x20;

* **`IP`** -> The IP of the web service which you are running, such as on AWS EC2 Ubuntu, Lightsail instance or Azure Web services as an example.
* **`PORT`** -> The port which the app client-side is served at (e.g. Port 80).
* **`APPCODE`** -> Navigate to Developer dashboard > Applications > {App Name} > App Data, the Application code will be available there.
* **`HOSTNAME`** -> Can be found on the Developer dashboard, the boilerplate is the hostname  of the application: `https://<your_domain>/{APPCODE}`

{% hint style="info" %}
If the application container is pushed onto IndustryApps, the HOSTNAME is the Application ID.
{% endhint %}

[Additional information about Production deployment can be found here.](/connect-to-the-platform/production-deployment)


# Python Stack

The example below demonstrates a Vue /Nuxt js, FastApi, Sqlite, Redis stack sample `docker-compose.yml` with the pre-defined Sidecar.

<img src="https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FglSCB8Cldt7fOEfKHgfR%2Fpython.png?alt=media&amp;token=8e3078c1-0844-4638-9672-0aebd0b04d9e" alt="" data-size="line"><img src="https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FB0FoK4DvVcI5RFk66xDR%2Fvuejs.png?alt=media&amp;token=8c2824de-3d91-4776-82f4-2cb9b2b89556" alt="" data-size="line"><img src="https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FOuJ3PqhWCkvKEOxu14eq%2Ficons8-redis-48.png?alt=media&amp;token=d07991cb-26cb-4fd6-986f-858790f289c9" alt="" data-size="line">

{% code title="docker-compose.yml" %}

```docker
# Docker Compose Example code for Python
version: '3.3'
services:
   fastapi:
      build: ./server
      container_name: fastapi
      ports:
         - "5000:5000"
      command:  uvicorn server.backend.main:app --reload --workers 1 --host 0.0.0.0 --port 5000
      environment:
         - DATABASE_URL=sqlite:///./sql_app.db
      restart: always
      tty: true
   
   frontend:
      build: ./app
      working_dir: /app
      ports:
         - "8000:8000"
      environment:
         - HOST=0.0.0.0
      container_name: nuxt-app
      command: npm start
      restart: always
      tty: true
   
   cache:
      image: redis:6.2
      restart: always
      ports:
      - "6379:6379"
      command: redis-server --save 20 1 --loglevel warning
   
   
   sidecar:
      image: industryapps.azurecr.io/service-discovery-sidecar
      container_name: sidecar
      environment:
         NODE_ENV: production
         DEPLOYMENT_MODE: public
         EUREKA_INSTANCE_IP: { IP }
         EUREKA_INSTANCE_PORT: { PORT }
         EUREKA_INSTANCE_APP: { APPCODE }
         EUREKA_HOST: servicediscovery.uat.industryapps.net
         EUREKA_PORT: 443
         EUREKA_INSTANCE_HOST_NAME: { HOSTNAME }
      
networks:
   default:
      driver: bridge
```

{% endcode %}

Inside the `docker-compose.yml` file, add the necessary information which is tagged with curly braces ' `{  }` '.&#x20;

* **`IP`** -> The IP of the web service which you are running, such as on AWS EC2 Ubuntu, Lightsail instance or Azure Web services as an example.
* **`PORT`** -> The port which the app client-side is served at (e.g. Port 80).
* **`APPCODE`** -> Navigate to Developer dashboard > Applications > {App Name} > App Data, the Application code will be available there.
* **`HOSTNAME`** -> Can be found on the Developer dashboard, the boilerplate is the hostname  of the application: `https://<your_domain>/{APPCODE}`

{% hint style="info" %}
If the application container is pushed onto IndustryApps, the HOSTNAME is the Application ID.
{% endhint %}

[Additional information about Production deployment can be found here.](/connect-to-the-platform/production-deployment)


# Connect to the Platform

IndustryApps application development guideline

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2Fv01ABWAhnNqxfouN27IL%2Feureka-banner.png?alt=media\&token=07141046-129b-4b21-96d4-366f3f2d51ab)

There are no technology barriers for creating an application for the IndustryApps platform. You need to comply with certain standards to make your application work with the platform.

{% hint style="info" %}
Check out [Docker Information](/docker-information) for our most recommended option for deployment & connecting onto the platform by pushing your application onto the IndustryApps docker container registry.
{% endhint %}

IndustryApps uses an Application Service Registry (Service Discovery) to keep track of all app instances. The apps should register to the Service Registry to get the apps discoverable in the customer platform.

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FZVWk9L95MDsV4Fkzxwrh%2Fimage.png?alt=media\&token=127e1aab-6205-4ac4-bc72-0b0b57e39ac8)

We use the [Netflix Eureka](https://github.com/Netflix/eureka/wiki/Eureka-at-a-glance) to implement the Service Registry. Our Customer Platform will be the Eureka Server and the apps will be working as Eureka clients. Full understanding of Netflix Eureka is not required but only provided as a reference for architecture.

Eureka client integration will be simple using the dependency libraries available for different programming languages and frameworks. These client libraries are provided as solutions for implementing Eureka service discovery as an additional integration into your existing application. I.e. these libraries are to be utilised and integrated as Eureka frameworks and to have IndustryApps credentials be placed in to connect to the platform. There are other options available if this does not fit to your applications needs.

By referring to the libraries below, you can utilise these according to your tech stack of choice. Alternatively, you may use the [Pre-built Sidecar](/connect-to-the-platform/use-our-pre-built-sidecar) without requiring to make modification to your application.

### Available Eureka Client Libraries

{% hint style="info" %}

#### [<img src="https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FTipWM2c4OCLEzNflC8hq%2Fpython.png?alt=media&amp;token=4c2ef489-1b25-4953-b14e-73ab71858798" alt="" data-size="line"> Python Eureka Client](https://github.com/keijack/python-eureka-client)

{% endhint %}

{% hint style="info" %}

#### <img src="https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FudqF0FfoQeqH7r3FsKAQ%2Fflask.png?alt=media&amp;token=562839ff-8012-4a1c-bc95-b1efbfeedb5a" alt="" data-size="line">[Python Flask](https://github.com/IndustryApps/flask-eureka)

{% endhint %}

{% hint style="info" %}

#### [<img src="https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FlMEn6sBFSfIBXKC7temH%2Fjava.png?alt=media&amp;token=6f53c992-f78c-438f-9b3c-ca0da1e0fffb" alt="" data-size="line"> Java Eureka Client](https://mvnrepository.com/artifact/com.netflix.eureka/eureka-client)

[Configuring Eureka Client](https://github.com/Netflix/eureka/wiki/Configuring-Eureka#configuring-eureka-client)
{% endhint %}

{% hint style="info" %}

#### [<img src="https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FfbCxZApi33Qlk23EjPNS%2Fspring.png?alt=media&amp;token=f3536844-6e94-4be9-b28d-36d5172986fd" alt="" data-size="line"> Spring Eureka Client](https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-netflix-eureka-client)

[Spring Cloud Netflix](https://cloud.spring.io/spring-cloud-netflix/reference/html/)
{% endhint %}

{% hint style="info" %}

#### [<img src="https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2Fr72ITFORs2jN77LhJycF%2Fnodejs.png?alt=media&amp;token=3fb797f2-a229-4620-a1fb-5f5102704274" alt="" data-size="line"> NodeJS Eureka Client](https://www.npmjs.com/package/eureka-js-client)

{% endhint %}

{% hint style="info" %}

#### [<img src="https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FbqdZKlMhLHDnsBQj7TDR%2Fgolang.png?alt=media&amp;token=0b18318d-ebb7-4f85-b03c-0d7f1abfd841" alt="" data-size="line"> Golang Eureka Client](https://github.com/xuanbo/eureka-client)

{% endhint %}

#### Application Properties

Utilising the Eureka service discovery by endpoints within your application will require the URL available below. To get a further understanding please refer to the available sample applications.

Eureka Server: <https://servicediscovery.uat.industryapps.net/>

### Sample Apps

The following applications are provided as a reference for demonstration on utilising Eureka service discovery within your applications. Alternatively, you may use the [Pre-defined Sidecar](/connect-to-the-platform/use-our-pre-built-sidecar).

#### Java Sample App

{% embed url="<https://github.com/IndustryApps/Sample-App-Springboot>" %}

#### Flask Sample App

{% embed url="<https://github.com/IndustryApps/Sample-App-Flask>" %}

If the available libraries don't fit your application or you don't want to use any third-party libraries, you can implement the service discovery client on your own.

* [Option 1: Integrate using Eureka Rest APIs](/connect-to-the-platform/integrate-using-eureka-rest-apis)
* [Option 2: Use our Pre-built sidecar](/connect-to-the-platform/use-our-pre-built-sidecar)

{% hint style="warning" %}
If you are experiencing issues connecting via Eureka endpoints or the Pre-defined Sidecar, check out [FAQs](/faqs-or-troubleshooting), [Testing](/testing) or reach out to our dedicated team via **<partnersupport@industryapps.net>.**
{% endhint %}


# Integrate using Eureka Rest APIs

You can use the Eureka Rest APIs explained [here](https://github.com/Netflix/eureka/wiki/Eureka-REST-operations).

**REST Endpoints Documentation**

**appID** is the name of the application and **instanceID** is the unique identifier associated with the instance. In AWS cloud, instanceID is the **instance id** of the instance and in other data centers, it is the **hostname** of the instance.

| ***Operation***                                  | ***HTTP action***                                                                                                                                                                                          | ***Description***                                                         |
| ------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| Register new application instance                | <mark style="color:blue;">POST</mark> /eureka/apps/**appID**                                                                                                                                               | *Input*: JSON/XML payload *Output*: HTTP Code: 204 on success             |
| De-register application instance                 | <mark style="color:red;">DELETE</mark> /eureka/apps/appID/instanceID                                                                                                                                       | *Output*: HTTP Code: 200 on success                                       |
| Send application instance heartbeat              | <mark style="color:orange;">PUT</mark> /eureka/apps/**appID**/**instanceID**                                                                                                                               | *Output*: HTTP Code: 200 on *success* 404 if **instanceID** doesn't exist |
| Take instance out of service                     | <mark style="color:orange;">PUT</mark> /eureka/apps/**appID**/**instanceID**/status?value=OUT\_OF\_SERVICE                                                                                                 | *Output* HTTP Code: 200 on *success* 500 on *failure*                     |
| Move instance back into service (remove override | <mark style="color:red;">DELETE</mark> /eureka/apps/**appID**/**instanceID**/status?value=UP (The value=UP is optional, it is used as a suggestion for the fallback status due to removal of the override) | *Output* HTTP Code: 200 on *success* 500 on *failure*                     |
| Update metadata                                  | <mark style="color:orange;">PUT</mark> /eureka/apps/**appID**/**instanceID**/metadata?key=value                                                                                                            | *Output* HTTP Code: 200 on *success* 500 on *failure*                     |

For JSON/XML, the content types supplied must be **application/xml** or **application/json**.

When you register, you’ll need to post an XML (or JSON) body which conforms to this XSD:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xsd:element name="instance">
        <xsd:complexType>
            <xsd:all>
                <!-- hostName in ec2 should be the public dns name, within ec2 public dns name will
                     always resolve to its private IP -->
                <xsd:element name="hostName" type="xsd:string" />
                <xsd:element name="app" type="xsd:string" />
                <xsd:element name="ipAddr" type="xsd:string" />
                <xsd:element name="vipAddress" type="xsd:string" />
                <xsd:element name="secureVipAddress" type="xsd:string" />
                <xsd:element name="status" type="statusType" />
                <xsd:element name="port" type="xsd:positiveInteger" minOccurs="0" />
                <xsd:element name="securePort" type="xsd:positiveInteger" />
                <xsd:element name="homePageUrl" type="xsd:string" />
                <xsd:element name="statusPageUrl" type="xsd:string" />
                <xsd:element name="healthCheckUrl" type="xsd:string" />
               <xsd:element ref="dataCenterInfo" minOccurs="1" maxOccurs="1" />
                <!-- optional -->
                <xsd:element ref="leaseInfo" minOccurs="0"/>
                <!-- optional app specific metadata -->
                <xsd:element name="metadata" type="appMetadataType" minOccurs="0" />
            </xsd:all>
        </xsd:complexType>
    </xsd:element>

    <xsd:element name="dataCenterInfo">
        <xsd:complexType>
             <xsd:all>
                 <xsd:element name="name" type="dcNameType" />
                 <!-- metadata is only required if name is Amazon -->
                 <xsd:element name="metadata" type="amazonMetdataType" minOccurs="0"/>
             </xsd:all>
        </xsd:complexType>
    </xsd:element>

    <xsd:element name="leaseInfo">
        <xsd:complexType>
            <xsd:all>
                <!-- (optional) if you want to change the length of lease - default if 90 secs -->
                <xsd:element name="evictionDurationInSecs" minOccurs="0"  type="xsd:positiveInteger"/>
            </xsd:all>
        </xsd:complexType>
    </xsd:element>

    <xsd:simpleType name="dcNameType">
        <!-- Restricting the values to a set of value using 'enumeration' -->
        <xsd:restriction base = "xsd:string">
            <xsd:enumeration value = "MyOwn"/>
            <xsd:enumeration value = "Amazon"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="statusType">
        <!-- Restricting the values to a set of value using 'enumeration' -->
        <xsd:restriction base = "xsd:string">
            <xsd:enumeration value = "UP"/>
            <xsd:enumeration value = "DOWN"/>
            <xsd:enumeration value = "STARTING"/>
            <xsd:enumeration value = "OUT_OF_SERVICE"/>
            <xsd:enumeration value = "UNKNOWN"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:complexType name="amazonMetdataType">
        <!-- From <a class="jive-link-external-small" href="http://docs.amazonwebservices.com/AWSEC2/latest/DeveloperGuide/index.html?AESDG-chapter-instancedata.html" target="_blank">http://docs.amazonwebservices.com/AWSEC2/latest/DeveloperGuide/index.html?AESDG-chapter-instancedata.html</a> -->
        <xsd:all>
            <xsd:element name="ami-launch-index" type="xsd:string" />
            <xsd:element name="local-hostname" type="xsd:string" />
            <xsd:element name="availability-zone" type="xsd:string" />
            <xsd:element name="instance-id" type="xsd:string" />
            <xsd:element name="public-ipv4" type="xsd:string" />
            <xsd:element name="public-hostname" type="xsd:string" />
            <xsd:element name="ami-manifest-path" type="xsd:string" />
            <xsd:element name="local-ipv4" type="xsd:string" />
            <xsd:element name="hostname" type="xsd:string"/>
            <xsd:element name="ami-id" type="xsd:string" />
            <xsd:element name="instance-type" type="xsd:string" />
        </xsd:all>
    </xsd:complexType>

    <xsd:complexType name="appMetadataType">
        <xsd:sequence>
            <!-- this is optional application specific name, value metadata -->
            <xsd:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
        </xsd:sequence>
    </xsd:complexType>

</xsd:schema>
```

**Examples**

**RENEW / HEARTBEAT**

Example : <mark style="color:orange;">`PUT`</mark>` ``/eureka/apps/MYAPP/i-6589ef6`

Response Status:

* <mark style="color:green;">`200`</mark> (on success)
* <mark style="color:orange;">`404`</mark> (eureka doesn't know about you, Register yourself first)
* <mark style="color:red;">`500`</mark> (failure)

(If Eureka doesn't get heartbeats from the service node within the evictionDurationInSecs, then the node will get automatically de-registered )

**CANCEL**

Example : <mark style="color:red;">`DELETE`</mark>` ``/eureka/apps/MYAPP/i-6589ef6`

Response Status:

* <mark style="color:green;">`200`</mark> (on success)
* <mark style="color:red;">`500`</mark> (failure)


# Use our Pre-built sidecar

You can download the pre-built sidecar from below

{% file src="/files/JkkRRLZDrt0Qj3SIECEQ" %}

You can execute the downloaded jar as below to register your application to the IndustryApps service registry.

```
java -jar discoveryClientSideCar-1.0.0.jar --appCode=<<Application Code>> --statusPageUrl=<<App home page/status page URL>> --hostname=<<Application hostname>>
```

***appCode*** is your App Code, which is available on publish page of your app vendor portal.

***statusPageUrl*** is your app’s landing page URL / URL for status check.

***hostname*** is the host running your app

Please refer to below screenshots for executing sidecar

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2Ft2AzKrZtUSqqQrsUV9Uq%2Fimage.png?alt=media\&token=9b001684-ebc3-452c-8936-0f951f458240)

After a successful register using sidecar, you will be getting registration status as `204`

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FiiDmgtk75lbN1wN0L7Cs%2Fimage.png?alt=media\&token=6ba58ddd-ee76-4802-b710-c900c7e4e300)

After service registry, IndustryApp platform can show new app inside the Platform

You can check the status of your app using the following URL [https://servicediscovery.uat.industryapps.net/eureka/apps/\<your\_app\_code>](https://servicediscovery.uat.industryapps.net/eureka/apps/<your_app_code>)

Check for the Status is "UP"

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2F1j9B3IszisNCa8zvSfbc%2Fimage.png?alt=media\&token=962f089a-ca07-4cd3-bd4f-40a60b580766)


# Production deployment

How to deploy your solution for Production instance

Once your App is approved in the Developer instance - IndustryApps will support you to migrate your solution to the Production environment. All documentation including security audit/compliance audits and submission forms will be confirmed by this step. At the end of this process, your App will be visible under [https://store.industryapps.net](https://store.industryapps.net/home) for global companies.&#x20;

{% hint style="success" %}
All documentations including App submission forms will need to be signed off at this step
{% endhint %}

## Option 1: Hosting as a container

For production instance, we suggest deploying your app inside our ecosystem. All apps need to be containerized and pushed to our container registry. Vendors will be provided with the container registry login credentials after registering in the partner portal.

First, you need to login to the container registry.

```
docker login -u <username> -p <password> industryappsuat.azurecr.io
```

Every app should be containerized with the name we have provided on the App Data page. *eg: industryappsuat.azurecr.io/sampleapp*

After the image creation, push your app to the registry.

```
docker push <image_name>
```

IndustryApps technical team will pull your image, test it, and deploy it in the IndustryApps Ecosystem, and finally, the app will be available in the store.

## Option 2: Hosting under IndustryApps VM

If there are challenges to containerize your application. The next option could be to request dedicated VM for your application under IndustryApps cloud. IndustryApps have dedicated cloud instances in Germany and China and depending on the Market focus the right environments can be assigned.&#x20;

## Option 3: Hosting by a public URL

This is the recommended approach if your solution demands special hardware configurations and significant setup efforts. Typical example could be a Platform based solution or Machine learning / AI solutions. Here we will be passing the control to your environment and you need to provide your terms of use and SLA during the App onboarding process.&#x20;

{% hint style="info" %}
If your product has special hardware requirement or significant setup efforts
{% endhint %}

Repository has to be selected “Public” for testing your locally hosted app and release tag to be set “None”

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FpY7d6djyfB3Wtp9aErrL%2Fimage.png?alt=media\&token=3107a3bb-eea5-406f-9ca8-0f0625bf6d43)

##

###


# Add-on Features

There are Add-on features which are to be added to applications onboarded onto IndustryApps, which are configured to open outside of the platform via a new tab on-click or otherwise. Please take care to add them according to your individual specifications.


# IApps-Navigation

Add-on Feature

The IApps-Navigation feature provides a method for users to circle back to the IndustryApps platform if they have accessed a third-party application which redirects via a new tab. Please utilise this add-on feature if your applications configuration fits this criteria.

Users utilise many applications on IndustryApps for different use cases, and as such providing a smooth flow transition is important for an improved user experience.

### How do I add it?

The feature should be added as code snippets in your client-side application. The add-on will redirect the user back when the IApps back button on-click event is triggered.

Copy the line of code below into your `index.html` file.

{% hint style="info" %}
In case of an Angular application a similar framework, you may include the `.js` and `.css` files in the `angular.json` script and style sections.
{% endhint %}

```html
<div id="iapps-nav-logo"></div>
```

Include the `iapps-nav.js` functions file illustrated below.

{% code title="iapps-nav.js" overflow="wrap" lineNumbers="true" %}

```javascript
document.getElementById("iapps-nav-logo").onclick = function() {onClickIappsLogo()};

var isDragged = false;
function onClickIappsLogo() {
    if (isDragged) {
        return;
    }
    let params = window.location.hash.split('launch=')
    let url = params.length > 1 ? params[1] : '';
    window.location.href = decodeURIComponent(url);
}

dragElement(document.getElementById("iapps-nav-logo"));

function dragElement(elmnt) {
    var pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0;
    if (document.getElementById("iapps-nav-logo")) {
        // if present, the header is where you move the DIV from:
        document.getElementById("iapps-nav-logo").onmousedown = dragMouseDown;
    } else {
        // otherwise, move the DIV from anywhere inside the DIV:
        elmnt.onmousedown = dragMouseDown;
    }

    function dragMouseDown(e) {
        e = e || window.event;
        e.preventDefault();
        // get the mouse cursor position at startup:
        pos3 = e.clientX;
        pos4 = e.clientY;
        document.onmouseup = closeDragElement;
        // call a function whenever the cursor moves:
        document.onmousemove = elementDrag;
    }

    function elementDrag(e) {
        isDragged = true;
        e = e || window.event;
        e.preventDefault();
        // calculate the new cursor position:
        pos1 = pos3 - e.clientX;
        pos2 = pos4 - e.clientY;
        pos3 = e.clientX;
        pos4 = e.clientY;
        // set the element's new position:
        elmnt.style.top = (elmnt.offsetTop - pos2) + "px";
        elmnt.style.left = (elmnt.offsetLeft - pos1) + "px";
    }

    function closeDragElement() {
        // stop moving when mouse button is released:
        document.onmouseup = null;
        document.onmousemove = null;
        setTimeout(dragEnd, 500);
    }

    function dragEnd() {
        isDragged = false;
    }
}

```

{% endcode %}

Include the `iapps-nav.css` file illustrated below.

{% code title="iapps-nav.css" overflow="wrap" lineNumbers="true" %}

```css
#iapps-nav-logo {
    background: url("assets/iapps-nav.png") ;
    position: fixed;
    height: 60px;
    width: 60px;
    background-size: contain;
    cursor: pointer;
    top: 75px;
    left: 10px;
    z-index: 25;
}
```

{% endcode %}

{% hint style="info" %}
In case of an Angular application, include the js and css files in the angular.json script and style sections.
{% endhint %}

Copy the `iapps-nav.png` image to your assets folder, available below.

{% file src="/files/tQsQUUvnflfeLXEQ3xSH" %}

Third-party Applications URL should contain a queryParam - launch. The URL assigned to launch the param will be used to redirect while clicking on the IApps back button.

Example:

{% code overflow="wrap" %}

```html
https://www.thirdpartyapp.com?launch=https://democustomer.uat.industryapps.net
```

{% endcode %}

**The Add-on feature repository is available below.**

{% embed url="<https://github.com/IndustryApps/iapps-navigation-addon-feature>" %}


# Testing

To test your application locally, demo user context can be used to observe functionality. The `platform-api.js` function `getPlatformContext` **cannot be used outside of the platform scope**, you can test the application with platform context by contacting our team and receiving access to a demo customer portal for this purpose.

```json5
// Demo user context to test functionality locally.
{
    "auth_token": "eb837c91-bee4-4011-8af5-1f7af649be92",
    "euser": "heera@xeiex.com",
    "plant_selected": "1",
    "language_selected": "en",
    "plant_list": [
        {
            "plantId": 2,
            "plantName": "Kilsyth",
            "plantCode": "5698",
            "defaultPlant": false
        },
        {
            "plantId": 1,
            "plantName": "Brisbane 01",
            "plantCode": "0987",
            "defaultPlant": true
        }
    ],
    "company_code": "1234",
    "roles": [
        "GRP_M_ADD",
        "TOOL_CRD_VIEW",
        "SOP_A_VIEW",
        "TSOP_M_ADD",
        "QSOP_IU_DEL",
        "OPR_ACT_ADD",
        "VENDOR_M_EDIT",
        "PROC_TYP_M_DEL",
        "QSOP_V_VIEW",
        "COM_M_EDIT",
        "DTC_EDIT",
        "8e08d9_Add_VIEW",
        "MACH_M_EDIT",
        "SOP_M_ADD",
        "QC_VIEW"
    ]
}
```

#### App (Client Token)

As mentioned in ['Accessing Masterdata'](broken://pages/-MiqcilIlqpVO3cyhIiA), both an application token (client token) and a user token (auth\_token) are required to be able to utilise AAS and Submodel data. A demonstration of retrieving the Application token is demonstrated below.

{% tabs %}
{% tab title="Python" %}

```python
"""
Python Sample Code, retrieving App token, this must be either refreshed
automatically every 30 seconds by scheduling execution in app or by 
requesting a new token.
"""
def get_access_token():
    INDUSTRY_API_URL = 'https://auth.uat.industryapps.net/auth/realms/IndustryApps/protocol/openid-connect/token'
    headers = {'content-type': 'application/x-www-form-urlencoded'}
    body = {
        "grant_type": "client_credentials",
        "client_id": "<<App ID>>",
        "client_secret": "<<App Secret Code>>"
    }
    token = requests.post(INDUSTRY_API_URL, data=body, headers=headers)
    token_response_data = token
    try:
        access_token = token_response_data['access_token']
        return access_token
    except:
        return token_response_data
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
// Javascript example using the Fetch API
const data = {  "grant_type": "client_credentials",
                "client_id": "<<App ID>>",
                "client_secret": "<<App Secret Code>>" 
              };
const INDUSTRY_API_URL = 'https://auth.uat.industryapps.net/auth/realms/IndustryApps/protocol/openid-connect/token'
fetch(INDUSTRY_API_URL, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/x-www-form-urlencoded',
  },
  body: data,
})
.then((response) => response.json())
.then((data) => {
  console.log('Success:', data);
})
.catch((error) => {
  console.error('Error:', error);
});
```

{% endtab %}
{% endtabs %}

As a reminder, the App ID and App Secret Code are available by navigating onto your app dashboard > App Information:

![Generate a client secret.](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FRjeRjgP9zRgpxFHs4gtU%2FScreenshot%202022-07-26%20at%2021.25.45.png?alt=media\&token=b647bea6-ddcf-42bf-b2bc-4df5fc68db33)

Note that the access token will not be available outside the demo customer portal or platform scope, resulting in an invalid token response while hosting the application externally.

Once the application has access to its app and user context token, integrating Masterdata or Transactional data from the platform to test and implement functionality is worked through calling the available endpoints.

{% tabs %}
{% tab title="Python" %}

```python
# Fetching AAS List from the platform.
def get_aas_list(asset_type, plantcode):
    # App Token Generation
    access_token = get_access_token()
    # Retrieving stored user context from temporary Redis Cache
    user_context = rs.get("user_information")
    extract_user = json.loads(user_context)
    user_token = extract_user["auth_token"]
    # Required Tokens for a successful response.
    headers = {
        "Authorization": 'Bearer ' + access_token,
        "UserToken": 'Bearer ' + user_token
    }
    # Set Asset Type & Plant Code in func params
    params = {
        "AssetType": asset_type, 
        "PlantCode": plantcode
    }
    try:
        res = requests.get(AAS_LIST_URL, headers=headers, params=params)
        return res
    except Exception as e:
        print(e)
```

{% endtab %}
{% endtabs %}

<img src="https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2F55ATourEeE1S3MCxWhcY%2F44114706-9c72dd08-9fd1-11e8-8d9d-6d9d651c75ad.png?alt=media&amp;token=d0ecefd8-af51-40a0-b8ca-2bb26ae3069d" alt="" data-size="line"> **Postman**

Platform context endpoints can be experienced by forking the [IndustryApps Postman collection](https://www.postman.com/industryappstech/workspace/industryapps-aas-gateway/overview). The app and user tokens should be added in the environment of the forked collection.

{% hint style="info" %}
**Local & Production deployment**

The application can be connected via the [pre-defined sidecar](/connect-to-the-platform/use-our-pre-built-sidecar), [Eureka endpoints](/connect-to-the-platform/integrate-using-eureka-rest-apis) and have the container image pushed onto the platform. Once the app has been onboarded, user experience can be tested via a demo customer portal as part of the Vendor registration process. You will receive a trial user id and password for the developer store and smart factory platform.
{% endhint %}


# FAQs | Troubleshooting

### General

<details>

<summary>Is it possible to receive an app token (using my App ID and App Secret Code) while in development locally or is it only possible after publishing?</summary>

It's only possible to test the app token after publishing your application via the demo customer portal or once it is deployed. Our dedicated team can provide credentials to the demo platform for this purpose. [Check Testing for further example.](https://app.gitbook.com/o/-MiQcAowPXIwgj66DR1x/s/B9A0mcoSLYn0wBpMICUd/~/changes/HVgrAxLSMPKyNJcp4PA8/developer-documentation/testing-your-application)

</details>

<details>

<summary>How do I test user tokens and permissions using the <code>platform-api.js</code> function <code>getPlatformContext</code>?</summary>

As mentioned in [Testing Your Application](/testing), you can use demo user context available to check functionality operates as intended. To test full features of your app our team can offer a demo instance to test before publishing.

</details>

<details>

<summary>I don't have a hostname yet for my app, but I want to test my applications functionality which is going to be hosted externally. What are my options?</summary>

There are a few common options available for free or an affordable rate:

* Ngrok offers proxy domains which can be mounted and connected to your application. [Check it out here.](https://ngrok.com/docs/getting-started)
* AWS offers a few options for such a case such as in [EC2 Instances](https://aws.amazon.com/ec2/) or [Lightsail](https://aws.amazon.com/lightsail/).

Once you've either uploaded your app to an AWS server or used Ngrok as a temporary hostname you can use as an example a Sidecar by following the [Sidecar guide](/connect-to-the-platform/use-our-pre-built-sidecar) to connect your app to your IndustryApps account.

</details>

<details>

<summary>We've completed our application and decided to connect our app via the pre-defined Sidecar. The registration indicated it has been successful with a <code>status code 204</code> however, we cannot see our application on the platform. What can be done?</summary>

This type of issue may be caused by various parameters to do with forwarding the application to the platform.

* Check and confirm the `HOSTNAME`, `IP`, `APPCODE` and status page url are reflecting the accurate details linked to your apps account if a Sidecar is being used to push the app to the platform. Examples to [pushing your application with Docker](/docker-information) are available for reference.
* Refer to: [https://servicediscovery.uat.industryapps.net/eureka/apps/\<your\_app\_code](https://servicediscovery.uat.industryapps.net/eureka/apps/<your_app_code)>\
  confirm the application status is stated as "UP". Additional information can be found [here](/onboarding-to-industryapps/onboard-application/publish-and-test/register-into-service-discovery).
* Confirm the app details are aligned with the available information in [Testing your Application](/testing).&#x20;

Please reach out to our dedicated team in case the available solutions do not solve the issue.

</details>

<details>

<summary>Receiving <code>platform-api.js</code> Error with <code>getPlatformContext()</code> method.</summary>

```
// An error while using the getPlatformContext() call in an app component
// or page.
SyntaxError: Unexpected token u in JSON at position 0
    at JSON.parse (<anonymous>)
    at getPlatformContext (platform-api.js:1:258)
```

If you are seeing an `Unexpected token`, generally it is caused while invoking `getPlatformContext()`, the method returned an `undefined` response resulting in the error above. Consider the following:

**App Hosted Externally**\
The application is hosted externally such as on Azure, AWS or Google Cloud, and is being used outside of the platform scope (either published and deployed or through the demo customer portal provided by our team for testing purposes). In which case, the user context will not be available outside of these environments. Please try again under one of these environments to confirm if this is the root cause for the issue.<br>

</details>

<details>

<summary>Can we integrate the IndustryApps Single Sign-on externally to our applications platform as a means of user login outside of the IndustryApps Platform?  </summary>

IndustryApps Aims to provide a complete solution to its users so that applications can be used interchangeably according to the users needs. A one stop solution for Industry 4.0. It is not possible to integrate Single Sign-on outside of the IndustryApps platform.&#x20;

The SSO function provides an alternative authentication and authorisation method for users to access applications restricted resources without the requirement for a secondary login and provide a sign on solution for users accessing the IndustryApps Appstore.

</details>

{% hint style="warning" %}
If the available troubleshooting techniques do not resolve the issue you are experiencing, reach out to our dedicated team via **<partnersupport@industryapps.net>.**
{% endhint %}


# Registration

Welcome to the IndustryApps developer guides. These documents teaches you how to onboard your solutions to IndustryApps framework and other libraries.

![4 Steps to make your products reach a global market](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FEaYAmFcQ9vjOGzRqcqGx%2FCompany%20signup%20-%20User%20training%20video%20\(1\).png?alt=media\&token=481f5daf-7c22-4828-8466-4f8120798dde)

## [Register for developer account  ](/onboarding-to-industryapps/register-developer-account)

## [Onboard your existing Application](/onboarding-to-industryapps/submit-basic-application-info)

## [Test and Simulate customer experience ](/onboarding-to-industryapps/onboard-application)

## [Set your pricing model and payment approach](/onboarding-to-industryapps/onboard-application/configure-application/pricing)

## [Publish App to IndustryApps Marketplace](/onboarding-to-industryapps/publish-to-marketplace)


# Application pre-requisites

Fit to Industry 4.0

This section provides details of basic requirements for Application to be on boarded on IndustryApps.&#x20;

### <mark style="color:orange;">**Technology fit:**</mark>  <a href="#id-1-1-keep-your-application-stateless" id="id-1-1-keep-your-application-stateless"></a>

The product should be cloud ready and following a scalable architecture - Target of IndustryApps is make your product accessible to global customer -  not with the classical approach of local consulting and premise deployments. Please refer to [basic requirements ](/onboarding-to-industryapps/application-pre-requisites/basic-requirements)for details&#x20;

### <mark style="color:orange;">Architecture & Security fit:</mark> <a href="#id-1-5-should-support-multitenancy" id="id-1-5-should-support-multitenancy"></a>

Our customers are Industrial manufacturers and leading companies. It is important to be transparent in terms of security and architectural components enabled in your solution. IndustryApps will be providing you with a basic questionnaire and performing some assessment to ensure your product fit.&#x20;

### <mark style="color:orange;">Business Model Fit:</mark>

IndustryApps target is to offer a mode where your solution can be deployed as plug & play at customer instance and all master data requirements are automatically loaded. The customer experience we want to offer is customer is able to use your solution as soon as they subscribe. The only exception will be if there are specific additional data requirements.

The platform allows your product to operate in a Plug and play method by offering you all the master data and transactional data over a standard API. But if your solution cannot be offered this way and require specific customization or local infrastructure then it may not be a possible fit.&#x20;

###


# Basic Requirements

Basic pre-requisites to Applications which can be onboarded on IndustryApps

### <mark style="color:green;">You application is stateless</mark> <a href="#id-1-1-keep-your-application-stateless" id="id-1-1-keep-your-application-stateless"></a>

It is explicit by saying that *web applications should be stateless*, as *web applications should be stateless unless there is a very good reason to have a state*. A *shopping cart* is a stateful feature by design and denying that is counterproductive. What our proposal is to make these state persevere on the client-side rather than at the server-side. If it is not possible, keep a shared resource for instances to store that data and retrieve. IndustryApps platform expects your application to be stateless, so we can increase and decrease the number of instances based on the load.

### <mark style="color:green;">Your application supports multitenancy</mark> <a href="#id-1-5-should-support-multitenancy" id="id-1-5-should-support-multitenancy"></a>

IndustryApps is a platform used by multiple clients called tenants. We must take care not to share the data of each tenant. ie if your application needs to store some data, you must be cautioned on tenants. Currently, tenant is a Key combination of companyId and plantId of each user.

{% hint style="info" %} <mark style="color:green;">IndustryApps focuses on Industrial solutions. Your product should be proven and already deployed in at least 1 reference factory site any where in the world. It is always a best practice to provide references to support customers decision.</mark>&#x20;
{% endhint %}

### &#x20;<a href="#id-1-2-keep-your-application-sync-with-application-registry" id="id-1-2-keep-your-application-sync-with-application-registry"></a>


# Register Developer Account

Step by step instructions for developer account registration in IndustryApps

{% hint style="warning" %}
5 minutes overall time of effort.
{% endhint %}

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <h4>Steps to register as a developer</h4>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2F1IRQNzcqfRxIdv2JE7q4%2Flog-in-solid-24.png?alt=media\&token=4596664d-f91f-41a3-8db3-b0753bb3ec65)[<mark style="color:green;">Visit the portal page for Login.</mark>](https://auth.uat.industryapps.net/auth/realms/IndustryApps/protocol/openid-connect/auth?response_type=code\&client_id=industryapps.accounts\&redirect_uri=https%3A%2F%2Faccounts.uat.industryapps.net%2Fsso%2Flogin\&state=100e68fe-2c3f-497e-82c0-fac5152c3a48\&login=true\&scope=openid) |
| ![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FGhgOiHwYUfv5UJFe0seg%2Fcheckbox-checked-regular-24.png?alt=media\&token=022a4e00-fed1-4f1f-aebf-eb68c0789888)<mark style="color:green;">Click on SignUp as a Vendor</mark>                                                                                                                                                                                                                                                                                       |
| ![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FcsRerTngiVJe4wWixBnR%2Fid-card-regular-24.png?alt=media\&token=06aa4541-7bb1-47ce-a5ce-4daed33bce04)<mark style="color:green;">Enter required information and Submit.</mark>                                                                                                                                                                                                                                                                                     |

&#x20;![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FlZ7LBGXom4U41Bgb51Al%2Fimage.png?alt=media\&token=cb3d3b68-0a7c-4565-b0fd-0369365cb8ed)

#### ![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2F2juNg06X88k7M5v8Dre4%2Fright-arrow-alt-regular-24.png?alt=media\&token=aba4c40b-9988-4cf8-a513-de45984ebacb)On a successful sign up

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FHBrkfJsIZG39DZQ9zri4%2Fimage.png?alt=media\&token=abdfb04e-4e03-4509-a114-776673aa19b2)

#### ![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2F2juNg06X88k7M5v8Dre4%2Fright-arrow-alt-regular-24.png?alt=media\&token=aba4c40b-9988-4cf8-a513-de45984ebacb)Confirm your Email address on the address provided during registration.

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FUXvRd3ZKKPyG5eZYirEc%2Fimage.png?alt=media\&token=6330d873-f17e-4ab5-a9b5-9ccc3b25f27e)

#### ![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2F2juNg06X88k7M5v8Dre4%2Fright-arrow-alt-regular-24.png?alt=media\&token=aba4c40b-9988-4cf8-a513-de45984ebacb)Enter a password for the account and Submit.

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2Fy0pLFX4wZwHCoZUrjKp0%2Fimage.png?alt=media\&token=0ef1fd86-b777-47a2-a37c-dc4ec15e2f77)

#### ![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2F2juNg06X88k7M5v8Dre4%2Fright-arrow-alt-regular-24.png?alt=media\&token=aba4c40b-9988-4cf8-a513-de45984ebacb)A Developer Registration completed notification will prompt.

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2F98kNwTP9uZgeQXIqv4jK%2Fimage.png?alt=media\&token=f1de4565-5367-47fb-821c-1ca81d83c33e)


# Submit basic application info

First level of review on application fit to Industrial market

{% hint style="warning" %}
10 minutes overall time of effort.
{% endhint %}

IndustryApps is focused on solutions for Industrial markets - This includes digitalization solutions for Factories, warehouses, transportation logistics etc across Industries.&#x20;

This is our first step of verification. The team will support you to categorize the solution to the right market segment. This is also important to ensure the Sales and marketing efforts for your products are focused on the right customer segments.&#x20;

### Submit basic details of your application

Step1: Go to [partner.uat.industryapps.net](https://partner.uat.industryapps.net/home)

Step 2: Click on Create New App

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2F6U0xMgDIpCOwP7X3vvCt%2Fimage.png?alt=media\&token=d9c80a90-df94-47bb-9c93-1946acc9fe18)

&#x20;Step 3: Fill in application Name, Category, Industry and other details, then click on Continue

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FG4AJJy38XFf6lpTRCLco%2Fimage.png?alt=media\&token=00db3b4e-3482-4cc9-8e41-ea20e48c31a8)

Step 4: Select What all information you need to access from the customer data as AAS

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FyOMLCMQ6IVBcdEjujaW4%2Fimage.png?alt=media\&token=da96a1ad-477c-46dc-bc11-11185f2eb205)

Step 4: Review all the entered information and Confirm

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FbDu60jTPQl7OcnTrl5Ag%2Fimage.png?alt=media\&token=e68212b2-09f6-440d-833c-b8839f9619d9)

Application list will be updated with the new application

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FAUzNXourAepMkDCN8ea3%2Fimage.png?alt=media\&token=a288ada4-18d8-49e4-bce0-eb383d7edfdf)

{% hint style="info" %}
New Application request will be validated by iApps Agent and Approve it from Back Office. After that application Status will be changed to Publish Pending
{% endhint %}

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FNo4pj3slxd5XCwGVKtWR%2Fimage.png?alt=media\&token=b2eb48af-51e9-4b9d-808c-9b3486fc8f84)


# Onboard Application

How to load your solution to  Industryapps Developer environment

The below segment explains all steps needed to onboard your application on cloud. We expect the application to meet the requirements as explained in section [pre-requisites](/onboarding-to-industryapps/application-pre-requisites)&#x20;

{% hint style="warning" %}
4 hours overall time of effort.

\* Average time - Changes based on application complexity and deployment mode.
{% endhint %}

![Simulate customer experience for your application](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FhdHudw0W10Q9wSwBGnnQ%2FAp%20submission%202.PNG?alt=media\&token=47e28778-647a-4186-b18e-389fb1221ed2)

{% hint style="info" %}

#### <mark style="color:green;">Once your company and Application details are verified you will see that</mark>&#x20;

#### <mark style="color:green;">an AppId and App secret code is assigned to you.</mark>&#x20;

{% endhint %}


# Submit Appstore details

Provide marketing details for your App

An Appstore is an effective way to market basic details about your application. Proving a very simple but clear list of benefits and features. Using images of your application or even a video link helps in giving customer a quick outlook of its capability.&#x20;

Concept is similar to Google play store or Apple Appstore. Its about giving quick short information for user to understand your product.

> ### "<mark style="color:yellow;">Provide good content</mark>, and you will earn the right to promote your product"&#x20;
>
> ### &#x20;                            - Guy Kawasaki&#x20;

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FcHhqisSzkUEaUB9fi6bI%2FActivity%20master.PNG?alt=media\&token=545d77e7-58c7-4a39-b3a4-8647821f2253)


# App basic information

Steps to follow to provide basic app informations

## Basic Information

Application code will be automatically generated.

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FHEvaeRoHK8ohkaNrw1j8%2Fimage.png?alt=media\&token=a8f9ac70-7857-4a43-92d1-1ecb2277d9f2)

## Maintain Graphics details for Apps

### App Icons

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FTyrqL7SfE789dnFVCQJ8%2Fimage.png?alt=media\&token=f0148744-3a33-41ba-816c-6c019d4eb184)

### Banner Image

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FkiDkzOJvJORD9zPdOKM4%2Fimage.png?alt=media\&token=2b4e412f-8632-4cc6-a14a-ca7327b48c32)

### Application Screen Shots

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FdIEFRE8UFyKiMNj4v7L0%2Fimage.png?alt=media\&token=bc131ab0-63c4-428c-ab10-171a23d2bf5d)

### Additional Details

This will be your app URL within IndustryApps.

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2Fa6xcaPNmWnW1C54vnMEU%2Fimage.png?alt=media\&token=f8712254-c597-430c-8159-f8cec5db17b5)


# Configure Application

How to publish your App and simulate customer experience

The diagram below shows the steps to be followed to configure your application in IndustryApps. Its similar to adding an App to Appstore except that you will need to collect all relevant data for your application and your application could be mounted on IndustryApps cloud reducing further your cost of sales.&#x20;

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FNmBcbe2MvwQiBZHk8lHD%2FApp%20config.PNG?alt=media\&token=1721e8d8-7e6d-45a8-8c94-8f0a3c06d533)

&#x20;Step1: Login to partner portal. Go to Applications and click on application

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FV1bmaqwsmlw78U22wFmN%2Fimage.png?alt=media\&token=cf7dc1ab-bf8c-4da2-8200-7215fd90e945)

Step 2: Click on the select App version line and go to further details

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FzQ5Xq8HpRaVa6Knn2Wn6%2Fimage.png?alt=media\&token=1c8298ed-a037-4e84-ab11-81a6f205aeec)

Follow step by step instructions and fill in the App Information. These data are basically needed for listing and metadata details for the app.&#x20;


# App Permission

Step to get data from IndustryApps OS

One of the critical challenge of Industrial solution deployment is Masterdata and integration with underlying systems ( IT or OT ). This is one of the top reason for high deployment cost for Industrial solutions. Industryapps solves this challenge in a unique approach based on Industrial Operating system.&#x20;

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FlNfCkasr5ZPB6lwADuBC%2FSmart%20Factory%20Machine%20data%20Layer%20-%20Vertellus%20\(9\).png?alt=media\&token=08a52baa-4391-449e-aace-bdb5275ee139)

As a developer you get all data from customer environment like Factory, Machines, Users, Products etc in a standardized form. This makes it possible for you to make your product plug and play.&#x20;

{% hint style="success" %}
This step will solve the challenge of integrating with customer's local IT/OT landscape. Data access is standardized using interoperable standards of [AAS. ](/common-faq/what-is-an-asset-administration-shell)
{% endhint %}

## Request basic data:&#x20;

Under App permission section you have option to request information which is critical for your application. This could include Site ( Plant ) information, User information, Machine information, Tool information, Product information etc. Simply select information which is relevant for your solution. The data is provided as an Asset Administration shell ( which is a digital twin representation of an asset).&#x20;

![AAS permissions tab](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2Fu3q8Nrpl1RgFAve2tFT3%2Fimage.png?alt=media\&token=9ae0cdb2-fb77-4e90-9727-316708cb3280)

Under an [Asset administration shell ](/common-faq/what-is-an-asset-administration-shell)information are divided into data blocks called SubModels. You could request blocks which is only relevant for you. For eg: Lets say you have an application for Maintenance now you may only require basic machine information like name, description or production line details or even 3D models or images of machines. Then you only need to request two blocks which are BASIC and DOCUMENTATION. All these details are available under this block which will be shared to you.&#x20;

{% hint style="info" %}
For Application onboarding a Demo instance with data will be offered to you to test and simulate your solution
{% endhint %}

![Drill down Product](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FJY0clMbDAoGAujl4jobg%2Fimage.png?alt=media\&token=e466b803-d07b-4d4a-8c7e-e9c475c3e7f9)

You could drill down each Submodel block to see exact information which is available under each section. This data block and structure are standardized across companies and follow the standard SubModel structure as defined in the Industry 4.0 standards.&#x20;

![Drill down name plate](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FTVI9Z4ypjVzt3AKvUykS%2Fimage.png?alt=media\&token=83434f37-a179-4aec-8b1f-4e32519dddd4)

{% hint style="warning" %}
The real benefit for customers is a central flexible Masterdata layer. Load data once and then utilize any solutions from IndustryApps store with out creating new interfaces or duplicating data.&#x20;
{% endhint %}

[![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FF79t2Df0y0EjOPuTRoRl%2Fdata-solid-24%20\(1\).png?alt=media\&token=190b85e4-af7f-43de-8df8-6129a5292248)Access Masterdata endpoints](/apis-or-data-integration/how-to-access-masterdata)

[![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FFInInkJQiJ5VS3ZJlXSj%2Ftransfer-alt-regular-24.png?alt=media\&token=c0a95609-d9eb-460a-83ed-38381d97dbf2)Access Transactional data endpoints](/apis-or-data-integration/how-to-access-transactional-data)


# App Data

Step to test and simulate customer experience

If you already have a solution which is offered on a SaaS model to customers, then you can simulate and test your solution experience under IndustryApps in few simple steps.

{% hint style="info" %}
Onboarding your solution to IndustryApps does not require rebuilding or remodelling your solution. The only adaptation you do is to allow plug and play deployment.&#x20;
{% endhint %}

Our focus is to enable you market your solution to global companies and help them deploy just like subscribing an App from any Appstore.&#x20;

### Hosting by a public URL (Used for Testing Application)

To deploy app from public URL repository has to be selected “Public” and Release Tag should be selected "None".

{% hint style="info" %}
App's base url and asset context should be set as&#x20;

<mark style="color:orange;">https\://\<your\_domain>/<\<Application Code>>/</mark>

Refer [App Information page ](/onboarding-to-industryapps/onboard-application/submit-appstore-details/app-basic-information)to get Application Code
{% endhint %}

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FaLVNRwC8dC6emkahjsce%2Fimage.png?alt=media\&token=12a01fa3-8862-4bad-a2f3-9294cc3e534a)


# AAS Instance

How to share information back to Digital twin.

Interoperability is a critical feature of Industry 4.0. Assets in Industry 4.0 should be able to share information along both horizontal and vertical value chain with no limitations over technology frameworks or protocols or evolving standards.&#x20;

IndustryApps enables this feature by simply ensuring every application is able to not just read data from a digital twin but able to share information back to Digital twin. This section explains how you can inject your own SubModel back into as Asset.&#x20;

{% hint style="info" %}
Every Application in IndustryApps has ability to share information back to its Digital Twin. This allow solutions to interoperate and deliver additional value to our customers.&#x20;
{% endhint %}

![Sharing information back to Digital Twin. ](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FEBxVsp6UU7OpM6d46fsa%2FAAS3.PNG?alt=media\&token=5217f287-cb37-4731-883e-139d667cd105)

## Adding your own Digital Twin Model

Here you can publish and add your own Digital Twin. This is relevant if your solution works with a specific hardware like an IoT sensor or a specific gateway. You can build Digital twin of your asset and ship them to your customers to also have a simple plug and play experience.&#x20;

{% hint style="warning" %}
This section if only relevant for solutions with dependency on specific Hardware assets like IoT. For all others please see Submodel instances
{% endhint %}

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FKxJi4axDKFsxEevxKWhG%2Fimage.png?alt=media\&token=8f278013-6e42-4dd4-8d5b-ce78e3b467dc)

## Adding a Submodel Instance

This is where you add your own Sub model instance to existing Asset. APIs documentations on how to inject an AAS is provided under the Developer documentation section. Delivering data back to Digital twin would allow other applications to react to changes.&#x20;

For eg: Lets assume you have an OEE application that measure machine state and productivity in real time. if you publish the result back to Digital twin, then another solution which offers say Maintenance or Production scheduling can offer alerts and notifications to customers or even specific functionalities to make it the solutions inclusive.&#x20;

![Adding your AAS instance](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FSBimFRBNMm1zV4neUb8B%2Fimage.png?alt=media\&token=598e5b29-244a-4621-840c-695baab6d062)


# Licensing

Documentations for your solutions - Terms and conditions / Licensing

Here you can load your Terms of use document which would be accessible to customer over the store. All customers in IndustryApps have standard Terms of use agreed which you can refer to [here](/common-faq/customer-terms-of-use).&#x20;

You only need to provide additional details if there are conditions which are not covered in the standard ToU.&#x20;

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FERfpir23TFuhbImVH3gq%2Fimage.png?alt=media\&token=877d88da-f6ea-43ed-b206-241ff43e0bd5)


# Access Rights

Access rights in your application

> <mark style="color:orange;">"Shop floor requires multiple systems along the value chain. The most painful part is each system required different user management, role and access management."</mark>&#x20;
>
> * <mark style="color:orange;">Plant IT head</mark>

Role based access control is centrally managed in IndustryApps. This is to avoid customer having to manage various users and roles under each solution they subscribe to. Also this allows solution providers to not spend effort on creating complex user access management views.&#x20;

Here you can provide what access roles you have covered in your solution ( Create, Edit, View, Delete...) Now these can be mapped here which customer can later assign to relevant users or roles which they have maintained centrally.&#x20;

At least one access right should be enabled!

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FTJkqeVnFlNgG9cH9Z7Gi%2Fimage.png?alt=media\&token=6ca3aaa7-04e4-47be-b405-2821fce6590d)

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FgBTtLCJ2DnsL8BD4felA%2Fimage.png?alt=media\&token=7c70eda3-b793-46f9-befd-6af163a03cfb)

Click on Add Module

<div align="left"><img src="https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2Fanb8OF1Zf2Oo3dklrHCb%2Fimage.png?alt=media&amp;token=f6a2fae9-703e-4571-9606-9b4b2e5e203e" alt=""></div>


# Account Info

Payment Account details

Here you can select the account ( which you have maintained under your profile section) to where payments should be made when a customer subscribes your solution. You can add multiple accounts for each countries and request payment based on location of customer.&#x20;

{% hint style="success" %}
IndustryApps payment will follow the agreed App pricing in the submission form signed between IndustryApps and you as part of Production activation.&#x20;
{% endhint %}

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FKMeZgRlt5Xo5244nLl6O%2Fimage.png?alt=media\&token=4e97f86d-f72b-49af-b6cc-fc981d80e32d)


# Terms Of Use

Summary of ToU

Its important to provide basic details in terms of SLA and Consulting / Support rates to your customers. This information will be visible to the customer if they require any additional support from you. Target is to make this process transparent and clear. No additional negotiations.

IndustryApps will be centrally managing support and SLA.&#x20;

A monthly support performance document will be send to customers with details of number of tickets raised and if SLAs were met. Support is critical component for Industrial solutions, <mark style="color:green;">your support performance is a critical factor for sales growth.</mark>&#x20;

{% hint style="info" %}
Contact details are mandatory - Please ensure there a min of two contact person information.&#x20;
{% endhint %}

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FKILY9S10qygPlbhzv4Oa%2Fimage.png?alt=media\&token=02c10f9b-3406-42ba-9e0a-e2f02b5f9a41)


# Pricing

Pricing details

Freemium / Trial Mode

We do not recommend free Apps. We are dealing with Industrial companies and there is no advertisement revenue or data sharing allowed. Your product is serving a business and your revenue will be purely driven by the subscription model.&#x20;

You are welcome though to offer Trial periods or limited Freemium to ensure customers have opportunity to test and pilot the solutions. Again its your decision and your strategy. &#x20;

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2F2hg3NBD9WFOsS8RK5pbk%2Fimage.png?alt=media\&token=d4ef47ac-63be-495d-aeba-51432936a53f)

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FCzqH93SbSrYEPtoaCptB%2Fimage.png?alt=media\&token=55583442-80f3-4181-9e2c-7645c7c4efcf)

After maintaining all required configuration. Application will be able to Publish

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FROq2yj01Dl6NAEkrriGj%2Fimage.png?alt=media\&token=3296a447-11ab-4932-81e4-8d036705b4bd)

After publish the app will appear in the Store – [https://store.uat.industryapps.net](https://store.uat.industryapps.net/home)


# Publish and test


# Deploy

Publishing your app to developer environment

## Hosting by a public URL

This is the recommended approach if your solution demands special hardware configurations and significant setup efforts. Typical example could be a Platform based solution or Machine learning / AI solutions. Here we will be passing the control to your environment and you need to provide your terms of use and SLA during the App onboarding process.&#x20;

{% hint style="info" %}
If your product has special hardware requirement or significant setup efforts
{% endhint %}

Repository has to be selected “Public” for testing your locally hosted app and release tag to be set “None”

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FpY7d6djyfB3Wtp9aErrL%2Fimage.png?alt=media\&token=3107a3bb-eea5-406f-9ca8-0f0625bf6d43)

###


# Register into Service Discovery

Service discovery

IndustryApps use Netflix Eureka as the service discovery system

## Option 1: Eureka Rest Operations

You can use Eureka REST operations as given here <https://github.com/Netflix/eureka/wiki/Eureka-REST-operations> in your app

Please go through "[Keep your application sync with application registry](/connect-to-the-platform)"

## Option 2: Pre-built side car

You can download a pre-built side car from below

{% file src="/files/JkkRRLZDrt0Qj3SIECEQ" %}

```
java -jar discoveryClientSideCar-1.0.0.jar --appCode=<<Application Code>> --statusPageUrl=https://484c-14-142-179-182.ngrok.io/ --hostname=484c-14-142-179-182.ngrok.io
```

appCode is your App Code as we noted previously

&#x20;statusPageUrl is your app’s landing page URL / URL for status check&#x20;

Hostname is your hostname running your app

Please refer below screenshots for executing sidecar

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2Ft2AzKrZtUSqqQrsUV9Uq%2Fimage.png?alt=media\&token=9b001684-ebc3-452c-8936-0f951f458240)

After register using sidecar you will be getting  registration status as 204

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FiiDmgtk75lbN1wN0L7Cs%2Fimage.png?alt=media\&token=6ba58ddd-ee76-4802-b710-c900c7e4e300)

After service registry IndustryApp platform can show new app inside Platform

You can check the status of your app using the following URL [https://servicediscovery.uat.industryapps.net/eureka/apps/\<your\_app\_code](https://servicediscovery.uat.industryapps.net/eureka/apps/<your_app_code)>

Check Status is "UP"

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2F1j9B3IszisNCa8zvSfbc%2Fimage.png?alt=media\&token=962f089a-ca07-4cd3-bd4f-40a60b580766)


# Publish to Marketplace

Make your product reach a global audience - Proactively support your customers

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FFjs4Jl8Bk72R3BZ6pNhl%2FCompany%20signup%20-%20User%20training%20video%20\(3\).png?alt=media\&token=a5de3478-f559-4d46-b8d7-ceaaf7fce0c9)

{% hint style="warning" %}
Overall effort - 2 hours
{% endhint %}

You have completed the onboarding process tested your solution and you are now ready to move your application to production instance.&#x20;

The production environment is <https://partner.industryapps.net>. All basic details about your application will be moved to this environment. If you want to modify or update them it is possible. Remember what you submit here will be seen globally by customers.&#x20;

For information about production deployment:

{% content-ref url="/pages/qIz8YdvpMazqPMcqNDA7" %}
[Production deployment](/connect-to-the-platform/production-deployment)
{% endcontent-ref %}


# User Experience

The users on IndustryApps choose applications according to primary apps or Add-on apps categories, each application chooses its type during app onboarding. There are various pricing options available such as fixed cost / Factory based, Dynamic cost / factory based on users or number of machines with subscriptions. &#x20;

Once the user will be notified of the required data permissions for utilising the application. The applications which the user has added onto their accounts are organised into categories and sub-categories.&#x20;

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2Fbx9fF0Rs2YHaOmxBdnYq%2Fplatform-view.png?alt=media\&token=e6d82901-44f7-486d-a910-41be0aacac01)

According to each sub-category the user will see the registered applications with their dedicated account.

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2F1ogLz3tUSwlQTzhMmUgG%2Fapp-choice-window.png?alt=media\&token=8088b147-da5f-4906-a8fa-ab82fc485af6)

### User Instance events steps

The following sequence of events should be taken into account for application development on IndustryApps. Depending on the users instance state with the designated application, different designation takes place for each user. In this case, an Instance is referring to unique data belonging to each user such as:

* Users name (i.e `euser`).
* Factory selected.
* Language selected.
* Company code.
* Role permissions.

{% hint style="info" %}
Additional information about user context as described above [can be found in Authentication](/authentication/accessing-data-exposed-by-the-platform).
{% endhint %}

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2F9LOV9Q88i8re0ndCXOZ2%2FUX-4-IAS.png?alt=media\&token=4e026e44-45be-49b8-b457-5204d245a98c)

### Allow access through Single Sign-on

If your application has Single Sign-on (SSO) enabled, restricted resources in the application will be available without requiring a secondary login by the user. The required JWT would be forwarded to the right locations so that the user would have a seamless interaction with the platform, loading their instance on the platform as shown below.

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FnYb99lWPynCmz3uVSHOE%2Fsso-sample.png?alt=media\&token=79e12c39-994b-4637-be57-57dc9bdb05b6)

### Utilising User Data

Once the user instance has been loaded either through an existing instance or by generating a new instance, the application can utilise the data accordingly and present functionality as appropriate.

![Example of a loading Machine data for a maintenance application in instance](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2F7F24ZAPZiTFUbvuC6fBW%2Fdata-usage.png?alt=media\&token=de3563e0-4383-4ff2-95b4-d416da17ff99)

{% hint style="info" %}
Additional information about utilising API data through the platform [can be found in API Data Integration](/apis-or-data-integration).
{% endhint %}

### User Roles

Vendors can define user roles for each application, with permissions set for each role (described as a module) with a dedicated description. See the example below for a visual representation:

<figure><img src="https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FgrijaMPdvJ9fQoRsiRYC%2FScreenshot%202022-09-12%20at%2019.41.00.png?alt=media&amp;token=067d6e1b-ada8-42df-9aa6-85eebcc5117c" alt=""><figcaption><p>Applications > {App Name} > Access Rights</p></figcaption></figure>

Once user role permissions have been defined, the administrator on the users account can dedicate a role for each of their accounts. The user navigates to their administration panel to dictate roles accordingly.

<figure><img src="https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FmiY4ONluTUm6ZRPWe2Gf%2FScreenshot%202022-09-12%20at%2019.57.42.png?alt=media&amp;token=0434b194-a22e-4ced-838b-1e3d76cbe5c8" alt=""><figcaption><p>Administration > Admin > Group Master > Add/Edit Group</p></figcaption></figure>

<figure><img src="https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FTiEApMYF1pRWnSBTP9TE%2FScreenshot%202022-09-12%20at%2019.57.55.png?alt=media&amp;token=467d43a8-f715-4f52-91b0-8b3359120c18" alt=""><figcaption></figcaption></figure>


# The business model - How do I get paid?

Payment mode

{% hint style="info" %}
IndustryApps will take a commission for the Platform layer and will be included in the customer cost&#x20;
{% endhint %}

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2Fy2a8mwKhLA7TDtAa1IiV%2FInvestor%20week%2012%201.2%20\(3\).png?alt=media\&token=68658c00-601b-472e-bf8d-5bacbeee2fa4)


# References


# IndustryApps - Intro

IndustryApps - World's first marketplace for Industry 4.0 solutions. Expose your products to a global customer base.

### <mark style="color:green;">A US$23 trillion global industrial market is going DIGITAL</mark>                                     &#x20;

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FiGd64jhQPtISBM3MBWPt%2FIndustrial%20technology.PNG?alt=media\&token=cf22f9a3-d0e9-461f-87c5-0111c0b181e9)

AppStore's and digital Marketplaces have revolutionized how consumers use technology. With nearly 90% of the global population using smart devices it has pushed the boundaries of Innovations. A staggering growth has changed the way we live, how we interact, and how we consume.

The Manufacturing Industry on the other hand - a 400 year old sector - has made limited progress in digital adoption. More than 70% of global manufacturing companies still follow paper based manual processes. The digitalization journey was focussing heavily on engineering automation and though, it brought significant improvements to high value, high volume manufacturing like the Automotive or Electronics Industry, it did not add significant benefits for the majority of Industries.

<mark style="color:green;">IndustryApps was founded with the vision to drive the successful digital transformation of the B2C consumer space into the B2B Industrial world</mark>. And with our revolutionary IndustryApps approach, we are realizing this Vision. Our open AppStore with digital innovations from our solution partners and our unique Ecosystem makes digitalization almost as simple as downloading an App for your smartphone, while fulfilling Industrial needs for data sovereignty, data ownership, data security and Industrial standard adherence.

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FHACqUPv9GP5sTd3FJGEA%2FIndustryApps%20Pitch%20V10.0.png?alt=media\&token=696ff459-f40b-46ef-9a50-27d05d92fd98)

### <mark style="color:orange;">The Industrial Tech market is expected to grow to US$ 23 Trillion by 2026</mark>&#x20;

{% hint style="success" %}
Digitalization is a key priority for 8 out of 10 Industrial companies
{% endhint %}

{% embed url="<https://youtu.be/HgHo_bKWnuM>" %}

### <mark style="color:green;">New entrants and established players both are entering the space with new solutions and technologies</mark>

A wide range of companies are offering digital solutions for industrial applications across the value chain. From the digitalization of traditional solutions like MES, OEE, work instructions, maintenance, material flow, Lean Management to IoT, Machine learning, Predictive maintenance, Predictive quality or Bots, the diversity of innovative solutions and technologies is growing rapidly.&#x20;

![1000s of new entrants targeting Industry 4.0 space - Industrial tech investment in Europe grown 8X times to 1.8$ Billion by 2020](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FSVAQr6gmvGqojDUEXo1w%2FI4.0-Vendor-Landscape-v4.5.jpg?alt=media\&token=e787b30c-2d13-40a7-84b6-14e915f3f9fe)

### <mark style="color:green;">Common challenges faced by all</mark>

**Commercial Challenges:**

* Cost driven decision making – minimizing the bottom-line impact
* Fear of wrong decision – the market is very dynamic and intransparent
* Long sales cycle time - typically 4-12 months or more
* Complex sales process, multiple departments involved (IT, Operations, Finance, Purchasing)

**Deployment and Adoption Challenges**

* Multiple stages before decision making – Proof of Concept, Pilot for scaled projects
* Long deployment cycle - Changing customer demands, User adoption rate, Training efforts
* High cost of winning customer - Infrastructure, resource investments, configuration modifications

**Infrastructure & Support Challenges**

* Legal Barriers for Cloud & Hosting, Local entities required
* Local language adaptations, local office support, 24/7 support requirements
* Cross border services and invoicing is complex

{% hint style="info" %}
87% of companies struggle to grow beyond 10M$ in Annual revenue.                                  Key reason - The cost of scaling beyond your local country or region is very high.&#x20;
{% endhint %}

### <mark style="color:green;">What if we can cover you from these challenges</mark>

<mark style="color:orange;">and MORE..</mark>.&#x20;

With our revolutionary open AppStore approach and with our Platform and Infrastructure, we are here to help drive your global reach and business success. With our AppStore, we act as an additional distribution channel and we are responsible for the infrastructure and initial support. Your IP is fully protected through the Solution Partner Terms. We help you to gain global reach, without the risks and challenges involved:

<mark style="color:orange;">**No additional cost for you:**</mark>

* Sales – We give your solutions additional exposure and global reach through our AppStore and our fast-growing global business network. <mark style="color:green;">**We reduce your Sales and marketing cost**</mark>
* Infrastructure - <mark style="color:green;">**We reduce the Cloud and infrastructure cost**</mark>
* Deployment – We work together on a Plug and play deployment of your solutions.&#x20;

  <mark style="color:green;">**We reduce your deployment cost**</mark>
* Local support - We provide initial support and local language support

  <mark style="color:green;">**We reduce your support cost**</mark>
* Trials – We provide a testing environment for trials or Proof of Concept

  <mark style="color:green;">**We reduce your Trial and PoC cost**</mark>
* Finance – We follow up with the customers, you receive your subscription licence cost from us independent from our customer receivables.

  <mark style="color:green;">**We reduce your Finance cost**</mark>
* Reporting – full transparency on your global customer subscriptions and income&#x20;

<mark style="color:orange;">**Additional Support for you:**</mark>

* <mark style="color:green;">Business experts</mark> – feedback from Industry experts on additional opportunities
* <mark style="color:green;">Language adaptation</mark> – we can help with local language adaptations and customer support
* <mark style="color:green;">Investment</mark> – Additional Exposure to VCs through transparent reporting on your business growth and reach

<mark style="color:orange;">**Your consulting income:**</mark>&#x20;

* If your software requires consulting, that’s your income. You may invoice the customer directly or in some cases, a customer may request invoicing through us (one-stop-shop)
* If you need help with local partners or hardware, we are happy to help (these efforts are charged by us directly to the customer)

**Additional Questions? Reach out to us!**

> *<mark style="color:blue;">"With IndustryApps we today have access to customers in China, Australia and South east Asia.   being a Europe based start up it would have been almost impossible - Best part we already won customers in these countries"</mark>*
>
> <mark style="color:blue;">**Aleksander Niemczyk, CEO - Ruby Logic EU**</mark>

{% hint style="success" %} <mark style="color:green;">IndustryApps is an effective additional sales channel for your business. While you focus on creating innovative solutions, we focus on giving you a global market reach</mark>
{% endhint %}


# What is an Asset Administration Shell?

The Digital twin standard for Industry 4.0

{% embed url="<https://www.arcweb.com/blog/concepts-applications-i40-asset-administration-shell>" %}

![Asset Administration shell and communication mode](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FwG2BaNmSCWwmJPcWC4Ee%2FAAS2.PNG?alt=media\&token=ccb48aa7-b697-41c6-9d2f-85dbf794c3ea)

The Asset Administration Shell (AAS), a key concept of Industry 4.0 and is used to describe an asset electronically in a standardized manner (see also the layers paragraph). Its purpose is to exchange asset-related data among industrial assets and between assets and production orchestration systems or engineering tools. In summary the administration shell:

* integrates the asset into Industrie 4.0 communication (e.g. virtual representation of physical object)
* is addressable in the network and identifies the asset unambiguously (e.g. product is now integrated part of information process)
* provides a controlled access to all information of the asset (e.g. layers)
* is the standardized and secure communication interface
* can integrate intelligent and also non-intelligent („passive“) assets (without a communication interface), e.g. via bar codes or QR codes
* represents the entire life cycle of products, devices, machines and plants.

(from the Platform Industry 4.0 Details of the Asset Administration Shell, from idea to implementation report)

This means that apart from describing an asset in a standardized way, it can also communicate in an I4.0 compliant manner by using a standard for communication (need for standardization is important). With all parties involved having access to the connected world and all information is defined in a harmonized way (same language), information can be shared in the value chain where the asset can be followed during its life cycle.

{% hint style="info" %}
IndustryApps follows all prescribed standards for Digital twins and Semantics&#x20;

Click here for [<mark style="color:orange;">Details of Asset administration shell</mark>](https://www.plattform-i40.de/IP/Redaktion/EN/Downloads/Publikation/vws-in-detail-presentation.pdf?__blob=publicationFile\&v=12)&#x20;
{% endhint %}


# What is ECLASS?

.Semantic standard recommended as Industry 4.0 standard

{% hint style="warning" %} <mark style="color:orange;">IndustryApps uses Eclass to ensure semantic interoperability between Industrial solutions.</mark> <mark style="color:orange;">All Apps in IndustryApps get ability to interpret an Digital Twin using this semantic standard</mark>
{% endhint %}

ECLASS is **an international, widely used data standard for the classification of products and services**. It enables product master data to be exchanged digitally across all borders - across industries, countries, languages, and organizations.

ECLASS promotes international interoperability of data exchange in the supply network with a cross-industry product classification systems and standardized interfaces

{% hint style="success" %}
**ECLASS has established itself internationally as the only ISO/IEC-compliant industry standard, and is thus the worldwide reference-data standard for the classification and unambiguous description of products and services.**&#x20;
{% endhint %}

{% embed url="<https://www.youtube.com/watch?v=LsQGcaKo5xo>" %}
Eclass video&#x20;
{% endembed %}

{% embed url="<https://eclass.eu/en/eclass-standard/introduction>" %}

{% embed url="<https://eclass.eu/en/application/best-practice#c172>" %}


# How is ECLASS and Concept dictionary are used

Ensuring Semantic interoperability

There are 100s of solutions that allows an asset to be represented as a Digital twin. Also there are multiple standards and protocols that streams the data to an application. The biggest challenge is that it only solves the problem of data transmission and storage but not the context.&#x20;

<mark style="color:red;">**Context is always hidden with in the application which makes them non interoperable**</mark>

Lets take an example of a defining a property like  **IP Code**, or **Ingress Protection Code** for an asset. Now every application will get this get this data and will store it under its own field name and provide its own description. Now this is all great as long as information needs to be accessed on with in the solution context. But business requires information to shared along the value chain. To customer to vendors or even other solutions.&#x20;

This is where Eclass or concept dictionary plays a role. Instead of defining them under the solutions own structure they are mapped as properties in AAS and then mapped to a unique identifier ( IRDI / URI ) this is a global standard and open semantic dictionary which allows anyone to get the clear context of this information. So now your asset ( Digital twin) becomes a Industry 4.0 compliant asset which is interoperable.&#x20;

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FVkGsvAjSKs1gznjejTmB%2FAAS%20Eclass.PNG?alt=media\&token=332a4f88-84d9-48b0-a3d1-89fd29cd662d)

Another key benefit is multi language support - Eclass offers the definition in all leading languages like English, Chinese, German, Frech, Korean etc which makes it easy for global interpretation of your information.&#x20;

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FsqAJ7sCHVz8o1ZdzkHqz%2FCompany%20signup%20-%20User%20training%20video%20\(2\).png?alt=media\&token=f4e5c41a-7a19-47f0-8edf-64959046edc6)


# Industry 4.0 standards

Standards proposed by Platform Industrie 4.0

![Integrated standards considered under IndustryApps platform architecture](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FlDd0bU6g2ZcM5EZYyQhf%2FIndustryApps%20Pitch%201205.png?alt=media\&token=6bce4287-a23d-45a1-b525-f1b6fcd81572)

{% hint style="info" %}
Though initiated by Germany, these standards are globally accepted by all leading manufacturing nations. &#x20;
{% endhint %}

![](https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FtTn2rDpJEkYLHEZiWAMv%2FIndustryApps%20Verions%204.0.png?alt=media\&token=c88a5cce-7fda-4d71-be36-f83eac936791)


# Customer Terms of Use

Terms of use to be accepted by customer for using the platform

Terms of Use  - ENGLISH

{% file src="/files/YHGXpII7lHHLuMPFXGgB" %}

Terms of Use - GERMAN

{% file src="/files/rQ4FOpd1pAjVkFYeJpS9" %}


# Subscription Order

Customer subscription order

{% hint style="info" %}
This is a template contract which customer signs for every App they subscribe from IndustryApps store
{% endhint %}

Subscription Order - English

{% file src="/files/R9g3NcTvn17enozy8tMy" %}

Subscription order - German

{% file src="/files/eTeeZl6YjE5BG1HTJdTQ" %}


# Solution provider Terms of Use

Terms and conditions

The document provides the details of Terms and conditions to be agreed by the Solution provider for onboarding your solution to IndustryApps.&#x20;

{% file src="/files/9DYDZ4LdxSHLOAGD5pMr" %}


# Contract regions

Regional scope

Solution providers and customers from following Markets are considered by Industryapps currently.&#x20;

{% file src="/files/SANnlyx276mQiujdU5Vj" %}


# Submission Form ( Solution provider)

Submission form - Template

This is a template of the Submission form which will be signed by IndustryApps and yourself before publishing the solution to IndustryApps store. The payment will follow the agreed pricing as per this submission form.&#x20;

{% file src="/files/lDtqA36duSGUxY82nyig" %}


