# Vocab Stats

## Updaten von Stats

## Updaten von Vokabelstats

<mark style="color:green;">`POST`</mark> `https://vt.jo-dev.net/?action=updateUserVocabStats`

#### Headers

| Name                                   | Type   | Description |
| -------------------------------------- | ------ | ----------- |
| Auth<mark style="color:red;">\*</mark> | String | Usertoken   |

#### Request Body

| Name                                          | Type                         | Description          |
| --------------------------------------------- | ---------------------------- | -------------------- |
| statUpdates<mark style="color:red;">\*</mark> | Dict(Int, Dict(String, Int)) | Beispiel siehe unten |

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

{% endtab %}

{% tab title="400: Bad Request " %}
Missing information
{% endtab %}

{% tab title="401: Unauthorized " %}
Invalid token
{% endtab %}
{% endtabs %}

statUpdates benötigt ein besonderes Format eines Dictionary. Hierbei wird als Key die VocabID genommen und als Value ein weiteres Dictionary mit den Keys "fails" und "success", bei welchen mit einem Integer die Anzahl an erfolgreichen bzw falschen Versuchen mitgegeben werden kann.\
Beispiel:

```json
{"statUpdates": 
    {
        1: {"fails": 3, "success": 1},
        430: {"fails": 0, "success": 5}
    }
}
```

## Abrufen von Stats

{% hint style="warning" %}
Noch nicht implementiert, bisher nur ein Entwurf
{% endhint %}

## Abrufen von Vokabelstats

<mark style="color:blue;">`GET`</mark> `https://vt.jo-dev.net/?action=updateUserVocabStats`

#### Headers

| Name                                   | Type   | Description |
| -------------------------------------- | ------ | ----------- |
| Auth<mark style="color:red;">\*</mark> | String | Usertoken   |

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

{% endtab %}

{% tab title="401: Unauthorized Invalid token" %}

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://jo-dev.gitbook.io/vokabeltrainer-api-docs/reference/api-reference/vocab-stats.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.
