# Sample Use Cases for App Runtime API

REST APIs enable applications to break complex transactions into **smaller, reusable operations**, where each API endpoint handles a specific part of the transaction.\
This modular approach provides a high degree of flexibility for integration, but it can also make system design more complex if starting from scratch.

The **App Runtime REST API** in ONEWEB addresses this by exposing **App Designer entities** as ready‑to‑use REST services.\
These services are commonly consumed by **Mobile Applications** and **Custom Applications**.

Currently, two primary use‑case categories are supported:

* Mobile Application integration
* Custom Application integration

***

### Mobile Application Integration

A **Mobile Application** is an application that communicates with a backend server over the internet using **REST APIs**.\
In this scenario, the ONEWEB App Runtime acts as the backend service provider, exposing entity data and operations through REST endpoints.

***

#### Example: Mobile App Login

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FsqVFbHFeDEINe5RqwVKN%2Fimage.png?alt=media&#x26;token=2ed802d2-4673-4ae1-92dc-291d8f70234c" alt=""><figcaption></figcaption></figure>

In a typical **mobile login scenario**, the mobile app interacts with the server exclusively through REST APIs provided by the App Runtime.

Common actions include:

* Entering username and password
* Logging in under various conditions
* Forgot password requests
* “Remind me later” actions

Each of these actions is implemented as:

* A REST request from the mobile app
* Handled by App Runtime APIs
* With responses returned in JSON format

This allows mobile apps to remain lightweight while delegating all data validation and persistence to the server.

***

#### Why App Runtime API Fits Mobile Apps

* Stateless REST communication
* JSON‑based request/response
* Secure authentication via `/login`
* Clear separation between UI and backend logic
* Scalable backend for multiple mobile clients

***

### Custom Application Integration

A **Custom Application** refers to a non‑ONEWEB application (web, desktop, or third‑party system) that communicates with the ONEWEB App Runtime using REST APIs.

In this model:

* ONEWEB serves as the **data and business backend**
* The Custom App acts as the **consumer UI or orchestration layer**

***

#### Example: Work Order Management System

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FtRTOIhXWesJhR94SETFt%2Fimage.png?alt=media&#x26;token=8ff3ad84-2df4-4404-8805-d0e41f8e8a19" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FN2JrC5rK2WfM9MIDR0Pg%2Fimage.png?alt=media&#x26;token=a3a600d1-8586-4057-9093-6fcf672ed3f3" alt=""><figcaption></figcaption></figure>

In a **Work Order** use case, a Custom App communicates with the ONEWEB backend to manage operational data.

Typical actions include:

* Create order items
* Search contacts
* View work orders
* Calculate order totals
* Update order status

Each action:

* Is initiated by the user from the Custom App
* Translated into REST API calls
* Processed by the App Runtime
* Result returned in JSON format

***

#### Why App Runtime API Fits Custom Apps

* CRUD access to App Designer entities
* Support for parent–child entity structures
* File upload and download support
* Clean REST contract for third‑party systems
* No dependency on ONEWEB UI components

***

### Integration Pattern Overview

Both Mobile App and Custom App use cases follow the same pattern:

1. Client application sends REST request
2. App Runtime authenticates the request
3. Entity data is accessed or modified
4. Response is returned in JSON

This unified approach ensures consistency across different client types.

***

### Summary

The **App Runtime REST API** enables a wide range of integration scenarios by exposing App Designer entities as REST services.

Typical use cases include:

* **Mobile Applications**
  * Login, profile, and transactional operations
* **Custom Applications**
  * Workflows such as work orders, master data management, and integrations

By using App Runtime APIs, ONEWEB applications can act as **central backend systems**, serving multiple client applications through a standardized REST interface.


---

# 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.onewebstack.com/building-apps/integrations/app-runtime-rest-api/sample-use-cases-for-app-runtime-api.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.
