# Initial Set-Up

Complete these operations before embarking on writing, reading and verifying [**†**](/nchain-event/overview/configuration-symbols.md) records.

## Configure REST API Info

The API URL and the associated key and means of using the key will be provided by your supplier. We set them up as variables to make the endpoints easier to use in the subsequent examples.

#### Example code:

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

```bash
URL=https://event-platform.com/products/api/2cdee07fe....45d58e65537f39

KEY=b6519d3c56c....6746131380159bb9
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const url = "https://nchainplatform.com/products/api/2cdee07fe....45d58e65537f39";

const key = "b6519d3c56c....6746131380159bb9";
```

{% endtab %}
{% endtabs %}

## Check Readiness

This enables you to check that the program is initially working and find out its version number.

#### Example code:

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

```bash
curl "$URL/readiness" \
     -H "x-api-key: $KEY" \
     -H "accept: text/plain"
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const response = await fetch('${url}/readiness', {
  headers: {
    'x-api-key': '{$key}',
    'accept': 'text/plain'
  }
});
```

{% endtab %}
{% endtabs %}

#### Example cURL response:

```json
{
  "appVersion": "1.4.1",
  ....
}
```

Chain Event uses semantic versioning as specified at [https://semver.org](https://semver.org/).

## Check Liveness

This enables you to check whether the program thinks it is Healthy or not. Applications that interact with Event could call this every hour when they are idling.

#### Example code:

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

```bash
curl "$URL/liveness" \
     -H "x-api-key: $KEY" \
     -H "accept: text/plain"
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const response = await fetch('${url}/liveness', {
  headers: {
    'x-api-key': `${key}`,
    'accept': 'text/plain'
  }
});
```

{% endtab %}
{% endtabs %}

#### Example cURL response:

```json
Healthy
```


---

# 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.teranode.group/nchain-event/using-event/initial-set-up.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.
