# Get calculation status and results

## Result of computation \[Using returned result link from process-run call]

<mark style="color:blue;">`GET`</mark> `https://api.olisystems.com/result/{jobId}?final-solution=true`

URL contains the result of the computation if status is processed

#### Headers

| Name          | Type   | Description            |
| ------------- | ------ | ---------------------- |
| Authorization | string | Bearer {access\_token} |
| Content-Type  | string | application/json       |

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

```
{
    "code": 200, 
    "data": {
        "result": {
          ...
          }
    }, 
    "message": "Results returned successfully", 
    "resultsLink": "https://api.olisystems.com/result/flash/fbce59ee-f31e-447b-b450-ba5b0d0a1a99?context=engine", 
    "status": "PROCESSED"
}
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
status can be **IN QUEUE**, **IN PROGRESS**, **PROCESSED, FAILED** or **ERROR**

if status = **IN QUEUE**/**IN PROGRESS**, keep polling the endpoint in resultsLink

if status = **PROCESSED**, result should be in **data.result**

if status = **FAILED**, computation failure. error will be be in **data.error**

if status = **ERROR**, a system error occurred
{% endhint %}

#### Example chain of request responses

```json
// 1st response on GET resultsLink
{
    "data": {
        "processInfo": [
            {"context": "currentBlockInfo",
             "data": {"blockName": "MIX-1"}},
            {"context": "currentBlockInfo",
             "data": {"blockName": "HX - AB"}},
            {"context": "currentBlockInfo",
             "data": {"blockName": "HX - CD"}}
        ]
    },
    "message": "Results returned successfully",
    "resultsLink": "https://api.olisystems.com/result/20978bbb-5555-4ecd-ae90-582953afdedf?context=process&start=3&count=21",
    "status": "IN PROGRESS"
}

// 2nd request on GET resultsLink 
"data": {
        "context": "solution",
        "flowsheetConvergence": true,
        "metadata": {"executionTime": {"unit": "ms","value": 7030.0},
            "versionInfo": {"fullVersion": "11.5.1.7"}
        },
        "output": {
        "blockOutput": { 
        ...
        }
        "streamOutput": {
        ...
        }
        }
    },
    "message": "Results returned successfully",
    "status": "COMPLETED"
}
```

{% hint style="warning" %}
If the **data.context = "solution"** and **data.flowsheetConvergence = true** signifies that results are available.&#x20;
{% endhint %}


---

# 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://devdocs.olisystems.com/group2/api-call-blueprint-1.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.
