# REST Service

All the flows published to the runtime can be executed as a REST service.

The available service list can be retrieved at this URL and the list is displayed in swagger UI.

### REST UI

[http://Ism-Install-Host:18080/rest](http://ism-install-host:18080/rest)

&#x20;

<figure><img src="https://support.xnarum.com/download/manuals/ISM-Manual-2023.fld/image334.png" alt=""><figcaption></figcaption></figure>

&#x20;

The request and response format of each service can be viewed like this.

<figure><img src="https://support.xnarum.com/download/manuals/ISM-Manual-2023.fld/image335.png" alt=""><figcaption></figcaption></figure>

&#x20;

### Authentication

Each service can be tested in this UI. The authentication is required to test the services. All the requests should contain API key in the http header, and this key is from [API Key(REST)](https://support.xnarum.com/download/manual.php#_API_Key\(REST\)).

<figure><img src="https://support.xnarum.com/download/manuals/ISM-Manual-2023.fld/image336.png" alt=""><figcaption></figcaption></figure>

### Execution

<figure><img src="https://support.xnarum.com/download/manuals/ISM-Manual-2023.fld/image337.png" alt=""><figcaption></figcaption></figure>

Input format of the REST service has this format.

| <p>{</p><p>    "userKey": "User Key if exists",</p><p>    "table": {</p><p>    "    "param": "value",</p><p>    },</p><p>    "txnId": "Transaction Id if exists"</p><p>}</p> |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

&#x20;

<table data-header-hidden><thead><tr><th width="197"></th><th></th></tr></thead><tbody><tr><td>Property</td><td>Description</td></tr><tr><td>userKey</td><td>This key is displayed in the business transaction result if exists.</td></tr><tr><td>txnId</td><td>This id is used as a transaction id if exists. Otherwise, a new random transaction id is generated.</td></tr><tr><td>table</td><td>This property contains real parameters of the flow.</td></tr></tbody></table>

&#x20;

This flow has one Router and three Function components. The Router will determine the path based on the input data.

<figure><img src="https://support.xnarum.com/download/manuals/ISM-Manual-2023.fld/image338.png" alt=""><figcaption></figcaption></figure>

The Router expects two parameters ??? param and param2.

<figure><img src="https://support.xnarum.com/download/manuals/ISM-Manual-2023.fld/image339.png" alt="" width="563"><figcaption></figcaption></figure>

The request parameters of this flow will be like these.

```
{
  "userKey": "my-user-key",
  "table": {
    "param": "A",
    "param2": 1
  },
  "txnId": "my-transaction-id"
}
```

The response of the execution will be like this.

<figure><img src="https://support.xnarum.com/download/manuals/ISM-Manual-2023.fld/image340.png" alt=""><figcaption></figcaption></figure>

The service endpoint is this

<http://Ism-Install-Host:8080/ISMW/api/flow/_flow\\_Id/flow\\_version>\_

&#x20;<http://localhost:8080/ISMW/api/flow/RouterTest/v1>

&#x20;

This endpoint accepts only POST method.

And the result of this transaction will be logged like this. Transaction Id and User Key are picked up from the request.

<figure><img src="https://support.xnarum.com/download/manuals/ISM-Manual-2023.fld/image341.png" alt=""><figcaption></figcaption></figure>

The detail table shows the parameters from the request.

<figure><img src="https://support.xnarum.com/download/manuals/ISM-Manual-2023.fld/image342.png" alt=""><figcaption></figcaption></figure>

&#x20;

There is one more service endpoint. This endpoint does not accept userKey and txnId parameters. It accepts only parameters instead. A random transaction id is generated. This endpoint also requires authentication as the same as the previous endpoint.

The second endpoint is this.

[http://Ism-Install-Host:8080/api/*flow\_id/flow\_version*](http://ism-install-host:8080/api/flow_id/flow_version)

This endpoint accepts both GET and POST methods.

The requests for the same flow can be constructed like these.

<table data-header-hidden><thead><tr><th width="187"></th><th></th></tr></thead><tbody><tr><td>Method</td><td>Endpoint</td></tr><tr><td>GET</td><td><a href="http://ism-install-host:8080/api/RouterTest/v1?param=D&#x26;param2=2">http://Ism-Install-Host:8080/api/RouterTest/v1?param=D&#x26;param2=2</a></td></tr><tr><td>POST</td><td><p><a href="http://ism-install-host:8080/api/RouterTest/v1?param=D&#x26;param2=2">http://Ism-Install-Host:8080/api/RouterTest/v1</a></p><p>Body(application/json)</p><p>{</p><p>            "param":"D",</p><p>            "param2": 2</p><p>}</p></td></tr></tbody></table>

<br>


---

# 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://ism-docs.xnarum.com/rest-service.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.
