# Periodic export

## Enable the periodic data export feature

<mark style="color:green;">`POST`</mark> `https://api-portal.evalytics/dataexport/enable`

Be sure to save the private key in a safe place, you must be able to provide it when downloading exported files.

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

```javascript
{
  "enabled": boolean,
  "privateKey": string
}
```

{% endtab %}
{% endtabs %}

## Download a single periodically exported file

<mark style="color:blue;">`GET`</mark> `https://api-portal.evalytics.nl/dataexport/download`

#### Query Parameters

| Name                                         | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| -------------------------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| file<mark style="color:red;">\*</mark>       | String  | <p>Possible values:</p><p><code>answerSetResult</code>, <code>answerSetTextResult</code>, <code>evaluation</code>, <code>evaluationBlock</code>, <code>evaluationBlockQuestion</code>, <code>evaluationBlockQuestionSet</code>, <code>evaluationBlockTeacher</code>, <code>evaluationCode</code>, <code>evaluationFeedback</code>, <code>evaluationFeedbackField</code>, <code>evaluationFeedbackTask</code>, <code>evaluationLabel</code>, <code>evaluationToLabel</code>, <code>organisation</code>, <code>question</code>, <code>questionLabel</code>, <code>questionScale</code>, <code>questionScaleValue</code>, <code>questionToLabel</code>, <code>subject</code>, <code>subjectGrade</code>, <code>subjectGradePeriod</code>, <code>subjectLabel</code>, <code>subjectToLabel</code>, <code>subjectTopicType</code>, <code>subjectTopicTypeTeacher</code>, <code>teacher</code>, <code>user</code>, <code>genericTopic</code>, <code>genericTopicToLabel</code>, <code>genericTopicLabel</code>, <code>genericTopicTopicType</code>, <code>topicType</code>, <code>year</code>, <code>period</code>, <code>subjectPeriod</code></p> |
| fileType<mark style="color:red;">\*</mark>   | String  | <p>Possible values:</p><p><code>csv</code>, <code>json</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| privateKey<mark style="color:red;">\*</mark> | String  | The private key (encryption key) that was created when the periodic export feature was enabled                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| parseJsonDataTypes                           | Boolean | Ensures the data types in the JSON files are conform the data model                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |

{% tabs %}
{% tab title="200: OK Returns the file as an attachment" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## Download all periodically exported files as a zip

<mark style="color:blue;">`GET`</mark> `https://api-portal.evalytics.nl/dataexport/downloadAll`

#### Query Parameters

| Name                                         | Type    | Description                                                                                    |
| -------------------------------------------- | ------- | ---------------------------------------------------------------------------------------------- |
| fileType<mark style="color:red;">\*</mark>   | String  | <p>Possible values:</p><p><code>csv</code>, <code>json</code></p>                              |
| privateKey<mark style="color:red;">\*</mark> | String  | The private key (encryption key) that was created when the periodic export feature was enabled |
| parseJsonDataTypes                           | Boolean | Ensures the data types in the JSON files are conform the data model                            |

{% tabs %}
{% tab title="200: OK Returns the zip-file as an attachment" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## Disable the periodic data export feature

<mark style="color:green;">`POST`</mark> `https://api-portal.evalytics.nl/dataexport/disable`

#### Query Parameters

| Name           | Type    | Description                                                       |
| -------------- | ------- | ----------------------------------------------------------------- |
| deleteSettings | Boolean | Removes previously exported files and invalidates the private key |

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

```javascript
{
    "enabled": boolean
}
```

{% endtab %}
{% endtabs %}

## Data model

<figure><img src="https://187350916-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUKhoh5rgfVskIr1bwi%2Fuploads%2FuQe0vr4163i4IrXyTtZX%2Fdiagram.svg?alt=media&#x26;token=44739bb5-25f0-41db-adce-2f21d4f8e835" alt=""><figcaption></figcaption></figure>

{% file src="<https://187350916-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUKhoh5rgfVskIr1bwi%2Fuploads%2FuQe0vr4163i4IrXyTtZX%2Fdiagram.svg?alt=media&token=44739bb5-25f0-41db-adce-2f21d4f8e835>" %}
The SVG in full size
{% endfile %}

{% file src="<https://187350916-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUKhoh5rgfVskIr1bwi%2Fuploads%2Fpoez70YMsZ9BpGZoxmIb%2Fdiagram.diagram?alt=media&token=f5b08579-ddec-4023-bc72-eb1ca2282903>" %}
For use with <https://diagramplus.com/>
{% endfile %}
