# APIs | Data Integration

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

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 %}

####


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.industryapps.net/apis-or-data-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
