# REST API

{% hint style="warning" %}
**This is the manual for older MicroStream versions (Version < 5.0).**

**The new documentation (Version >= 5.0) is located at:**

[https://docs.microstream.one/](https://docs.microstream.one/manual)
{% endhint %}

## Root

<mark style="color:blue;">`GET`</mark> `[instance-name]/root`

Returns the name and object id of the current storage root element.

{% tabs %}
{% tab title="200 <http://localhost:4567/microstream/root>" %}

```javascript
{
    name: "ROOT",
    objectId: "1000000000000000028"
}
```

{% endtab %}
{% endtabs %}

## Object

<mark style="color:blue;">`GET`</mark> `[instance-name]/object/:objectid`

Returns description and values of a distinct object.

#### Path Parameters

| Name     | Type    | Description               |
| -------- | ------- | ------------------------- |
| objectid | integer | The requested object's id |

#### Query Parameters

| Name           | Type    | Description                                                                                |
| -------------- | ------- | ------------------------------------------------------------------------------------------ |
| valueLength    | integer | <p>Limit size of returned value elements,<br>e.g. String values. Default is unlimited.</p> |
| fixedOffset    | integer | Fixed size members start offset, default is 0.                                             |
| fixedLength    | integer | <p>Amount of returned fixed size members,<br>default is unlimited.</p>                     |
| variableOffset | integer | Variable size members start offset, default is 0.                                          |
| variableLength | integer | <p>Amount of returned variable size members,<br>default is unlimited.</p>                  |
| references     | boolean | Determines if top-level references of the object should be returned as well.               |

{% tabs %}
{% tab title="200 <http://localhost:4567/microstream/object/1000000000000000028>" %}

```javascript
{
    "objectId": "1000000000000000028",
    "typeId": "110",
    "length": "0",
    "variableLength": [
    "3"
    ],
    "simplified": false,
    "data": [
        [
            "1000000000000000029",
            "1000000000000000030",
            "1000000000000000031"
        ]
    ],
    "references": null
}
```

{% endtab %}

{% tab title="404 <http://localhost:4567/microstream/object/1000000000000000123>" %}

```
No entity found for objectId 1000000000000000123
```

{% endtab %}
{% endtabs %}

## Type Dictionary

<mark style="color:blue;">`GET`</mark> `[instance-name]/dictionary`

The type dictionary as plain text.

{% tabs %}
{% tab title="200 <http://localhost:4567/microstream/dictionary>" %}

```
[Type dictionary contents]
```

{% endtab %}
{% endtabs %}

## Statistics

<mark style="color:blue;">`GET`</mark> `[instance-name]/maintenance/filesStatistics`

Statistics of the used storage files and channels.

{% tabs %}
{% tab title="200 <http://localhost:4567/maintenance/filesStatistics>" %}

```javascript
{
    "creationTime": "2020-04-15T13:32:26.003Z",
    "channelStatistics": {
        "0": {
            "channelIndex": 0,
            "files": [
                {
                    "fileNumber": "1",
                    "file": "storage\\channel_0\\channel_0_1.dat",
                    "fileCount": "1",
                    "liveDataLength": "2898",
                    "totalDataLength": "2930"
                }
            ],
            "fileCount": "1",
            "liveDataLength": "2898",
            "totalDataLength": "2930"
        }
    },
    "fileCount": "1",
    "liveDataLength": "2898",
    "totalDataLength": "2930"
}
```

{% endtab %}
{% endtabs %}
