api_endpoint_stats.md 5.29 KB
Newer Older
Art4's avatar
Art4 committed
1
---
2
title: Stats/{stats_id}
Art4's avatar
Art4 committed
3
keywords: Youthweb-API, Resource, Stats
4 5
tags: [endpoint]
summary: "Mit diesem Endpoint können statistische Daten zu bestimmten Bereichen ermittelt werden."
Art4's avatar
Art4 committed
6
sidebar: api_sidebar
7
permalink: api_endpoint_stats.html
Art4's avatar
Art4 committed
8 9 10
folder: api
---

11 12
{% include important.html content="Diese Dokumentation wird nicht mehr gepflegt und wird in Zukunft entfernt. [Sieh dir stattdessen die neue Dokumentation an][api_endpoint_index]." %}

13 14
Dieser Endpoint liefert Statistiken zu Usern, Gruppen und Forum.

15 16 17 18 19 20
## Read

### Request

```
GET https://api.youthweb.net/stats/account
Art4's avatar
Art4 committed
21
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.17
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
Content-Type: application/vnd.api+json
```

### Permissions

Für diesen Endpoint wird kein Access-Token benötigt.

### Parameter

Für den Request können keine Parameter angegeben werden.

### Response

```
Status: 200 OK
Art4's avatar
Art4 committed
37
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.17
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
Content-Type: application/vnd.api+json

{
    "data": {
        "type": "stats",
        "id": "account",
        "attributes": {
            "user_total": 5503,
            "user_total_female": 2831,
            "user_total_male": 2672,
            "user_online": 74,
            "user_online_24h": 629,
            "user_online_7d": 1035,
            "user_online_30d": 1600,
            "userpics": 3441
        },
        "links": {
            "self": "/stats/account"
        }
    }
}
```

### Felder

Art4's avatar
Art4 committed
63 64 65 66 67 68 69 70 71 72 73 74
| Name                              | Beschreibung                                                    | Typ                  |
|-----------------------------------|-----------------------------------------------------------------|----------------------|
| `type`                            | Der Typ der Resource: `stats`                                   | `string`             |
| `id`                              | Die ID der Resource `account`                                   | `string`             |
| `attributes.user_total`           | Die Anzahl aller User                                           | `integer`            |
| `attributes.user_total_female`    | Die Anzahl der weiblichen User                                  | `integer`            |
| `attributes.user_total_male`      | Die Anzahl der männlichen User                                  | `integer`            |
| `attributes.user_online`          | Die Anzahl der User, die im Moment online sind                  | `integer`            |
| `attributes.user_online_24h`      | Die Anzahl der User, die in den letzten 24 Stunden online waren | `integer`            |
| `attributes.user_online_7d`       | Die Anzahl der User, die in den letzten 7 Tagen online waren    | `integer`            |
| `attributes.user_online_30d`      | Die Anzahl der User, die in den letzten 30 Tagen online waren   | `integer`            |
| `attributes.userpics`             | Die Anzahl der User, die ein Profilbild hochgeladen haben       | `integer`            |
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94

## Create

Du kannst mit diesem Endpoint nichts erstellen.

## Delete

Du kannst mit diesem Endpoint nichts löschen.

## Update

Du kannst mit diesem Endpoint nichts ändern.

## Beziehungen

keine

## Beispiele

### Beispiel 1: Account Statistiken
Art4's avatar
Art4 committed
95 96 97 98

**Request**

```
99
GET https://api.youthweb.net/stats/account
Art4's avatar
Art4 committed
100
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.17
Art4's avatar
Art4 committed
101 102 103 104 105 106 107
Content-Type: application/vnd.api+json
```

**Response**

```
Status: 200 OK
Art4's avatar
Art4 committed
108
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.17
Art4's avatar
Art4 committed
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
Content-Type: application/vnd.api+json

{
    "data": {
        "type": "stats",
        "id": "account",
        "attributes": {
            "user_total": 5503,
            "user_total_female": 2831,
            "user_total_male": 2672,
            "user_online": 74,
            "user_online_24h": 629,
            "user_online_7d": 1035,
            "user_online_30d": 1600,
            "userpics": 3441
124 125 126
        },
        "links": {
            "self": "/stats/account"
Art4's avatar
Art4 committed
127 128 129 130 131
        }
    }
}
```

132
### Beispiel 2: Foren Statistiken
Art4's avatar
Art4 committed
133 134 135 136

**Request**

```
137
GET https://api.youthweb.net/stats/forum
Art4's avatar
Art4 committed
138
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.17
Art4's avatar
Art4 committed
139 140 141 142 143 144 145
Content-Type: application/vnd.api+json
```

**Response**

```
Status: 200 OK
Art4's avatar
Art4 committed
146
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.17
Art4's avatar
Art4 committed
147 148 149 150 151 152 153 154 155 156
Content-Type: application/vnd.api+json

{
    "data": {
        "type": "stats",
        "id": "forum",
        "attributes": {
            "authors_total": 1480,
            "threads_total": 2094,
            "posts_total": 121387
157 158 159
        },
        "links": {
            "self": "/stats/forum"
Art4's avatar
Art4 committed
160 161 162 163 164
        }
    }
}
```

165
### Beispiel 3: Gruppen Statistiken
Art4's avatar
Art4 committed
166 167 168 169

**Request**

```
170
GET https://api.youthweb.net/stats/groups
Art4's avatar
Art4 committed
171
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.17
Art4's avatar
Art4 committed
172 173 174 175 176 177 178
Content-Type: application/vnd.api+json
```

**Response**

```
Status: 200 OK
Art4's avatar
Art4 committed
179
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.17
Art4's avatar
Art4 committed
180 181 182 183 184 185 186 187 188
Content-Type: application/vnd.api+json

{
    "data": {
        "type": "stats",
        "id": "groups",
        "attributes": {
            "groups_total": 614,
            "users_total": 2073
189 190 191
        },
        "links": {
            "self": "/stats/groups"
Art4's avatar
Art4 committed
192 193 194 195 196 197
        }
    }
}
```

{% include links.html %}