Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Commit

Permalink
[EN] [V2] Add Settings doc
Browse files Browse the repository at this point in the history
  • Loading branch information
CuzImBisonratte committed Nov 5, 2023
1 parent 387e986 commit 498096e
Showing 1 changed file with 90 additions and 0 deletions.
90 changes: 90 additions & 0 deletions docs/endpoints/settings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
---
sidebar_position: 6
title: Settings
tags:
- Settings
- Setting
- Account
---

## Endpoints and Methods

| Endpoints | Methods | Use |
| ---------- | ------- | ------------------------------- |
| /settings/ | GET | Get the Settings of the User |
| /settings/ | PATCH | Change the Settings of the User |

:::note Why store settings on our servers?
We recommend storing the settings on our servers, as they than can be synced across devices and all applications using our API.
:::

## GET /settings/

### Request

```js
var axios = require("axios").default;

var options = {
method: "GET",
url: "https://api.noten-app.de/v2/settings",
headers: { Authorization: "Bearer DFw6zar4QF33Rb6jfp7cQj2UvcrAKgun" },
};

axios
.request(options)
.then(function (response) {
console.log(response.data);
})
.catch(function (error) {
console.error(error);
});
```

### Response

```json
{
"rounding": 1,
"sorting": "average",
"gradesystem": "noten",
"school_year": "a76ak8g8"
}
```

## PATCH /grades/settings/

### Request

```js
var axios = require("axios").default;

var options = {
method: "PATCH",
url: "https://api.noten-app.de/v2/settings",
headers: { Authorization: "Bearer DFw6zar4QF33Rb6jfp7cQj2UvcrAKgun" },
{
"rounding": 2,
"sorting": "date",
"gradesystem": "points",
"school_year": "a76ak8g8"
}
};

axios
.request(options)
.then(function (response) {
console.log(response.data);
})
.catch(function (error) {
console.error(error);
});
```

### Response

```json
{
"success": true
}
```

0 comments on commit 498096e

Please sign in to comment.