---
title: "REST API Client | Appendix | N3uron KB V1.22"
slug: "rest-api-client-appendix"
description: "REST API Client is a N3uron module designed to provide a quick and easy way to connect N3uron to most RESTful API servers…"
updated: 2026-01-16T00:01:23Z
published: 2026-01-16T00:01:23Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.n3uron.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Appendix

## JSON structure

When using JSON, the JSON string will automatically be parsed to an object with the same structure as the string, since JSON was designed to be a textual representation of a JavaScript object. A JSON text and its JS equivalent can be seen in the snippets below:

```json
"data": {
    "info": {
        "Tag Path": "/RestApiClient/Tag1"
        "ts": 1550569887810,
        "good": true
    },
    "values ": [5, 23, 12]
    }
}
```

```javascript
data: {
    info: {
        "Tag Path": "/RestApiClient/Tag1"
        ts: 1550569887810,
        good: true
    },
    values: [5, 23, 12]
    }
}
```

As an example, the timestamp can be retrieved by accessing data.info.ts, while the value array can be retrieved by using data.values (which can then be iterated to extract each value).

## XML structure

When using XML, the XML string will automatically be parsed to a JavaScript object using several rules and special characters to generate the object. Parsing depends on the tags and their structure, but in general, the following rules apply:

```markup
<main>
<datapoint ts="1550569887810">
    <tag path="/RestApiClient/Tag1"/>
    <good>true</good>
    <values>
        <sample value="5"/>
        <sample value="23"/>
        <sample value="12"/>
    </values>
</datapoint>
</main>
```

- Each tag (except the root) is parsed as an array of one or more elements. As such, an index must be used when traversing the nested tags. For example, the <good> tag can be retrieved by using main.datapoint[0].good.
- Attributes of a tag can be accessed by using the $ character after navigating to the specific tag. For example, the path attribute of the <tag> tag can be accessed by using main.datapoint[0].tag[0].$.path
- The text value of a tag can be accessed directly if the tag has no attributes. If the tag does have attributes, it can be accessed using the special character _. In this case, the text value for the <good> tag can be accessed directly, since the <good> tag has no attributes. This is done by using main.datapoint[0].good[0]
- When a tag contains several tags with the same name, these tags will be parsed as an array contained in the parent tag. This can be seen with the <sample> tags contained in the <values> tag. For example, to access the second sample (with value 23), the following example must be used: main.datapoint[0].values[0].sample[2].$.value

Using these rules, the following JavaScript object is generated after parsing the XML:

```javascript
{
    main: {
        datapoint: [
            {
                $: {
                    ts: "1550569887810"
                },
                tag: [
                    {
                        $: {
                            path: "/RestApiClient/Tag1"
                        }
                    }
                ],
                good: [
                    "true"
                ],
                values: [
                    {
                        sample: [
                            {
                                $: {
                                    "value": "5"
                                }
                            },
                            {
                                $: {
                                    "value": "23"
                                }
                            },
                            {
                                $: {
                                    "value": "12"
                                }
                            }
                        ]
                    }
                ]
            }
        ]
    }
}
```
