Back to top

Youthweb API

Dies ist die offizielle API von youthweb.net.

Version: 0.20 (2021-07-25)

Übersicht

Request Header

Diese Header müssen bei jedem Request angegeben werden:

Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20

Authentication

Um die API im Namen eines Users anzufragen, wird ein Access-Token benötigt, dass bei jedem Request im Header mitgeschickt werden muss:

Authorization: Bearer valid_JWT

Mehr Informationen zur Authentication findest du hier: https://developer.youthweb.net/api_general_oauth2.html

Fehler

Header Errors
GET/errors/header-errors

Hier werden übliche Fehler gezeigt, die bei falscher Verwendung zurückgegeben werden.

Example URI

GET https://api.youthweb.net/errors/header-errors
Request
HideShow

Anfragen ohne gesetzen Content-Type Header geben einen Fehler zurück.

Headers
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Response  415
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "errors": [
    {
      "status": "415",
      "title": "Unsupported Media Type",
      "detail": "You're using an unsupported Content-Type. You have to use the Content-Type application/vnd.api+json"
    }
  ]
}
Request
HideShow

Der Content-Type Header darf keine Parameter enthalten.

Headers
Content-Type: application/vnd.api+json; parameter=value
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Response  415
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "errors": [
    {
      "status": "415",
      "title": "Unsupported Media Type",
      "detail": "You're using an unsupported Content-Type. You have to use the Content-Type application/vnd.api+json"
    }
  ]
}
Request
HideShow

Anfragen ohne gesetzen Versionparameter geben einen Fehler zurück.

Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Response  406
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "errors": [
    {
      "status": "406",
      "title": "Not Acceptable",
      "detail": "You havn't specified the API version in the Accept Header. You have to use Accept application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20"
    }
  ]
}
Request
HideShow

Anfragen ohne gesetzen Accept Header geben einen Fehler zurück.

Headers
Content-Type: application/vnd.api+json
DNT: 1
Response  406
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "errors": [
    {
      "status": "406",
      "title": "Not Acceptable",
      "detail": "You havn't specified the API version in the Accept Header. You have to use Accept application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20"
    }
  ]
}
Request
HideShow

Der Versionsparameter muss eine gültige und aktuelle Version beinhalten

Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.15
Response  406
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "errors": [
    {
      "status": "406",
      "title": "Not Acceptable",
      "detail": "You have specified an unsupported API version. Please use the current API version 0.20"
    }
  ]
}

Fehler

Keine Resource anfragen
GET/

Das Anfragen der API-Url ohne eine Resource ist nicht möglich und gibt einen Fehler zurück.

Example URI

GET https://api.youthweb.net/
Request
HideShow

Anfragen ohne Resource gibt einen 404 Fehler zurück

Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Response  404
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "errors": [
    {
      "status": "404",
      "title": "Resource not found"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    }
  }
}

Warnungen

Warnungen werden gezeigt, wenn am Request etwas verbessert werden kann, aber trotzdem erfolgreich beantwortet werden konnte.

Veralteter Versionsparameter
GET/errors/header-warnings

Anfragen mit einer veralteten (deprecated) Version funktionieren, aber zeigen eine Warnung im meta-Attribut an

Example URI

GET https://api.youthweb.net/errors/header-warnings
Request
HideShow

Die angegebene Version im Accept Header ist veraltet.

Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.17
Response  404
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "errors": [
    {
      "status": "404",
      "title": "Resource not found"
    }
  ],
  "meta": {
    "warnings": [
      "You have specified a deprecated API version. Please use the current API version 0.20"
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    },
    "meta": {
      "type": "object",
      "properties": {
        "warnings": {
          "type": "array"
        }
      }
    }
  }
}

Comments

Comment

Einen Comment abrufen
GET/comments/{comment_id}{?include}

Example URI

GET https://api.youthweb.net/comments/345678?include=author,parent
URI Parameters
HideShow
comment_id
string (required) Example: 345678

ID of the comment

include
string (optional) Example: author,parent

Kommagetrente Liste an includes, möglich sind author und parent

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "data": {
    "type": "comments",
    "id": "345678",
    "attributes": {
      "content": "Lorem ipsum dolor sit amet, sed libris elaboraret eu.",
      "content_html": "<p>Lorem ipsum dolor sit amet, sed libris elaboraret eu.</p>",
      "created_at": "2017-01-01T17:51:02+00:00"
    },
    "relationships": {
      "author": {
        "links": {
          "self": "/comments/345678/relationships/author",
          "related": "/comments/345678/author"
        }
      },
      "parent": {
        "links": {
          "self": "/comments/345678/relationships/parent",
          "related": "/comments/345678/parent"
        }
      }
    },
    "links": {
      "self": "/comments/345678"
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string",
          "description": "Die Comment-ID"
        },
        "attributes": {
          "type": "object",
          "properties": {
            "content": {
              "type": "string",
              "description": "Der Inhalt des Comments"
            },
            "content_html": {
              "type": "string",
              "description": "Der Inhalt des Comments als HTML"
            },
            "created_at": {
              "type": "string",
              "description": "Zeitpunkt der Erstellung als ISO-8601"
            }
          }
        },
        "relationships": {
          "type": "object",
          "properties": {
            "author": {
              "type": "object",
              "properties": {
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Der Autor des Comments"
            },
            "parent": {
              "type": "object",
              "properties": {
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Das Objekt, das kommentiert wurde"
            }
          }
        },
        "links": {
          "type": "object",
          "properties": {
            "self": {
              "type": "string",
              "description": "Der Link zu dieser Resource"
            }
          }
        }
      }
    }
  }
}

Comment Author

Author zu einem Comment abrufen
GET/comments/{comment_id}/author

Example URI

GET https://api.youthweb.net/comments/345678/author
URI Parameters
HideShow
comment_id
string (required) Example: 345678

ID of the comment

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "data": {
    "type": "users",
    "id": "123456",
    "attributes": {
      "username": "JohnSmith",
      "first_name": "John",
      "last_name": "Smith",
      "gender": "male",
      "email": "john_smith@example.org",
      "birthday": "1988-03-05",
      "timezone": "Europe/Berlin",
      "created_at": "2006-01-01T20:00:00+00:00",
      "last_login": "2016-01-01T20:00:00+00:00",
      "zip": "12345",
      "city": "Jamestown",
      "contact_homepage": "http://example.org",
      "contact_twitter": "youthweb_dev",
      "description_text": "Lorem ipsum dolor sit amet",
      "description_character": "Lorem ipsum dolor sit amet",
      "description_jesus": "Lorem ipsum dolor sit amet",
      "description_job": "Lorem ipsum dolor sit amet",
      "description_hobbies": "Lorem ipsum dolor sit amet",
      "description_motto": "Lorem ipsum dolor sit amet",
      "description_food": "Lorem ipsum dolor sit amet",
      "description_links": "Lorem ipsum dolor sit amet",
      "picture_thumb_url": "https://youthweb.net/img/steckbriefe/default_pic_m.jpg",
      "picture_url": "https://youthweb.net/img/steckbriefe/default_pic_m.jpg",
      "picture_description": "Lorem ipsum dolor sit amet"
    },
    "links": {
      "self": "/users/123456"
    },
    "relationships": {
      "friends": {
        "links": {
          "self": "/users/123456/relationships/friends",
          "related": "/users/123456/friends"
        }
      },
      "posts": {
        "data": [
          {
            "type": "posts",
            "id": "d5a5a2c3-041b-4985-907c-74a2131efc98"
          }
        ],
        "links": {
          "self": "/users/123456/relationships/posts",
          "related": "/users/123456/posts"
        }
      }
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string",
          "description": "Die User-ID"
        },
        "attributes": {
          "type": "object",
          "properties": {
            "username": {
              "type": "string",
              "description": "Der Username"
            },
            "first_name": {
              "type": [
                "string",
                "null"
              ],
              "description": "Der Vorname"
            },
            "last_name": {
              "type": [
                "string",
                "null"
              ],
              "description": "Der Nachname"
            },
            "gender": {
              "type": [
                "string",
                "null"
              ],
              "description": "Das Geschlecht, entweder `male` (männlich) oder `female` (weiblic)"
            },
            "email": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die E-Mail Adresse"
            },
            "birthday": {
              "type": [
                "string",
                "null"
              ],
              "description": "Geburtstag im Format YYYY-MM-DD"
            },
            "timezone": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die eingestellte Zeitzone des Users"
            },
            "created_at": {
              "type": [
                "string",
                "null"
              ],
              "description": "Zeitpunkt der Registrierung als ISO-8601"
            },
            "last_login": {
              "type": [
                "string",
                "null"
              ],
              "description": "Zeitpunkt des letzten Logins als ISO-8601"
            },
            "zip": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die Postleitzahl"
            },
            "city": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die Stadt"
            },
            "contact_homepage": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die Webseite des Users"
            },
            "contact_twitter": {
              "type": [
                "string",
                "null"
              ],
              "description": "Der Twitter-Username des Users"
            },
            "description_text": {
              "type": [
                "string",
                "null"
              ],
              "description": "Eine sonstige Beschreibung des Users"
            },
            "description_character": {
              "type": [
                "string",
                "null"
              ],
              "description": "Eine eigene Charakter-Beschreibung des Users"
            },
            "description_jesus": {
              "type": [
                "string",
                "null"
              ],
              "description": "\"Was ich von Jesus halte\""
            },
            "description_job": {
              "type": [
                "string",
                "null"
              ],
              "description": "Der Beruf"
            },
            "description_hobbies": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die Hobbies"
            },
            "description_motto": {
              "type": [
                "string",
                "null"
              ],
              "description": "Das Lebensmotto"
            },
            "description_food": {
              "type": [
                "string",
                "null"
              ],
              "description": "Das Lieblingsessen des Users"
            },
            "description_links": {
              "type": [
                "string",
                "null"
              ],
              "description": "Eine Empfehlung von Links des Users"
            },
            "picture_thumb_url": {
              "type": "string",
              "description": "Url zum Profilbild (Thumbnail)"
            },
            "picture_url": {
              "type": "string",
              "description": "Url zum Profilbild (Vollbild)"
            },
            "picture_description": {
              "type": [
                "string",
                "null"
              ],
              "description": "Eine Beschreibung des Profilbildes"
            }
          }
        },
        "links": {
          "type": "object",
          "properties": {
            "self": {
              "type": "string",
              "description": "Der Link zu dieser Resource"
            }
          }
        },
        "relationships": {
          "type": "object",
          "properties": {
            "friends": {
              "type": "object",
              "properties": {
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Die Friends des Users"
            },
            "posts": {
              "type": "object",
              "properties": {
                "data": {
                  "type": "array"
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Die Posts auf der Pinnwand des Users"
            }
          }
        }
      }
    }
  }
}

Post Author Relationship

Author Relationship zu einem Comment abrufen
GET/comments/{comment_id}/relationships/author

Example URI

GET https://api.youthweb.net/comments/345678/relationships/author
URI Parameters
HideShow
comment_id
string (required) Example: 345678

ID of the event

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "data": {
    "type": "users",
    "id": "123456"
  },
  "links": {
    "self": "/comments/345678/relationships/author",
    "related": "/comments/345678/author"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string",
          "description": "Die User-ID"
        }
      }
    },
    "links": {
      "type": "object",
      "properties": {
        "self": {
          "type": "string"
        },
        "related": {
          "type": "string"
        }
      }
    }
  }
}

Comment Parent

Parent zu einem Comment abrufen
GET/comments/{comment_id}/parent

Example URI

GET https://api.youthweb.net/comments/345678/parent
URI Parameters
HideShow
comment_id
string (required) Example: 345678

ID of the comment

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "data": {
    "type": "posts",
    "id": "d5a5a2c3-041b-4985-907c-74a2131efc98",
    "attributes": {
      "title": "The post title",
      "content": "Lorem ipsum dolor sit amet, sed libris elaboraret eu.",
      "content_html": "<p>Lorem ipsum dolor sit amet, sed libris elaboraret eu.</p>",
      "view_allowed_for": "users",
      "comments_allowed": true,
      "comments_count": 15,
      "reactions_given": [
        ":+1:"
      ],
      "reactions_count": {
        ":+1:": 1
      },
      "created_at": "2017-01-01T17:51:02+00:00",
      "updated_at": "2017-01-03T13:17:11+00:00"
    },
    "relationships": {
      "author": {
        "data": {
          "type": "users",
          "id": "123456"
        },
        "links": {
          "self": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/relationships/author",
          "related": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/author"
        }
      },
      "comments": {
        "data": [
          {
            "type": "comments",
            "id": "345678"
          }
        ],
        "links": {
          "self": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/relationships/comments",
          "related": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/comments"
        }
      },
      "parent": {
        "data": {
          "type": "users",
          "id": "123456"
        },
        "links": {
          "self": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/relationships/parent",
          "related": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/parent"
        }
      }
    },
    "links": {
      "self": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98"
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string",
          "description": "Die Post-ID"
        },
        "attributes": {
          "type": "object",
          "properties": {
            "title": {
              "type": "string",
              "description": "Der Title, kann auch leer sein"
            },
            "content": {
              "type": "string",
              "description": "Der Post-Inhalt"
            },
            "content_html": {
              "type": "string",
              "description": "Der Post-Inhalt als HTML"
            },
            "view_allowed_for": {
              "type": "string",
              "description": "Wer kann diesen Post sehen? (`all`, `users`, `friends` oder `authors`)"
            },
            "comments_allowed": {
              "type": "boolean",
              "description": "Kann dieser Post kommentiert werden?"
            },
            "comments_count": {
              "type": "number",
              "description": "Die Gesamtanzahl der Kommentare zu diesem Post"
            },
            "reactions_given": {
              "type": "array",
              "description": "Die vom authorisierten User vergebenen Reaktionen zu diesem Post"
            },
            "reactions_count": {
              "type": "object",
              "properties": {
                ":+1:": {
                  "type": "number"
                }
              },
              "description": "Vergebene Reaktionen und deren Anzahl zu diesem Post"
            },
            "created_at": {
              "type": "string",
              "description": "Zeitpunkt der Erstellung als ISO-8601"
            },
            "updated_at": {
              "type": [
                "string",
                "null"
              ],
              "description": "Zeitpunkt der letzten Änderung als ISO-8601"
            }
          }
        },
        "relationships": {
          "type": "object",
          "properties": {
            "author": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "data": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string",
                      "description": "Die User-ID"
                    }
                  }
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Der Autor des Posts"
            },
            "comments": {
              "type": "object",
              "properties": {
                "data": {
                  "type": "array"
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Die Kommentare zu diesem Post"
            },
            "parent": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "data": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string",
                      "description": "Die User-ID"
                    }
                  }
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Das Elternobjekt, dem dieser Post zugeordnet ist"
            }
          }
        },
        "links": {
          "type": "object",
          "properties": {
            "self": {
              "type": "string",
              "description": "Der Link zu dieser Resource"
            }
          }
        }
      }
    }
  }
}

Comment Parent Relationship

Parent Relationship zu einem Comment abrufen
GET/comments/{comment_id}/relationships/parent

Example URI

GET https://api.youthweb.net/comments/345678/relationships/parent
URI Parameters
HideShow
comment_id
string (required) Example: 345678

ID of the event

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "data": {
    "type": "posts",
    "id": "d5a5a2c3-041b-4985-907c-74a2131efc98"
  },
  "links": {
    "self": "/comments/345678/relationships/parent",
    "related": "/comments/345678/parent"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string",
          "description": "Die Post-ID"
        }
      }
    },
    "links": {
      "type": "object",
      "properties": {
        "self": {
          "type": "string"
        },
        "related": {
          "type": "string"
        }
      }
    }
  }
}

Events

Events abrufen

Eine Liste von Events abrufen
GET/events

Example URI

GET https://api.youthweb.net/events
URI Parameters
HideShow
page[start]
string (optional) Example: 2017-06-01T00:00:00

Ein ISO 6801 Datum ohne Timezone-Offset in UTC Timezone für die untere Startzeit der Events. Wenn nicht angegeben, wird der aktuelle Zeitpunkt angenommen. Ein angegebener Timezone-Offset wird ignoriert.

page[end]
string (optional) Example: 2017-08-01T00:00:00

Ein ISO 6801 Datum ohne Timezone-Offset in UTC Timezone für die obere Startzeit der Events. Wenn nicht angegeben, wird ein Monat nach page[start] angenommen. Ein angegebener Timezone-Offset wird ignoriert.

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "data": [
    {
      "type": "events",
      "id": "4567",
      "attributes": {
        "name": "The event name",
        "content": "Lorem ipsum dolor sit amet, sed libris elaboraret eu.",
        "start_datetime": "2017-06-26T07:30:00+00:00",
        "end_datetime": "2017-07-07T16:00:00+00:00",
        "timezone": "Europe/Berlin",
        "address": "Musterstraße 42\\n12345 Berlin",
        "comments_allowed": true,
        "comments_count": 7,
        "promised_participants_count": 10,
        "declined_participants_count": 2,
        "invited_participants_count": 5
      },
      "relationships": {
        "author": {
          "data": {
            "type": "users",
            "id": "123456"
          },
          "links": {
            "self": "/events/4567/relationships/author",
            "related": "/events/4567/author"
          }
        }
      },
      "links": {
        "self": "/events/4567"
      }
    }
  ],
  "included": [
    {
      "type": "users",
      "id": "123456",
      "attributes": {
        "username": "JohnSmith",
        "first_name": "John",
        "last_name": "Smith",
        "gender": "male",
        "email": "john_smith@example.org",
        "birthday": "1988-03-05",
        "timezone": "Europe/Berlin",
        "created_at": "2006-01-01T20:00:00+00:00",
        "last_login": "2016-01-01T20:00:00+00:00",
        "zip": "12345",
        "city": "Jamestown",
        "contact_homepage": "http://example.org",
        "contact_twitter": "youthweb_dev",
        "description_text": "Lorem ipsum dolor sit amet",
        "description_character": "Lorem ipsum dolor sit amet",
        "description_jesus": "Lorem ipsum dolor sit amet",
        "description_job": "Lorem ipsum dolor sit amet",
        "description_hobbies": "Lorem ipsum dolor sit amet",
        "description_motto": "Lorem ipsum dolor sit amet",
        "description_food": "Lorem ipsum dolor sit amet",
        "description_links": "Lorem ipsum dolor sit amet",
        "picture_thumb_url": "https://youthweb.net/img/steckbriefe/default_pic_m.jpg",
        "picture_url": "https://youthweb.net/img/steckbriefe/default_pic_m.jpg",
        "picture_description": "Lorem ipsum dolor sit amet"
      },
      "links": {
        "self": "/users/123456"
      },
      "relationships": {
        "friends": {
          "links": {
            "self": "/users/123456/relationships/friends",
            "related": "/users/123456/friends"
          }
        },
        "posts": {
          "data": [
            {
              "type": "posts",
              "id": "d5a5a2c3-041b-4985-907c-74a2131efc98"
            }
          ],
          "links": {
            "self": "/users/123456/relationships/posts",
            "related": "/users/123456/posts"
          }
        }
      }
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "array"
    },
    "included": {
      "type": "array"
    }
  }
}

Event

Ein Event abrufen
GET/events/{event_id}{?include}

Example URI

GET https://api.youthweb.net/events/4567?include=author
URI Parameters
HideShow
event_id
string (required) Example: 4567

ID of the event

include
string (optional) Example: author

Kommagetrente Liste an includes

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "data": {
    "type": "events",
    "id": "4567",
    "attributes": {
      "name": "The event name",
      "content": "Lorem ipsum dolor sit amet, sed libris elaboraret eu.",
      "start_datetime": "2017-06-26T07:30:00+00:00",
      "end_datetime": "2017-07-07T16:00:00+00:00",
      "timezone": "Europe/Berlin",
      "address": "Musterstraße 42\\n12345 Berlin",
      "comments_allowed": true,
      "comments_count": 7,
      "promised_participants_count": 10,
      "declined_participants_count": 2,
      "invited_participants_count": 5
    },
    "relationships": {
      "author": {
        "data": {
          "type": "users",
          "id": "123456"
        },
        "links": {
          "self": "/events/4567/relationships/author",
          "related": "/events/4567/author"
        }
      }
    },
    "links": {
      "self": "/events/4567"
    }
  },
  "included": [
    {
      "type": "users",
      "id": "123456",
      "attributes": {
        "username": "JohnSmith",
        "first_name": "John",
        "last_name": "Smith",
        "gender": "male",
        "email": "john_smith@example.org",
        "birthday": "1988-03-05",
        "timezone": "Europe/Berlin",
        "created_at": "2006-01-01T20:00:00+00:00",
        "last_login": "2016-01-01T20:00:00+00:00",
        "zip": "12345",
        "city": "Jamestown",
        "contact_homepage": "http://example.org",
        "contact_twitter": "youthweb_dev",
        "description_text": "Lorem ipsum dolor sit amet",
        "description_character": "Lorem ipsum dolor sit amet",
        "description_jesus": "Lorem ipsum dolor sit amet",
        "description_job": "Lorem ipsum dolor sit amet",
        "description_hobbies": "Lorem ipsum dolor sit amet",
        "description_motto": "Lorem ipsum dolor sit amet",
        "description_food": "Lorem ipsum dolor sit amet",
        "description_links": "Lorem ipsum dolor sit amet",
        "picture_thumb_url": "https://youthweb.net/img/steckbriefe/default_pic_m.jpg",
        "picture_url": "https://youthweb.net/img/steckbriefe/default_pic_m.jpg",
        "picture_description": "Lorem ipsum dolor sit amet"
      },
      "links": {
        "self": "/users/123456"
      },
      "relationships": {
        "friends": {
          "links": {
            "self": "/users/123456/relationships/friends",
            "related": "/users/123456/friends"
          }
        },
        "posts": {
          "data": [
            {
              "type": "posts",
              "id": "d5a5a2c3-041b-4985-907c-74a2131efc98"
            }
          ],
          "links": {
            "self": "/users/123456/relationships/posts",
            "related": "/users/123456/posts"
          }
        }
      }
    }
  ],
  "meta": {
    "warnings": [
      "The default inclusion of \"author\" relationships is deprecated since 0.17 and will be removed in future, use \"?include=author\" in query instead."
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string",
          "description": "Die Event-ID"
        },
        "attributes": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "Der Event-Name"
            },
            "content": {
              "type": "string",
              "description": "Die Event-Beschreibung"
            },
            "start_datetime": {
              "type": "string",
              "description": "Start-Zeitpunkt des Events als ISO-8601 in der UTC-Timezone"
            },
            "end_datetime": {
              "type": [
                "string",
                "null"
              ],
              "description": "End-Zeitpunkt des Events als ISO-8601 in der UTC-Timezone"
            },
            "timezone": {
              "type": "string",
              "description": "Die Zeitzone, in der das Event stattfindet"
            },
            "address": {
              "type": "string",
              "description": "Die Adresse, an der das Event stattfindet"
            },
            "comments_allowed": {
              "type": "boolean",
              "description": "Kann dieses Event kommentiert werden?"
            },
            "comments_count": {
              "type": "number",
              "description": "Die Gesamtanzahl der Kommentare zu diesem Event"
            },
            "promised_participants_count": {
              "type": "number",
              "description": "Die Anzahl der User, die eine Zustimmung zur Teilnahme an diesem Event gegeben haben"
            },
            "declined_participants_count": {
              "type": "number",
              "description": "Die Anzahl der User, die eine Absage zur Teilnahme an diesem Event gegeben haben"
            },
            "invited_participants_count": {
              "type": "number",
              "description": "Die Anzahl der User, die eingeladen wurden, an diesem Event teilzunehmen"
            }
          }
        },
        "relationships": {
          "type": "object",
          "properties": {
            "author": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "data": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string",
                      "description": "Die User-ID"
                    }
                  }
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Der Autor des Posts"
            }
          }
        },
        "links": {
          "type": "object",
          "properties": {
            "self": {
              "type": "string",
              "description": "Der Link zu dieser Resource"
            }
          }
        }
      }
    },
    "included": {
      "type": "array"
    },
    "meta": {
      "type": "object",
      "properties": {
        "warnings": {
          "type": "array"
        }
      }
    }
  }
}
Request
HideShow

Fehler: Event anfragen ohne Authorization

Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Response  401
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "errors": [
    {
      "status": "401",
      "title": "Unauthorized"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    }
  }
}

Event Author

Author zu einem Event abrufen
GET/events/{event_id}/author

Example URI

GET https://api.youthweb.net/events/4567/author
URI Parameters
HideShow
event_id
string (required) Example: 4567

ID of the event

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "data": {
    "type": "users",
    "id": "123456",
    "attributes": {
      "username": "JohnSmith",
      "first_name": "John",
      "last_name": "Smith",
      "gender": "male",
      "email": "john_smith@example.org",
      "birthday": "1988-03-05",
      "timezone": "Europe/Berlin",
      "created_at": "2006-01-01T20:00:00+00:00",
      "last_login": "2016-01-01T20:00:00+00:00",
      "zip": "12345",
      "city": "Jamestown",
      "contact_homepage": "http://example.org",
      "contact_twitter": "youthweb_dev",
      "description_text": "Lorem ipsum dolor sit amet",
      "description_character": "Lorem ipsum dolor sit amet",
      "description_jesus": "Lorem ipsum dolor sit amet",
      "description_job": "Lorem ipsum dolor sit amet",
      "description_hobbies": "Lorem ipsum dolor sit amet",
      "description_motto": "Lorem ipsum dolor sit amet",
      "description_food": "Lorem ipsum dolor sit amet",
      "description_links": "Lorem ipsum dolor sit amet",
      "picture_thumb_url": "https://youthweb.net/img/steckbriefe/default_pic_m.jpg",
      "picture_url": "https://youthweb.net/img/steckbriefe/default_pic_m.jpg",
      "picture_description": "Lorem ipsum dolor sit amet"
    },
    "links": {
      "self": "/users/123456"
    },
    "relationships": {
      "friends": {
        "links": {
          "self": "/users/123456/relationships/friends",
          "related": "/users/123456/friends"
        }
      },
      "posts": {
        "data": [
          {
            "type": "posts",
            "id": "d5a5a2c3-041b-4985-907c-74a2131efc98"
          }
        ],
        "links": {
          "self": "/users/123456/relationships/posts",
          "related": "/users/123456/posts"
        }
      }
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string",
          "description": "Die User-ID"
        },
        "attributes": {
          "type": "object",
          "properties": {
            "username": {
              "type": "string",
              "description": "Der Username"
            },
            "first_name": {
              "type": [
                "string",
                "null"
              ],
              "description": "Der Vorname"
            },
            "last_name": {
              "type": [
                "string",
                "null"
              ],
              "description": "Der Nachname"
            },
            "gender": {
              "type": [
                "string",
                "null"
              ],
              "description": "Das Geschlecht, entweder `male` (männlich) oder `female` (weiblic)"
            },
            "email": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die E-Mail Adresse"
            },
            "birthday": {
              "type": [
                "string",
                "null"
              ],
              "description": "Geburtstag im Format YYYY-MM-DD"
            },
            "timezone": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die eingestellte Zeitzone des Users"
            },
            "created_at": {
              "type": [
                "string",
                "null"
              ],
              "description": "Zeitpunkt der Registrierung als ISO-8601"
            },
            "last_login": {
              "type": [
                "string",
                "null"
              ],
              "description": "Zeitpunkt des letzten Logins als ISO-8601"
            },
            "zip": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die Postleitzahl"
            },
            "city": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die Stadt"
            },
            "contact_homepage": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die Webseite des Users"
            },
            "contact_twitter": {
              "type": [
                "string",
                "null"
              ],
              "description": "Der Twitter-Username des Users"
            },
            "description_text": {
              "type": [
                "string",
                "null"
              ],
              "description": "Eine sonstige Beschreibung des Users"
            },
            "description_character": {
              "type": [
                "string",
                "null"
              ],
              "description": "Eine eigene Charakter-Beschreibung des Users"
            },
            "description_jesus": {
              "type": [
                "string",
                "null"
              ],
              "description": "\"Was ich von Jesus halte\""
            },
            "description_job": {
              "type": [
                "string",
                "null"
              ],
              "description": "Der Beruf"
            },
            "description_hobbies": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die Hobbies"
            },
            "description_motto": {
              "type": [
                "string",
                "null"
              ],
              "description": "Das Lebensmotto"
            },
            "description_food": {
              "type": [
                "string",
                "null"
              ],
              "description": "Das Lieblingsessen des Users"
            },
            "description_links": {
              "type": [
                "string",
                "null"
              ],
              "description": "Eine Empfehlung von Links des Users"
            },
            "picture_thumb_url": {
              "type": "string",
              "description": "Url zum Profilbild (Thumbnail)"
            },
            "picture_url": {
              "type": "string",
              "description": "Url zum Profilbild (Vollbild)"
            },
            "picture_description": {
              "type": [
                "string",
                "null"
              ],
              "description": "Eine Beschreibung des Profilbildes"
            }
          }
        },
        "links": {
          "type": "object",
          "properties": {
            "self": {
              "type": "string",
              "description": "Der Link zu dieser Resource"
            }
          }
        },
        "relationships": {
          "type": "object",
          "properties": {
            "friends": {
              "type": "object",
              "properties": {
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Die Friends des Users"
            },
            "posts": {
              "type": "object",
              "properties": {
                "data": {
                  "type": "array"
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Die Posts auf der Pinnwand des Users"
            }
          }
        }
      }
    }
  }
}

Event Author Relationship

Author Relationship zu einem Event abrufen
GET/events/{event_id}/relationships/author

Example URI

GET https://api.youthweb.net/events/4567/relationships/author
URI Parameters
HideShow
event_id
string (required) Example: 4567

ID of the event

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "data": {
    "type": "users",
    "id": "123456"
  },
  "links": {
    "self": "/event/4567/relationships/author",
    "related": "/events/4567/author"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string",
          "description": "Die User-ID"
        }
      }
    },
    "links": {
      "type": "object",
      "properties": {
        "self": {
          "type": "string"
        },
        "related": {
          "type": "string"
        }
      }
    }
  }
}

Friends

Friend

Dieser Endpoint kann zum Lesen eines Friends verwendet werden.

Friends sind die Verbindungspunkte zwischen zwei User. User lassen sich mithilfe der Friends als gerichteter Graph abbilden, wobei jeder User einen Knoten und jeder Friend eine Kante darstellt.

Grafik 1

Die Richtung der Kante wird durch die Relationships from und to bestimmt. Damit bestehen zwischen zwei befreundeten Usern immer zwei Friend-Kanten, die in die jeweils andere Richtung zeigen.

Die Kante Friend 1 beinhaltet in der from-Relationship den User A und in der to-Relationship den User B.

Die Kante Friend 2 hingegen beinhaltet in der from-Relationship den User B und in der to-Relationship den User A.

Einen Friend abrufen
GET/friends/{friend_id}{?include}

Example URI

GET https://api.youthweb.net/friends/45678?include=from,to
URI Parameters
HideShow
friend_id
string (required) Example: 45678

ID of the friend

include
string (optional) Example: from,to

Kommagetrente Liste an includes

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "data": {
    "type": "friends",
    "id": "45678",
    "attributes": {
      "description": "Lorem ipsum dolor sit amet, sed libris elaboraret eu."
    },
    "relationships": {
      "from": {
        "data": {
          "type": "users",
          "id": "123456"
        },
        "links": {
          "self": "/friends/45678/relationships/from",
          "related": "/friends/45678/from"
        }
      },
      "to": {
        "data": {
          "type": "users",
          "id": "123456"
        },
        "links": {
          "self": "/friends/45678/relationships/to",
          "related": "/friends/45678/to"
        }
      }
    },
    "links": {
      "self": "/friends/45678"
    }
  },
  "included": [
    {
      "type": "users",
      "id": "123456",
      "attributes": {
        "username": "JohnSmith",
        "first_name": "John",
        "last_name": "Smith",
        "gender": "male",
        "email": "john_smith@example.org",
        "birthday": "1988-03-05",
        "timezone": "Europe/Berlin",
        "created_at": "2006-01-01T20:00:00+00:00",
        "last_login": "2016-01-01T20:00:00+00:00",
        "zip": "12345",
        "city": "Jamestown",
        "contact_homepage": "http://example.org",
        "contact_twitter": "youthweb_dev",
        "description_text": "Lorem ipsum dolor sit amet",
        "description_character": "Lorem ipsum dolor sit amet",
        "description_jesus": "Lorem ipsum dolor sit amet",
        "description_job": "Lorem ipsum dolor sit amet",
        "description_hobbies": "Lorem ipsum dolor sit amet",
        "description_motto": "Lorem ipsum dolor sit amet",
        "description_food": "Lorem ipsum dolor sit amet",
        "description_links": "Lorem ipsum dolor sit amet",
        "picture_thumb_url": "https://youthweb.net/img/steckbriefe/default_pic_m.jpg",
        "picture_url": "https://youthweb.net/img/steckbriefe/default_pic_m.jpg",
        "picture_description": "Lorem ipsum dolor sit amet"
      },
      "links": {
        "self": "/users/123456"
      },
      "relationships": {
        "friends": {
          "links": {
            "self": "/users/123456/relationships/friends",
            "related": "/users/123456/friends"
          }
        },
        "posts": {
          "data": [
            {
              "type": "posts",
              "id": "d5a5a2c3-041b-4985-907c-74a2131efc98"
            }
          ],
          "links": {
            "self": "/users/123456/relationships/posts",
            "related": "/users/123456/posts"
          }
        }
      }
    }
  ],
  "meta": {
    "warnings": [
      "The default inclusion of \"from\" and \"to\" relationships is deprecated since 0.19 and will be removed in future, use \"?include=from,to\" in query instead."
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string",
          "description": "Die Friend-ID"
        },
        "attributes": {
          "type": "object",
          "properties": {
            "description": {
              "type": "string",
              "description": "Die Freundes-Beschreibung"
            }
          }
        },
        "relationships": {
          "type": "object",
          "properties": {
            "from": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "data": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string",
                      "description": "Die User-ID"
                    }
                  }
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Der User, von dem die Freundschaft ausgeht"
            },
            "to": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "data": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string",
                      "description": "Die User-ID"
                    }
                  }
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Der User, dem die Freundschaft gilt"
            }
          }
        },
        "links": {
          "type": "object",
          "properties": {
            "self": {
              "type": "string",
              "description": "Der Link zu dieser Resource"
            }
          }
        }
      }
    },
    "included": {
      "type": "array"
    },
    "meta": {
      "type": "object",
      "properties": {
        "warnings": {
          "type": "array"
        }
      }
    }
  }
}
Request
HideShow

Fehler: Friend anfragen ohne Authorization

Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Response  401
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "errors": [
    {
      "status": "401",
      "title": "Unauthorized"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    }
  }
}

Friend From

From-User zu einem Friend abrufen
GET/friends/{friend_id}/from

Example URI

GET https://api.youthweb.net/friends/45678/from
URI Parameters
HideShow
friend_id
string (required) Example: 45678

ID of the friend

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "data": {
    "type": "users",
    "id": "123456",
    "attributes": {
      "username": "JohnSmith",
      "first_name": "John",
      "last_name": "Smith",
      "gender": "male",
      "email": "john_smith@example.org",
      "birthday": "1988-03-05",
      "timezone": "Europe/Berlin",
      "created_at": "2006-01-01T20:00:00+00:00",
      "last_login": "2016-01-01T20:00:00+00:00",
      "zip": "12345",
      "city": "Jamestown",
      "contact_homepage": "http://example.org",
      "contact_twitter": "youthweb_dev",
      "description_text": "Lorem ipsum dolor sit amet",
      "description_character": "Lorem ipsum dolor sit amet",
      "description_jesus": "Lorem ipsum dolor sit amet",
      "description_job": "Lorem ipsum dolor sit amet",
      "description_hobbies": "Lorem ipsum dolor sit amet",
      "description_motto": "Lorem ipsum dolor sit amet",
      "description_food": "Lorem ipsum dolor sit amet",
      "description_links": "Lorem ipsum dolor sit amet",
      "picture_thumb_url": "https://youthweb.net/img/steckbriefe/default_pic_m.jpg",
      "picture_url": "https://youthweb.net/img/steckbriefe/default_pic_m.jpg",
      "picture_description": "Lorem ipsum dolor sit amet"
    },
    "links": {
      "self": "/users/123456"
    },
    "relationships": {
      "friends": {
        "links": {
          "self": "/users/123456/relationships/friends",
          "related": "/users/123456/friends"
        }
      },
      "posts": {
        "data": [
          {
            "type": "posts",
            "id": "d5a5a2c3-041b-4985-907c-74a2131efc98"
          }
        ],
        "links": {
          "self": "/users/123456/relationships/posts",
          "related": "/users/123456/posts"
        }
      }
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string",
          "description": "Die User-ID"
        },
        "attributes": {
          "type": "object",
          "properties": {
            "username": {
              "type": "string",
              "description": "Der Username"
            },
            "first_name": {
              "type": [
                "string",
                "null"
              ],
              "description": "Der Vorname"
            },
            "last_name": {
              "type": [
                "string",
                "null"
              ],
              "description": "Der Nachname"
            },
            "gender": {
              "type": [
                "string",
                "null"
              ],
              "description": "Das Geschlecht, entweder `male` (männlich) oder `female` (weiblic)"
            },
            "email": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die E-Mail Adresse"
            },
            "birthday": {
              "type": [
                "string",
                "null"
              ],
              "description": "Geburtstag im Format YYYY-MM-DD"
            },
            "timezone": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die eingestellte Zeitzone des Users"
            },
            "created_at": {
              "type": [
                "string",
                "null"
              ],
              "description": "Zeitpunkt der Registrierung als ISO-8601"
            },
            "last_login": {
              "type": [
                "string",
                "null"
              ],
              "description": "Zeitpunkt des letzten Logins als ISO-8601"
            },
            "zip": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die Postleitzahl"
            },
            "city": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die Stadt"
            },
            "contact_homepage": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die Webseite des Users"
            },
            "contact_twitter": {
              "type": [
                "string",
                "null"
              ],
              "description": "Der Twitter-Username des Users"
            },
            "description_text": {
              "type": [
                "string",
                "null"
              ],
              "description": "Eine sonstige Beschreibung des Users"
            },
            "description_character": {
              "type": [
                "string",
                "null"
              ],
              "description": "Eine eigene Charakter-Beschreibung des Users"
            },
            "description_jesus": {
              "type": [
                "string",
                "null"
              ],
              "description": "\"Was ich von Jesus halte\""
            },
            "description_job": {
              "type": [
                "string",
                "null"
              ],
              "description": "Der Beruf"
            },
            "description_hobbies": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die Hobbies"
            },
            "description_motto": {
              "type": [
                "string",
                "null"
              ],
              "description": "Das Lebensmotto"
            },
            "description_food": {
              "type": [
                "string",
                "null"
              ],
              "description": "Das Lieblingsessen des Users"
            },
            "description_links": {
              "type": [
                "string",
                "null"
              ],
              "description": "Eine Empfehlung von Links des Users"
            },
            "picture_thumb_url": {
              "type": "string",
              "description": "Url zum Profilbild (Thumbnail)"
            },
            "picture_url": {
              "type": "string",
              "description": "Url zum Profilbild (Vollbild)"
            },
            "picture_description": {
              "type": [
                "string",
                "null"
              ],
              "description": "Eine Beschreibung des Profilbildes"
            }
          }
        },
        "links": {
          "type": "object",
          "properties": {
            "self": {
              "type": "string",
              "description": "Der Link zu dieser Resource"
            }
          }
        },
        "relationships": {
          "type": "object",
          "properties": {
            "friends": {
              "type": "object",
              "properties": {
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Die Friends des Users"
            },
            "posts": {
              "type": "object",
              "properties": {
                "data": {
                  "type": "array"
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Die Posts auf der Pinnwand des Users"
            }
          }
        }
      }
    }
  }
}

From-User Relationship

From-User Relationship zu einem Friend abrufen
GET/friends/{friend_id}/relationships/from

Example URI

GET https://api.youthweb.net/friends/45678/relationships/from
URI Parameters
HideShow
friend_id
string (required) Example: 45678

ID of the friend

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "data": {
    "type": "users",
    "id": "123456"
  },
  "links": {
    "self": "/friends/45678/relationships/from",
    "related": "/friends/45678/from"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string",
          "description": "Die User-ID"
        }
      }
    },
    "links": {
      "type": "object",
      "properties": {
        "self": {
          "type": "string"
        },
        "related": {
          "type": "string"
        }
      }
    }
  }
}

To-User zu einem Friend abrufen

To-User zu einem Friend abrufen
GET/friends/{friend_id}/to

Example URI

GET https://api.youthweb.net/friends/45678/to
URI Parameters
HideShow
friend_id
string (required) Example: 45678

ID of the friend

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "data": {
    "type": "users",
    "id": "123456",
    "attributes": {
      "username": "JohnSmith",
      "first_name": "John",
      "last_name": "Smith",
      "gender": "male",
      "email": "john_smith@example.org",
      "birthday": "1988-03-05",
      "timezone": "Europe/Berlin",
      "created_at": "2006-01-01T20:00:00+00:00",
      "last_login": "2016-01-01T20:00:00+00:00",
      "zip": "12345",
      "city": "Jamestown",
      "contact_homepage": "http://example.org",
      "contact_twitter": "youthweb_dev",
      "description_text": "Lorem ipsum dolor sit amet",
      "description_character": "Lorem ipsum dolor sit amet",
      "description_jesus": "Lorem ipsum dolor sit amet",
      "description_job": "Lorem ipsum dolor sit amet",
      "description_hobbies": "Lorem ipsum dolor sit amet",
      "description_motto": "Lorem ipsum dolor sit amet",
      "description_food": "Lorem ipsum dolor sit amet",
      "description_links": "Lorem ipsum dolor sit amet",
      "picture_thumb_url": "https://youthweb.net/img/steckbriefe/default_pic_m.jpg",
      "picture_url": "https://youthweb.net/img/steckbriefe/default_pic_m.jpg",
      "picture_description": "Lorem ipsum dolor sit amet"
    },
    "links": {
      "self": "/users/123456"
    },
    "relationships": {
      "friends": {
        "links": {
          "self": "/users/123456/relationships/friends",
          "related": "/users/123456/friends"
        }
      },
      "posts": {
        "data": [
          {
            "type": "posts",
            "id": "d5a5a2c3-041b-4985-907c-74a2131efc98"
          }
        ],
        "links": {
          "self": "/users/123456/relationships/posts",
          "related": "/users/123456/posts"
        }
      }
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string",
          "description": "Die User-ID"
        },
        "attributes": {
          "type": "object",
          "properties": {
            "username": {
              "type": "string",
              "description": "Der Username"
            },
            "first_name": {
              "type": [
                "string",
                "null"
              ],
              "description": "Der Vorname"
            },
            "last_name": {
              "type": [
                "string",
                "null"
              ],
              "description": "Der Nachname"
            },
            "gender": {
              "type": [
                "string",
                "null"
              ],
              "description": "Das Geschlecht, entweder `male` (männlich) oder `female` (weiblic)"
            },
            "email": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die E-Mail Adresse"
            },
            "birthday": {
              "type": [
                "string",
                "null"
              ],
              "description": "Geburtstag im Format YYYY-MM-DD"
            },
            "timezone": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die eingestellte Zeitzone des Users"
            },
            "created_at": {
              "type": [
                "string",
                "null"
              ],
              "description": "Zeitpunkt der Registrierung als ISO-8601"
            },
            "last_login": {
              "type": [
                "string",
                "null"
              ],
              "description": "Zeitpunkt des letzten Logins als ISO-8601"
            },
            "zip": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die Postleitzahl"
            },
            "city": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die Stadt"
            },
            "contact_homepage": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die Webseite des Users"
            },
            "contact_twitter": {
              "type": [
                "string",
                "null"
              ],
              "description": "Der Twitter-Username des Users"
            },
            "description_text": {
              "type": [
                "string",
                "null"
              ],
              "description": "Eine sonstige Beschreibung des Users"
            },
            "description_character": {
              "type": [
                "string",
                "null"
              ],
              "description": "Eine eigene Charakter-Beschreibung des Users"
            },
            "description_jesus": {
              "type": [
                "string",
                "null"
              ],
              "description": "\"Was ich von Jesus halte\""
            },
            "description_job": {
              "type": [
                "string",
                "null"
              ],
              "description": "Der Beruf"
            },
            "description_hobbies": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die Hobbies"
            },
            "description_motto": {
              "type": [
                "string",
                "null"
              ],
              "description": "Das Lebensmotto"
            },
            "description_food": {
              "type": [
                "string",
                "null"
              ],
              "description": "Das Lieblingsessen des Users"
            },
            "description_links": {
              "type": [
                "string",
                "null"
              ],
              "description": "Eine Empfehlung von Links des Users"
            },
            "picture_thumb_url": {
              "type": "string",
              "description": "Url zum Profilbild (Thumbnail)"
            },
            "picture_url": {
              "type": "string",
              "description": "Url zum Profilbild (Vollbild)"
            },
            "picture_description": {
              "type": [
                "string",
                "null"
              ],
              "description": "Eine Beschreibung des Profilbildes"
            }
          }
        },
        "links": {
          "type": "object",
          "properties": {
            "self": {
              "type": "string",
              "description": "Der Link zu dieser Resource"
            }
          }
        },
        "relationships": {
          "type": "object",
          "properties": {
            "friends": {
              "type": "object",
              "properties": {
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Die Friends des Users"
            },
            "posts": {
              "type": "object",
              "properties": {
                "data": {
                  "type": "array"
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Die Posts auf der Pinnwand des Users"
            }
          }
        }
      }
    }
  }
}

To-User Relationship

To-User Relationship zu einem Friend abrufen
GET/friends/{friend_id}/relationships/to

Example URI

GET https://api.youthweb.net/friends/45678/relationships/to
URI Parameters
HideShow
friend_id
string (required) Example: 45678

ID of the friend

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "data": {
    "type": "users",
    "id": "123456"
  },
  "links": {
    "self": "/friends/45678/relationships/to",
    "related": "/friends/45678/from"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string",
          "description": "Die User-ID"
        }
      }
    },
    "links": {
      "type": "object",
      "properties": {
        "self": {
          "type": "string"
        },
        "related": {
          "type": "string"
        }
      }
    }
  }
}

Posts

Post

Daten zu einem Post abrufen
GET/posts/{post_id}{?include}

Example URI

GET https://api.youthweb.net/posts/d5a5a2c3-041b-4985-907c-74a2131efc98?include=author,comments,parent
URI Parameters
HideShow
post_id
string (required) Example: d5a5a2c3-041b-4985-907c-74a2131efc98

ID des Posts

include
string (optional) Example: author,comments,parent

Kommagetrente Liste an includes

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "data": {
    "type": "posts",
    "id": "d5a5a2c3-041b-4985-907c-74a2131efc98",
    "attributes": {
      "title": "The post title",
      "content": "Lorem ipsum dolor sit amet, sed libris elaboraret eu.",
      "content_html": "<p>Lorem ipsum dolor sit amet, sed libris elaboraret eu.</p>",
      "view_allowed_for": "users",
      "comments_allowed": true,
      "comments_count": 15,
      "reactions_given": [
        ":+1:"
      ],
      "reactions_count": {
        ":+1:": 1
      },
      "created_at": "2017-01-01T17:51:02+00:00",
      "updated_at": "2017-01-03T13:17:11+00:00"
    },
    "relationships": {
      "author": {
        "data": {
          "type": "users",
          "id": "123456"
        },
        "links": {
          "self": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/relationships/author",
          "related": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/author"
        }
      },
      "comments": {
        "data": [
          {
            "type": "comments",
            "id": "345678"
          }
        ],
        "links": {
          "self": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/relationships/comments",
          "related": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/comments"
        }
      },
      "parent": {
        "data": {
          "type": "users",
          "id": "123456"
        },
        "links": {
          "self": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/relationships/parent",
          "related": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/parent"
        }
      }
    },
    "links": {
      "self": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98"
    }
  },
  "included": [
    {
      "type": "users",
      "id": "123456",
      "attributes": {
        "username": "JohnSmith",
        "first_name": "John",
        "last_name": "Smith",
        "gender": "male",
        "email": "john_smith@example.org",
        "birthday": "1988-03-05",
        "timezone": "Europe/Berlin",
        "created_at": "2006-01-01T20:00:00+00:00",
        "last_login": "2016-01-01T20:00:00+00:00",
        "zip": "12345",
        "city": "Jamestown",
        "contact_homepage": "http://example.org",
        "contact_twitter": "youthweb_dev",
        "description_text": "Lorem ipsum dolor sit amet",
        "description_character": "Lorem ipsum dolor sit amet",
        "description_jesus": "Lorem ipsum dolor sit amet",
        "description_job": "Lorem ipsum dolor sit amet",
        "description_hobbies": "Lorem ipsum dolor sit amet",
        "description_motto": "Lorem ipsum dolor sit amet",
        "description_food": "Lorem ipsum dolor sit amet",
        "description_links": "Lorem ipsum dolor sit amet",
        "picture_thumb_url": "https://youthweb.net/img/steckbriefe/default_pic_m.jpg",
        "picture_url": "https://youthweb.net/img/steckbriefe/default_pic_m.jpg",
        "picture_description": "Lorem ipsum dolor sit amet"
      },
      "links": {
        "self": "/users/123456"
      },
      "relationships": {
        "friends": {
          "links": {
            "self": "/users/123456/relationships/friends",
            "related": "/users/123456/friends"
          }
        },
        "posts": {
          "data": [
            {
              "type": "posts",
              "id": "d5a5a2c3-041b-4985-907c-74a2131efc98"
            }
          ],
          "links": {
            "self": "/users/123456/relationships/posts",
            "related": "/users/123456/posts"
          }
        }
      }
    }
  ],
  "meta": {
    "warnings": [
      "The default inclusion of \"parent\" and \"author\" relationships is deprecated since 0.16 and will be removed in future, use \"?include=author,parent\" in query instead."
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string",
          "description": "Die Post-ID"
        },
        "attributes": {
          "type": "object",
          "properties": {
            "title": {
              "type": "string",
              "description": "Der Title, kann auch leer sein"
            },
            "content": {
              "type": "string",
              "description": "Der Post-Inhalt"
            },
            "content_html": {
              "type": "string",
              "description": "Der Post-Inhalt als HTML"
            },
            "view_allowed_for": {
              "type": "string",
              "description": "Wer kann diesen Post sehen? (`all`, `users`, `friends` oder `authors`)"
            },
            "comments_allowed": {
              "type": "boolean",
              "description": "Kann dieser Post kommentiert werden?"
            },
            "comments_count": {
              "type": "number",
              "description": "Die Gesamtanzahl der Kommentare zu diesem Post"
            },
            "reactions_given": {
              "type": "array",
              "description": "Die vom authorisierten User vergebenen Reaktionen zu diesem Post"
            },
            "reactions_count": {
              "type": "object",
              "properties": {
                ":+1:": {
                  "type": "number"
                }
              },
              "description": "Vergebene Reaktionen und deren Anzahl zu diesem Post"
            },
            "created_at": {
              "type": "string",
              "description": "Zeitpunkt der Erstellung als ISO-8601"
            },
            "updated_at": {
              "type": [
                "string",
                "null"
              ],
              "description": "Zeitpunkt der letzten Änderung als ISO-8601"
            }
          }
        },
        "relationships": {
          "type": "object",
          "properties": {
            "author": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "data": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string",
                      "description": "Die User-ID"
                    }
                  }
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Der Autor des Posts"
            },
            "comments": {
              "type": "object",
              "properties": {
                "data": {
                  "type": "array"
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Die Kommentare zu diesem Post"
            },
            "parent": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "data": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string",
                      "description": "Die User-ID"
                    }
                  }
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Das Elternobjekt, dem dieser Post zugeordnet ist"
            }
          }
        },
        "links": {
          "type": "object",
          "properties": {
            "self": {
              "type": "string",
              "description": "Der Link zu dieser Resource"
            }
          }
        }
      }
    },
    "included": {
      "type": "array"
    },
    "meta": {
      "type": "object",
      "properties": {
        "warnings": {
          "type": "array"
        }
      }
    }
  }
}
Request
HideShow

Fehler: Request a forbidden post

Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Response  403
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "errors": [
    {
      "status": "403",
      "title": "Forbidden"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    }
  }
}
Request
HideShow

Fehler: Request a not existing post

Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Response  404
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "errors": [
    {
      "status": "404",
      "title": "Resource not found"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    }
  }
}

Einen Post updaten
PATCH/posts/{post_id}{?include}

Example URI

PATCH https://api.youthweb.net/posts/d5a5a2c3-041b-4985-907c-74a2131efc98?include=author,comments,parent
URI Parameters
HideShow
post_id
string (required) Example: d5a5a2c3-041b-4985-907c-74a2131efc98

ID des Posts

include
string (optional) Example: author,comments,parent

Kommagetrente Liste an includes

Request
HideShow

Der eigene Post kann bearbeitet werden

Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Body
{
  "data": {
    "type": "posts",
    "id": "d5a5a2c3-041b-4985-907c-74a2131efc98",
    "attributes": {
      "title": "The new post title",
      "content": "New post content",
      "reactions_given": [
        ":+1:"
      ]
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "data": {
    "type": "posts",
    "id": "d5a5a2c3-041b-4985-907c-74a2131efc98",
    "attributes": {
      "title": "The new post title",
      "content": "New post content",
      "content_html": "<p>New post content</p>",
      "view_allowed_for": "users",
      "comments_allowed": true,
      "comments_count": 15,
      "reactions_given": [
        ":+1:"
      ],
      "reactions_count": {
        ":+1:": 1
      },
      "created_at": "2017-01-01T17:51:02+00:00",
      "updated_at": "2017-01-03T13:17:11+00:00"
    },
    "relationships": {
      "author": {
        "data": {
          "type": "users",
          "id": "123456"
        },
        "links": {
          "self": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/relationships/author",
          "related": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/author"
        }
      },
      "comments": {
        "data": [
          {
            "type": "comments",
            "id": "345678"
          }
        ],
        "links": {
          "self": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/relationships/comments",
          "related": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/comments"
        }
      },
      "parent": {
        "data": {
          "type": "users",
          "id": "123456"
        },
        "links": {
          "self": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/relationships/parent",
          "related": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/parent"
        }
      }
    },
    "links": {
      "self": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98"
    },
    "meta": {
      "warnings": [
        "The default inclusion of \"parent\" and \"author\" relationships is deprecated since 0.16 and will be removed in future, use \"?include=author,parent\" in query instead."
      ]
    }
  },
  "included": [
    {
      "type": "users",
      "id": "123456",
      "attributes": {
        "username": "JohnSmith",
        "first_name": "John",
        "last_name": "Smith",
        "gender": "male",
        "email": "john_smith@example.org",
        "birthday": "1988-03-05",
        "timezone": "Europe/Berlin",
        "created_at": "2006-01-01T20:00:00+00:00",
        "last_login": "2016-01-01T20:00:00+00:00",
        "zip": "12345",
        "city": "Jamestown",
        "contact_homepage": "http://example.org",
        "contact_twitter": "youthweb_dev",
        "description_text": "Lorem ipsum dolor sit amet",
        "description_character": "Lorem ipsum dolor sit amet",
        "description_jesus": "Lorem ipsum dolor sit amet",
        "description_job": "Lorem ipsum dolor sit amet",
        "description_hobbies": "Lorem ipsum dolor sit amet",
        "description_motto": "Lorem ipsum dolor sit amet",
        "description_food": "Lorem ipsum dolor sit amet",
        "description_links": "Lorem ipsum dolor sit amet",
        "picture_thumb_url": "https://youthweb.net/img/steckbriefe/default_pic_m.jpg",
        "picture_url": "https://youthweb.net/img/steckbriefe/default_pic_m.jpg",
        "picture_description": "Lorem ipsum dolor sit amet"
      },
      "links": {
        "self": "/users/123456"
      },
      "relationships": {
        "friends": {
          "links": {
            "self": "/users/123456/relationships/friends",
            "related": "/users/123456/friends"
          }
        },
        "posts": {
          "data": [
            {
              "type": "posts",
              "id": "d5a5a2c3-041b-4985-907c-74a2131efc98"
            }
          ],
          "links": {
            "self": "/users/123456/relationships/posts",
            "related": "/users/123456/posts"
          }
        }
      }
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string",
          "description": "Die Post-ID"
        },
        "attributes": {
          "type": "object",
          "properties": {
            "title": {
              "type": "string",
              "description": "Der Title, kann auch leer sein"
            },
            "content": {
              "type": "string",
              "description": "Der Post-Inhalt"
            },
            "content_html": {
              "type": "string",
              "description": "Der Post-Inhalt als HTML"
            },
            "view_allowed_for": {
              "type": "string",
              "description": "Wer kann diesen Post sehen? (`all`, `users`, `friends` oder `authors`)"
            },
            "comments_allowed": {
              "type": "boolean",
              "description": "Kann dieser Post kommentiert werden?"
            },
            "comments_count": {
              "type": "number",
              "description": "Die Gesamtanzahl der Kommentare zu diesem Post"
            },
            "reactions_given": {
              "type": "array",
              "description": "Die vom authorisierten User vergebenen Reaktionen zu diesem Post"
            },
            "reactions_count": {
              "type": "object",
              "properties": {
                ":+1:": {
                  "type": "number"
                }
              },
              "description": "Vergebene Reaktionen und deren Anzahl zu diesem Post"
            },
            "created_at": {
              "type": "string",
              "description": "Zeitpunkt der Erstellung als ISO-8601"
            },
            "updated_at": {
              "type": [
                "string",
                "null"
              ],
              "description": "Zeitpunkt der letzten Änderung als ISO-8601"
            }
          }
        },
        "relationships": {
          "type": "object",
          "properties": {
            "author": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "data": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string",
                      "description": "Die User-ID"
                    }
                  }
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Der Autor des Posts"
            },
            "comments": {
              "type": "object",
              "properties": {
                "data": {
                  "type": "array"
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Die Kommentare zu diesem Post"
            },
            "parent": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "data": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string",
                      "description": "Die User-ID"
                    }
                  }
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Das Elternobjekt, dem dieser Post zugeordnet ist"
            }
          }
        },
        "links": {
          "type": "object",
          "properties": {
            "self": {
              "type": "string",
              "description": "Der Link zu dieser Resource"
            }
          }
        },
        "meta": {
          "type": "object",
          "properties": {
            "warnings": {
              "type": "array"
            }
          }
        }
      }
    },
    "included": {
      "type": "array"
    }
  }
}
Request
HideShow

Bei einen fremden Post kann nur die gegebenen Reactions bearbeitet werden

Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_token_of_bob
Body
{
  "data": {
    "type": "posts",
    "id": "d5a5a2c3-041b-4985-907c-74a2131efc98",
    "attributes": {
      "reactions_given": [
        ":+1:"
      ]
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "data": {
    "type": "posts",
    "id": "d5a5a2c3-041b-4985-907c-74a2131efc98",
    "attributes": {
      "title": "title",
      "content": "post content",
      "content_html": "<p>Lorem ipsum dolor sit amet, sed libris elaboraret eu.</p>",
      "view_allowed_for": "users",
      "comments_allowed": true,
      "comments_count": 15,
      "reactions_given": [
        ":+1:"
      ],
      "reactions_count": {
        ":+1:": 1
      },
      "created_at": "2017-01-01T17:51:02+00:00",
      "updated_at": "2017-01-03T13:17:11+00:00"
    },
    "relationships": {
      "author": {
        "data": {
          "type": "users",
          "id": "123456"
        },
        "links": {
          "self": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/relationships/author",
          "related": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/author"
        }
      },
      "comments": {
        "data": [
          {
            "type": "comments",
            "id": "345678"
          }
        ],
        "links": {
          "self": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/relationships/comments",
          "related": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/comments"
        }
      },
      "parent": {
        "data": {
          "type": "users",
          "id": "123456"
        },
        "links": {
          "self": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/relationships/parent",
          "related": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/parent"
        }
      }
    },
    "links": {
      "self": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98"
    },
    "meta": {
      "warnings": [
        "The default inclusion of \"parent\" and \"author\" relationships is deprecated since 0.16 and will be removed in future, use \"?include=author,parent\" in query instead."
      ]
    }
  },
  "included": [
    {
      "type": "users",
      "id": "123456",
      "attributes": {
        "username": "JohnSmith",
        "first_name": "John",
        "last_name": "Smith",
        "gender": "male",
        "email": "john_smith@example.org",
        "birthday": "1988-03-05",
        "timezone": "Europe/Berlin",
        "created_at": "2006-01-01T20:00:00+00:00",
        "last_login": "2016-01-01T20:00:00+00:00",
        "zip": "12345",
        "city": "Jamestown",
        "contact_homepage": "http://example.org",
        "contact_twitter": "youthweb_dev",
        "description_text": "Lorem ipsum dolor sit amet",
        "description_character": "Lorem ipsum dolor sit amet",
        "description_jesus": "Lorem ipsum dolor sit amet",
        "description_job": "Lorem ipsum dolor sit amet",
        "description_hobbies": "Lorem ipsum dolor sit amet",
        "description_motto": "Lorem ipsum dolor sit amet",
        "description_food": "Lorem ipsum dolor sit amet",
        "description_links": "Lorem ipsum dolor sit amet",
        "picture_thumb_url": "https://youthweb.net/img/steckbriefe/default_pic_m.jpg",
        "picture_url": "https://youthweb.net/img/steckbriefe/default_pic_m.jpg",
        "picture_description": "Lorem ipsum dolor sit amet"
      },
      "links": {
        "self": "/users/123456"
      },
      "relationships": {
        "friends": {
          "links": {
            "self": "/users/123456/relationships/friends",
            "related": "/users/123456/friends"
          }
        },
        "posts": {
          "data": [
            {
              "type": "posts",
              "id": "d5a5a2c3-041b-4985-907c-74a2131efc98"
            }
          ],
          "links": {
            "self": "/users/123456/relationships/posts",
            "related": "/users/123456/posts"
          }
        }
      }
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string",
          "description": "Die Post-ID"
        },
        "attributes": {
          "type": "object",
          "properties": {
            "title": {
              "type": "string",
              "description": "Der Title, kann auch leer sein"
            },
            "content": {
              "type": "string",
              "description": "Der Post-Inhalt"
            },
            "content_html": {
              "type": "string",
              "description": "Der Post-Inhalt als HTML"
            },
            "view_allowed_for": {
              "type": "string",
              "description": "Wer kann diesen Post sehen? (`all`, `users`, `friends` oder `authors`)"
            },
            "comments_allowed": {
              "type": "boolean",
              "description": "Kann dieser Post kommentiert werden?"
            },
            "comments_count": {
              "type": "number",
              "description": "Die Gesamtanzahl der Kommentare zu diesem Post"
            },
            "reactions_given": {
              "type": "array",
              "description": "Die vom authorisierten User vergebenen Reaktionen zu diesem Post"
            },
            "reactions_count": {
              "type": "object",
              "properties": {
                ":+1:": {
                  "type": "number"
                }
              },
              "description": "Vergebene Reaktionen und deren Anzahl zu diesem Post"
            },
            "created_at": {
              "type": "string",
              "description": "Zeitpunkt der Erstellung als ISO-8601"
            },
            "updated_at": {
              "type": [
                "string",
                "null"
              ],
              "description": "Zeitpunkt der letzten Änderung als ISO-8601"
            }
          }
        },
        "relationships": {
          "type": "object",
          "properties": {
            "author": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "data": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string",
                      "description": "Die User-ID"
                    }
                  }
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Der Autor des Posts"
            },
            "comments": {
              "type": "object",
              "properties": {
                "data": {
                  "type": "array"
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Die Kommentare zu diesem Post"
            },
            "parent": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "data": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string",
                      "description": "Die User-ID"
                    }
                  }
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Das Elternobjekt, dem dieser Post zugeordnet ist"
            }
          }
        },
        "links": {
          "type": "object",
          "properties": {
            "self": {
              "type": "string",
              "description": "Der Link zu dieser Resource"
            }
          }
        },
        "meta": {
          "type": "object",
          "properties": {
            "warnings": {
              "type": "array"
            }
          }
        }
      }
    },
    "included": {
      "type": "array"
    }
  }
}
Request
HideShow

Titel und Content in einem fremden Post zu bearbeiten gibt Fehler zurück.

Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_token_of_bob
Body
{
  "data": {
    "type": "posts",
    "id": "d5a5a2c3-041b-4985-907c-74a2131efc98",
    "attributes": {
      "title": "The new post title",
      "content": "New post content",
      "reactions_given": [
        ":+1:"
      ]
    }
  }
}
Response  400
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "errors": [
    {
      "status": "409",
      "title": "Request body has invalid attributes",
      "detail": "Matched a schema which it should not",
      "source": {
        "pointer": "data.attributes.title"
      }
    },
    {
      "status": "409",
      "title": "Request body has invalid attributes",
      "detail": "Matched a schema which it should not",
      "source": {
        "pointer": "data.attributes.content"
      }
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    }
  }
}
Request
HideShow

Einen Post zu bearbeiten, wenn man nicht eingeloggt ist, gibt einen Fehler zurück.

Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "data": {
    "type": "posts",
    "id": "d5a5a2c3-041b-4985-907c-74a2131efc98",
    "attributes": {
      "title": "The new post title",
      "content": "New post content",
      "reactions_given": [
        ":+1:"
      ]
    }
  }
}
Response  401
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "errors": [
    {
      "status": "401",
      "title": "Unauthorized"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    }
  }
}

Post Author

Author zu einem Post abrufen
GET/posts/{post_id}/author

Example URI

GET https://api.youthweb.net/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/author
URI Parameters
HideShow
post_id
string (required) Example: d5a5a2c3-041b-4985-907c-74a2131efc98

ID of the post as a uuid string

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "data": {
    "type": "users",
    "id": "123456",
    "attributes": {
      "username": "JohnSmith",
      "first_name": "John",
      "last_name": "Smith",
      "gender": "male",
      "email": "john_smith@example.org",
      "birthday": "1988-03-05",
      "timezone": "Europe/Berlin",
      "created_at": "2006-01-01T20:00:00+00:00",
      "last_login": "2016-01-01T20:00:00+00:00",
      "zip": "12345",
      "city": "Jamestown",
      "contact_homepage": "http://example.org",
      "contact_twitter": "youthweb_dev",
      "description_text": "Lorem ipsum dolor sit amet",
      "description_character": "Lorem ipsum dolor sit amet",
      "description_jesus": "Lorem ipsum dolor sit amet",
      "description_job": "Lorem ipsum dolor sit amet",
      "description_hobbies": "Lorem ipsum dolor sit amet",
      "description_motto": "Lorem ipsum dolor sit amet",
      "description_food": "Lorem ipsum dolor sit amet",
      "description_links": "Lorem ipsum dolor sit amet",
      "picture_thumb_url": "https://youthweb.net/img/steckbriefe/default_pic_m.jpg",
      "picture_url": "https://youthweb.net/img/steckbriefe/default_pic_m.jpg",
      "picture_description": "Lorem ipsum dolor sit amet"
    },
    "links": {
      "self": "/users/123456"
    },
    "relationships": {
      "friends": {
        "links": {
          "self": "/users/123456/relationships/friends",
          "related": "/users/123456/friends"
        }
      },
      "posts": {
        "data": [
          {
            "type": "posts",
            "id": "d5a5a2c3-041b-4985-907c-74a2131efc98"
          }
        ],
        "links": {
          "self": "/users/123456/relationships/posts",
          "related": "/users/123456/posts"
        }
      }
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string",
          "description": "Die User-ID"
        },
        "attributes": {
          "type": "object",
          "properties": {
            "username": {
              "type": "string",
              "description": "Der Username"
            },
            "first_name": {
              "type": [
                "string",
                "null"
              ],
              "description": "Der Vorname"
            },
            "last_name": {
              "type": [
                "string",
                "null"
              ],
              "description": "Der Nachname"
            },
            "gender": {
              "type": [
                "string",
                "null"
              ],
              "description": "Das Geschlecht, entweder `male` (männlich) oder `female` (weiblic)"
            },
            "email": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die E-Mail Adresse"
            },
            "birthday": {
              "type": [
                "string",
                "null"
              ],
              "description": "Geburtstag im Format YYYY-MM-DD"
            },
            "timezone": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die eingestellte Zeitzone des Users"
            },
            "created_at": {
              "type": [
                "string",
                "null"
              ],
              "description": "Zeitpunkt der Registrierung als ISO-8601"
            },
            "last_login": {
              "type": [
                "string",
                "null"
              ],
              "description": "Zeitpunkt des letzten Logins als ISO-8601"
            },
            "zip": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die Postleitzahl"
            },
            "city": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die Stadt"
            },
            "contact_homepage": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die Webseite des Users"
            },
            "contact_twitter": {
              "type": [
                "string",
                "null"
              ],
              "description": "Der Twitter-Username des Users"
            },
            "description_text": {
              "type": [
                "string",
                "null"
              ],
              "description": "Eine sonstige Beschreibung des Users"
            },
            "description_character": {
              "type": [
                "string",
                "null"
              ],
              "description": "Eine eigene Charakter-Beschreibung des Users"
            },
            "description_jesus": {
              "type": [
                "string",
                "null"
              ],
              "description": "\"Was ich von Jesus halte\""
            },
            "description_job": {
              "type": [
                "string",
                "null"
              ],
              "description": "Der Beruf"
            },
            "description_hobbies": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die Hobbies"
            },
            "description_motto": {
              "type": [
                "string",
                "null"
              ],
              "description": "Das Lebensmotto"
            },
            "description_food": {
              "type": [
                "string",
                "null"
              ],
              "description": "Das Lieblingsessen des Users"
            },
            "description_links": {
              "type": [
                "string",
                "null"
              ],
              "description": "Eine Empfehlung von Links des Users"
            },
            "picture_thumb_url": {
              "type": "string",
              "description": "Url zum Profilbild (Thumbnail)"
            },
            "picture_url": {
              "type": "string",
              "description": "Url zum Profilbild (Vollbild)"
            },
            "picture_description": {
              "type": [
                "string",
                "null"
              ],
              "description": "Eine Beschreibung des Profilbildes"
            }
          }
        },
        "links": {
          "type": "object",
          "properties": {
            "self": {
              "type": "string",
              "description": "Der Link zu dieser Resource"
            }
          }
        },
        "relationships": {
          "type": "object",
          "properties": {
            "friends": {
              "type": "object",
              "properties": {
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Die Friends des Users"
            },
            "posts": {
              "type": "object",
              "properties": {
                "data": {
                  "type": "array"
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Die Posts auf der Pinnwand des Users"
            }
          }
        }
      }
    }
  }
}

Post Author Relationship

Author Relationship zu einem Post abrufen
GET/posts/{post_id}/relationships/author

Example URI

GET https://api.youthweb.net/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/relationships/author
URI Parameters
HideShow
post_id
string (required) Example: d5a5a2c3-041b-4985-907c-74a2131efc98

ID of the post as a uuid string

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "data": {
    "type": "users",
    "id": "123456"
  },
  "links": {
    "self": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/relationships/author",
    "related": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/author"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string",
          "description": "Die User-ID"
        }
      }
    },
    "links": {
      "type": "object",
      "properties": {
        "self": {
          "type": "string"
        },
        "related": {
          "type": "string"
        }
      }
    }
  }
}

Post Comments

Kommentare zu einem Post abrufen
GET/posts/{post_id}/comments{?include}

Example URI

GET https://api.youthweb.net/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/comments?include=author,parent
URI Parameters
HideShow
post_id
string (required) Example: d5a5a2c3-041b-4985-907c-74a2131efc98

ID of the post as a uuid string

include
string (optional) Example: author,parent

Kommagetrente Liste an includes, möglich sind author und parent

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "data": [
    {
      "type": "comments",
      "id": "345678",
      "attributes": {
        "content": "Lorem ipsum dolor sit amet, sed libris elaboraret eu.",
        "content_html": "<p>Lorem ipsum dolor sit amet, sed libris elaboraret eu.</p>",
        "created_at": "2017-01-01T17:51:02+00:00"
      },
      "relationships": {
        "author": {
          "links": {
            "self": "/comments/345678/relationships/author",
            "related": "/comments/345678/author"
          }
        },
        "parent": {
          "links": {
            "self": "/comments/345678/relationships/parent",
            "related": "/comments/345678/parent"
          }
        }
      },
      "links": {
        "self": "/comments/345678"
      }
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "array"
    }
  }
}

Comment zu einem Post erstellen
POST/posts/{post_id}/comments{?include}

Example URI

POST https://api.youthweb.net/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/comments?include=author,parent
URI Parameters
HideShow
post_id
string (required) Example: d5a5a2c3-041b-4985-907c-74a2131efc98

ID of the post as a uuid string

include
string (optional) Example: author,parent

Kommagetrente Liste an includes, möglich sind author und parent

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Body
{
  "data": {
    "type": "comments",
    "attributes": {
      "content": "Lorem ipsum dolor sit amet, sed libris elaboraret eu."
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "attributes": {
          "type": "object",
          "properties": {
            "content": {
              "type": "string",
              "description": "Der Post-Inhalt"
            }
          }
        }
      }
    }
  }
}
Response  201
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Location: /comments/98765
Body
{
  "data": {
    "type": "comments",
    "id": "345678",
    "attributes": {
      "content": "Lorem ipsum dolor sit amet, sed libris elaboraret eu.",
      "content_html": "<p>Lorem ipsum dolor sit amet, sed libris elaboraret eu.</p>",
      "created_at": "2017-01-01T17:51:02+00:00"
    },
    "relationships": {
      "author": {
        "links": {
          "self": "/comments/345678/relationships/author",
          "related": "/comments/345678/author"
        }
      },
      "parent": {
        "links": {
          "self": "/comments/345678/relationships/parent",
          "related": "/comments/345678/parent"
        }
      }
    },
    "links": {
      "self": "/comments/345678"
    }
  },
  "links": {
    "self": "/comments/98765"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string",
          "description": "Die Comment-ID"
        },
        "attributes": {
          "type": "object",
          "properties": {
            "content": {
              "type": "string",
              "description": "Der Inhalt des Comments"
            },
            "content_html": {
              "type": "string",
              "description": "Der Inhalt des Comments als HTML"
            },
            "created_at": {
              "type": "string",
              "description": "Zeitpunkt der Erstellung als ISO-8601"
            }
          }
        },
        "relationships": {
          "type": "object",
          "properties": {
            "author": {
              "type": "object",
              "properties": {
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Der Autor des Comments"
            },
            "parent": {
              "type": "object",
              "properties": {
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Das Objekt, das kommentiert wurde"
            }
          }
        },
        "links": {
          "type": "object",
          "properties": {
            "self": {
              "type": "string",
              "description": "Der Link zu dieser Resource"
            }
          }
        }
      }
    },
    "links": {
      "type": "object",
      "properties": {
        "self": {
          "type": "string"
        }
      }
    }
  }
}
Request
HideShow

Fehler: Create a comment on an not existing post

Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Body
{
  "data": {
    "type": "comments",
    "attributes": {
      "content": "Lorem ipsum dolor sit amet, sed libris elaboraret eu."
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "attributes": {
          "type": "object",
          "properties": {
            "content": {
              "type": "string",
              "description": "Der Post-Inhalt"
            }
          }
        }
      }
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "errors": [
    {
      "status": "404",
      "title": "Resource not found"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    }
  }
}
Request
HideShow

Fehler: Create a comment without permission

Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Body
{
  "data": {
    "type": "comments",
    "attributes": {
      "content": "Lorem ipsum dolor sit amet, sed libris elaboraret eu."
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "attributes": {
          "type": "object",
          "properties": {
            "content": {
              "type": "string",
              "description": "Der Post-Inhalt"
            }
          }
        }
      }
    }
  }
}
Response  403
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "errors": [
    {
      "status": "403",
      "title": "Forbidden"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    }
  }
}
Request
HideShow

Fehler: Create a comment with empty content

Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Body
{
  "data": {
    "type": "comments",
    "attributes": {
      "content": "``"
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "attributes": {
          "type": "object",
          "properties": {
            "content": {
              "type": "string",
              "description": "Der Comment-Inhalt"
            }
          }
        }
      }
    }
  }
}
Response  409
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "errors": [
    {
      "status": "409",
      "title": "Request body has invalid attributes",
      "detail": "Must be at least 1 characters long",
      "source": {
        "pointer": "data.attributes.content"
      }
    }
  ]
}
Request
HideShow

Fehler: Create a comment with missing content

Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Body
{
  "data": {
    "type": "comments",
    "attributes": {}
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "attributes": {
          "type": "object",
          "properties": {}
        }
      }
    }
  }
}
Response  409
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "errors": [
    {
      "status": "409",
      "title": "Request body has invalid attributes",
      "detail": "The property content is required",
      "source": {
        "pointer": "data.attributes.content"
      }
    }
  ]
}

Post Comments Relationship

Comments Relationship zu einem Post abrufen
GET/posts/{post_id}/relationships/comments

Example URI

GET https://api.youthweb.net/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/relationships/comments
URI Parameters
HideShow
post_id
string (required) Example: d5a5a2c3-041b-4985-907c-74a2131efc98

ID of the post as a uuid string

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "data": [
    {
      "type": "comments",
      "id": "345678"
    }
  ],
  "links": {
    "self": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/relationships/comments",
    "related": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/comments"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "array"
    },
    "links": {
      "type": "object",
      "properties": {
        "self": {
          "type": "string"
        },
        "related": {
          "type": "string"
        }
      }
    }
  }
}

Post Parent

Elternobjekt zu einem Post abrufen
GET/posts/{post_id}/parent

Example URI

GET https://api.youthweb.net/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/parent
URI Parameters
HideShow
post_id
string (required) Example: d5a5a2c3-041b-4985-907c-74a2131efc98

ID of the post as a uuid string

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "data": {
    "type": "users",
    "id": "123456",
    "attributes": {
      "username": "JohnSmith",
      "first_name": "John",
      "last_name": "Smith",
      "gender": "male",
      "email": "john_smith@example.org",
      "birthday": "1988-03-05",
      "timezone": "Europe/Berlin",
      "created_at": "2006-01-01T20:00:00+00:00",
      "last_login": "2016-01-01T20:00:00+00:00",
      "zip": "12345",
      "city": "Jamestown",
      "contact_homepage": "http://example.org",
      "contact_twitter": "youthweb_dev",
      "description_text": "Lorem ipsum dolor sit amet",
      "description_character": "Lorem ipsum dolor sit amet",
      "description_jesus": "Lorem ipsum dolor sit amet",
      "description_job": "Lorem ipsum dolor sit amet",
      "description_hobbies": "Lorem ipsum dolor sit amet",
      "description_motto": "Lorem ipsum dolor sit amet",
      "description_food": "Lorem ipsum dolor sit amet",
      "description_links": "Lorem ipsum dolor sit amet",
      "picture_thumb_url": "https://youthweb.net/img/steckbriefe/default_pic_m.jpg",
      "picture_url": "https://youthweb.net/img/steckbriefe/default_pic_m.jpg",
      "picture_description": "Lorem ipsum dolor sit amet"
    },
    "links": {
      "self": "/users/123456"
    },
    "relationships": {
      "friends": {
        "links": {
          "self": "/users/123456/relationships/friends",
          "related": "/users/123456/friends"
        }
      },
      "posts": {
        "data": [
          {
            "type": "posts",
            "id": "d5a5a2c3-041b-4985-907c-74a2131efc98"
          }
        ],
        "links": {
          "self": "/users/123456/relationships/posts",
          "related": "/users/123456/posts"
        }
      }
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string",
          "description": "Die User-ID"
        },
        "attributes": {
          "type": "object",
          "properties": {
            "username": {
              "type": "string",
              "description": "Der Username"
            },
            "first_name": {
              "type": [
                "string",
                "null"
              ],
              "description": "Der Vorname"
            },
            "last_name": {
              "type": [
                "string",
                "null"
              ],
              "description": "Der Nachname"
            },
            "gender": {
              "type": [
                "string",
                "null"
              ],
              "description": "Das Geschlecht, entweder `male` (männlich) oder `female` (weiblic)"
            },
            "email": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die E-Mail Adresse"
            },
            "birthday": {
              "type": [
                "string",
                "null"
              ],
              "description": "Geburtstag im Format YYYY-MM-DD"
            },
            "timezone": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die eingestellte Zeitzone des Users"
            },
            "created_at": {
              "type": [
                "string",
                "null"
              ],
              "description": "Zeitpunkt der Registrierung als ISO-8601"
            },
            "last_login": {
              "type": [
                "string",
                "null"
              ],
              "description": "Zeitpunkt des letzten Logins als ISO-8601"
            },
            "zip": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die Postleitzahl"
            },
            "city": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die Stadt"
            },
            "contact_homepage": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die Webseite des Users"
            },
            "contact_twitter": {
              "type": [
                "string",
                "null"
              ],
              "description": "Der Twitter-Username des Users"
            },
            "description_text": {
              "type": [
                "string",
                "null"
              ],
              "description": "Eine sonstige Beschreibung des Users"
            },
            "description_character": {
              "type": [
                "string",
                "null"
              ],
              "description": "Eine eigene Charakter-Beschreibung des Users"
            },
            "description_jesus": {
              "type": [
                "string",
                "null"
              ],
              "description": "\"Was ich von Jesus halte\""
            },
            "description_job": {
              "type": [
                "string",
                "null"
              ],
              "description": "Der Beruf"
            },
            "description_hobbies": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die Hobbies"
            },
            "description_motto": {
              "type": [
                "string",
                "null"
              ],
              "description": "Das Lebensmotto"
            },
            "description_food": {
              "type": [
                "string",
                "null"
              ],
              "description": "Das Lieblingsessen des Users"
            },
            "description_links": {
              "type": [
                "string",
                "null"
              ],
              "description": "Eine Empfehlung von Links des Users"
            },
            "picture_thumb_url": {
              "type": "string",
              "description": "Url zum Profilbild (Thumbnail)"
            },
            "picture_url": {
              "type": "string",
              "description": "Url zum Profilbild (Vollbild)"
            },
            "picture_description": {
              "type": [
                "string",
                "null"
              ],
              "description": "Eine Beschreibung des Profilbildes"
            }
          }
        },
        "links": {
          "type": "object",
          "properties": {
            "self": {
              "type": "string",
              "description": "Der Link zu dieser Resource"
            }
          }
        },
        "relationships": {
          "type": "object",
          "properties": {
            "friends": {
              "type": "object",
              "properties": {
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Die Friends des Users"
            },
            "posts": {
              "type": "object",
              "properties": {
                "data": {
                  "type": "array"
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Die Posts auf der Pinnwand des Users"
            }
          }
        }
      }
    }
  }
}

Post Parent Relationship

Parent Relationship zu einem Post abrufen
GET/posts/{post_id}/relationships/parent

Example URI

GET https://api.youthweb.net/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/relationships/parent
URI Parameters
HideShow
post_id
string (required) Example: d5a5a2c3-041b-4985-907c-74a2131efc98

ID of the post as a uuid string

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "data": {
    "type": "users",
    "id": "123456"
  },
  "links": {
    "self": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/relationships/parent",
    "related": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/parent"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string",
          "description": "Die User-ID"
        }
      }
    },
    "links": {
      "type": "object",
      "properties": {
        "self": {
          "type": "string"
        },
        "related": {
          "type": "string"
        }
      }
    }
  }
}

Timeline-Entries

Timeline-Entries

Globale Timeline-Entries abrufen
GET/timeline-entries{?include}

Liefert die Einträge für die globale Timeline.

Example URI

GET https://api.youthweb.net/timeline-entries?include=origin.author,origin.comments.author
URI Parameters
HideShow
page[limit]
number (optional) Default: 5 Example: 10

Limit the entries

page[cursor]
string (optional) Example: 2021-02-24T13:51:26Z

DateTime des zuletzt geladenen Entry, damit die Entries geladen, die älter sind als die angegebene DateTime

Deprecated seit 0.19: Timestamp (als number) der zuletzt geladenen Entry, damit als nächstes die Entries geladen, die älter sind

include
string (optional) Example: origin.author,origin.comments.author

Kommagetrente Liste an includes

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "data": [
    {
      "type": "timeline-entries",
      "id": "80c1e6e3-a773-4cce-a5e1-1cc05f818db7",
      "relationships": {
        "origin": {
          "data": {
            "type": "posts",
            "id": "d5a5a2c3-041b-4985-907c-74a2131efc98"
          }
        }
      },
      "links": {
        "self": "/timeline-entries/80c1e6e3-a773-4cce-a5e1-1cc05f818db7"
      }
    },
    {
      "type": "timeline-entries",
      "id": "80c1e6e3-a773-4cce-a5e1-1cc05f818db7",
      "relationships": {
        "origin": {
          "data": {
            "type": "posts",
            "id": "d5a5a2c3-041b-4985-907c-74a2131efc98"
          }
        }
      },
      "links": {
        "self": "/timeline-entries/80c1e6e3-a773-4cce-a5e1-1cc05f818db7"
      }
    }
  ],
  "links": {
    "first": "/timeline-entries",
    "next": "/timeline-entries?page%5Bcursor%5D=2017-01-01T17%3A51%3A02%2B00%3A00"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "array"
    },
    "links": {
      "type": "object",
      "properties": {
        "first": {
          "type": "string"
        },
        "next": {
          "type": "string"
        }
      }
    }
  }
}
Request
HideShow

Als unauthorisierter User kann man keine Timeline abfragen

Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Response  401
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "errors": [
    {
      "status": "401",
      "title": "Unauthorized"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    }
  }
}

Timeline-Entry

Einen Timeline-Entry abrufen
GET/timeline-entries/{entry_id}{?include}

Liefert einen Eintrag

Example URI

GET https://api.youthweb.net/timeline-entries/entry_id?include=origin.author,origin.comments.author
URI Parameters
HideShow
entry_id
string (required) 

Uuid des Timeline-Entry

include
string (optional) Example: origin.author,origin.comments.author

Kommagetrente Liste an includes

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "data": {
    "type": "timeline-entries",
    "id": "80c1e6e3-a773-4cce-a5e1-1cc05f818db7",
    "relationships": {
      "origin": {
        "data": {
          "type": "posts",
          "id": "d5a5a2c3-041b-4985-907c-74a2131efc98"
        }
      }
    },
    "links": {
      "self": "/timeline-entries/80c1e6e3-a773-4cce-a5e1-1cc05f818db7"
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "relationships": {
          "type": "object",
          "properties": {
            "origin": {
              "type": "object",
              "properties": {
                "data": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string",
                      "description": "Die Post-ID"
                    }
                  }
                }
              }
            }
          }
        },
        "links": {
          "type": "object",
          "properties": {
            "self": {
              "type": "string",
              "description": "Der Link zu dieser Resource"
            }
          }
        }
      }
    }
  }
}

Die Timeline-Entries eines Users

Die Timeline-Entries eines Users abrufen
GET/users/{user_id}/timeline-entries

Liefert die Einträge für die Timeline eines Users

Example URI

GET https://api.youthweb.net/users/user_id/timeline-entries
URI Parameters
HideShow
user_id
number (required) 

ID of the user

page[cursor]
string (optional) Example: 2021-02-24T13:51:26Z

DateTime des zuletzt geladenen Entry, damit die Entries geladen, die älter sind als die angegebene DateTime

Deprecated seit 0.19: Timestamp (als number) der zuletzt geladenen Entry, damit als nächstes die Entries geladen, die älter sind

page[limit]
number (optional) Default: 5 

Limit the entries

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "data": [
    {
      "type": "timeline-entries",
      "id": "80c1e6e3-a773-4cce-a5e1-1cc05f818db7",
      "relationships": {
        "origin": {
          "data": {
            "type": "posts",
            "id": "d5a5a2c3-041b-4985-907c-74a2131efc98"
          }
        }
      },
      "links": {
        "self": "/timeline-entries/80c1e6e3-a773-4cce-a5e1-1cc05f818db7"
      }
    },
    {
      "type": "timeline-entries",
      "id": "80c1e6e3-a773-4cce-a5e1-1cc05f818db7",
      "relationships": {
        "origin": {
          "data": {
            "type": "posts",
            "id": "d5a5a2c3-041b-4985-907c-74a2131efc98"
          }
        }
      },
      "links": {
        "self": "/timeline-entries/80c1e6e3-a773-4cce-a5e1-1cc05f818db7"
      }
    }
  ],
  "links": {
    "first": "/users/{user_id}/timeline-entries",
    "next": "/users/{user_id}/timeline-entries?page%5Bcursor%5D=2017-01-01T17%3A51%3A02%2B00%3A00"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "array"
    },
    "links": {
      "type": "object",
      "properties": {
        "first": {
          "type": "string"
        },
        "next": {
          "type": "string"
        }
      }
    }
  }
}
Request
HideShow

Als unauthorisierter User kann man keine Usertimeline abfragen

Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Response  401
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "errors": [
    {
      "status": "401",
      "title": "Unauthorized"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    }
  }
}
Request
HideShow

Bei einem nicht existenten User kann man keine Daten abfragen

Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Response  404
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "errors": [
    {
      "status": "404",
      "title": "Resource not found"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    }
  }
}

Timeline-Entry Origin

Origin zu einem Timeline-Entry abrufen
GET/timeline-entries/{entry_id}/origin

Example URI

GET https://api.youthweb.net/timeline-entries/entry_id/origin
URI Parameters
HideShow
entry_id
string (required) 

Uuid

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "data": {
    "type": "posts",
    "id": "d5a5a2c3-041b-4985-907c-74a2131efc98",
    "attributes": {
      "title": "The post title",
      "content": "Lorem ipsum dolor sit amet, sed libris elaboraret eu.",
      "content_html": "<p>Lorem ipsum dolor sit amet, sed libris elaboraret eu.</p>",
      "view_allowed_for": "users",
      "comments_allowed": true,
      "comments_count": 15,
      "reactions_given": [
        ":+1:"
      ],
      "reactions_count": {
        ":+1:": 1
      },
      "created_at": "2017-01-01T17:51:02+00:00",
      "updated_at": "2017-01-03T13:17:11+00:00"
    },
    "relationships": {
      "author": {
        "data": {
          "type": "users",
          "id": "123456"
        },
        "links": {
          "self": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/relationships/author",
          "related": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/author"
        }
      },
      "comments": {
        "data": [
          {
            "type": "comments",
            "id": "345678"
          }
        ],
        "links": {
          "self": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/relationships/comments",
          "related": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/comments"
        }
      },
      "parent": {
        "data": {
          "type": "users",
          "id": "123456"
        },
        "links": {
          "self": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/relationships/parent",
          "related": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/parent"
        }
      }
    },
    "links": {
      "self": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98"
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string",
          "description": "Die Post-ID"
        },
        "attributes": {
          "type": "object",
          "properties": {
            "title": {
              "type": "string",
              "description": "Der Title, kann auch leer sein"
            },
            "content": {
              "type": "string",
              "description": "Der Post-Inhalt"
            },
            "content_html": {
              "type": "string",
              "description": "Der Post-Inhalt als HTML"
            },
            "view_allowed_for": {
              "type": "string",
              "description": "Wer kann diesen Post sehen? (`all`, `users`, `friends` oder `authors`)"
            },
            "comments_allowed": {
              "type": "boolean",
              "description": "Kann dieser Post kommentiert werden?"
            },
            "comments_count": {
              "type": "number",
              "description": "Die Gesamtanzahl der Kommentare zu diesem Post"
            },
            "reactions_given": {
              "type": "array",
              "description": "Die vom authorisierten User vergebenen Reaktionen zu diesem Post"
            },
            "reactions_count": {
              "type": "object",
              "properties": {
                ":+1:": {
                  "type": "number"
                }
              },
              "description": "Vergebene Reaktionen und deren Anzahl zu diesem Post"
            },
            "created_at": {
              "type": "string",
              "description": "Zeitpunkt der Erstellung als ISO-8601"
            },
            "updated_at": {
              "type": [
                "string",
                "null"
              ],
              "description": "Zeitpunkt der letzten Änderung als ISO-8601"
            }
          }
        },
        "relationships": {
          "type": "object",
          "properties": {
            "author": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "data": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string",
                      "description": "Die User-ID"
                    }
                  }
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Der Autor des Posts"
            },
            "comments": {
              "type": "object",
              "properties": {
                "data": {
                  "type": "array"
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Die Kommentare zu diesem Post"
            },
            "parent": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "data": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string",
                      "description": "Die User-ID"
                    }
                  }
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Das Elternobjekt, dem dieser Post zugeordnet ist"
            }
          }
        },
        "links": {
          "type": "object",
          "properties": {
            "self": {
              "type": "string",
              "description": "Der Link zu dieser Resource"
            }
          }
        }
      }
    }
  }
}

Timeline-Entry Origin Relationship

Origin Relationship zu einem Timeline-Entry abrufen
GET/timeline-entries/{entry_id}/relationships/origin

Example URI

GET https://api.youthweb.net/timeline-entries/entry_id/relationships/origin
URI Parameters
HideShow
entry_id
string (required) 

Uuid

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "data": {
    "type": "posts",
    "id": "d5a5a2c3-041b-4985-907c-74a2131efc98"
  },
  "links": {
    "self": "/timeline-entries/{entry_id}/relationships/origin",
    "related": "/timeline-entries/{entry_id}/origin"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string",
          "description": "Die Post-ID"
        }
      }
    },
    "links": {
      "type": "object",
      "properties": {
        "self": {
          "type": "string"
        },
        "related": {
          "type": "string"
        }
      }
    }
  }
}

Users

Me

Daten zum autorisierten User abrufen
GET/me

Fragt die Userdaten des autorisierten Users ab. Dies ist ein Shortcut für /users/{user_id}, wenn die User-ID des autorisierten Users nicht bekannt ist.

Example URI

GET https://api.youthweb.net/me
Request
HideShow

Daten als authorisierten User können abgefragt werden

Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "data": {
    "type": "users",
    "id": "123456",
    "attributes": {
      "username": "JohnSmith",
      "first_name": "John",
      "last_name": "Smith",
      "gender": "male",
      "email": "john_smith@example.org",
      "birthday": "1988-03-05",
      "timezone": "Europe/Berlin",
      "created_at": "2006-01-01T20:00:00+00:00",
      "last_login": "2016-01-01T20:00:00+00:00",
      "zip": "12345",
      "city": "Jamestown",
      "contact_homepage": "http://example.org",
      "contact_twitter": "youthweb_dev",
      "description_text": "Lorem ipsum dolor sit amet",
      "description_character": "Lorem ipsum dolor sit amet",
      "description_jesus": "Lorem ipsum dolor sit amet",
      "description_job": "Lorem ipsum dolor sit amet",
      "description_hobbies": "Lorem ipsum dolor sit amet",
      "description_motto": "Lorem ipsum dolor sit amet",
      "description_food": "Lorem ipsum dolor sit amet",
      "description_links": "Lorem ipsum dolor sit amet",
      "picture_thumb_url": "https://youthweb.net/img/steckbriefe/default_pic_m.jpg",
      "picture_url": "https://youthweb.net/img/steckbriefe/default_pic_m.jpg",
      "picture_description": "Lorem ipsum dolor sit amet"
    },
    "links": {
      "self": "/users/123456"
    },
    "relationships": {
      "friends": {
        "links": {
          "self": "/users/123456/relationships/friends",
          "related": "/users/123456/friends"
        }
      },
      "posts": {
        "data": [
          {
            "type": "posts",
            "id": "d5a5a2c3-041b-4985-907c-74a2131efc98"
          }
        ],
        "links": {
          "self": "/users/123456/relationships/posts",
          "related": "/users/123456/posts"
        }
      }
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string",
          "description": "Die User-ID"
        },
        "attributes": {
          "type": "object",
          "properties": {
            "username": {
              "type": "string",
              "description": "Der Username"
            },
            "first_name": {
              "type": [
                "string",
                "null"
              ],
              "description": "Der Vorname"
            },
            "last_name": {
              "type": [
                "string",
                "null"
              ],
              "description": "Der Nachname"
            },
            "gender": {
              "type": [
                "string",
                "null"
              ],
              "description": "Das Geschlecht, entweder `male` (männlich) oder `female` (weiblic)"
            },
            "email": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die E-Mail Adresse"
            },
            "birthday": {
              "type": [
                "string",
                "null"
              ],
              "description": "Geburtstag im Format YYYY-MM-DD"
            },
            "timezone": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die eingestellte Zeitzone des Users"
            },
            "created_at": {
              "type": [
                "string",
                "null"
              ],
              "description": "Zeitpunkt der Registrierung als ISO-8601"
            },
            "last_login": {
              "type": [
                "string",
                "null"
              ],
              "description": "Zeitpunkt des letzten Logins als ISO-8601"
            },
            "zip": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die Postleitzahl"
            },
            "city": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die Stadt"
            },
            "contact_homepage": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die Webseite des Users"
            },
            "contact_twitter": {
              "type": [
                "string",
                "null"
              ],
              "description": "Der Twitter-Username des Users"
            },
            "description_text": {
              "type": [
                "string",
                "null"
              ],
              "description": "Eine sonstige Beschreibung des Users"
            },
            "description_character": {
              "type": [
                "string",
                "null"
              ],
              "description": "Eine eigene Charakter-Beschreibung des Users"
            },
            "description_jesus": {
              "type": [
                "string",
                "null"
              ],
              "description": "\"Was ich von Jesus halte\""
            },
            "description_job": {
              "type": [
                "string",
                "null"
              ],
              "description": "Der Beruf"
            },
            "description_hobbies": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die Hobbies"
            },
            "description_motto": {
              "type": [
                "string",
                "null"
              ],
              "description": "Das Lebensmotto"
            },
            "description_food": {
              "type": [
                "string",
                "null"
              ],
              "description": "Das Lieblingsessen des Users"
            },
            "description_links": {
              "type": [
                "string",
                "null"
              ],
              "description": "Eine Empfehlung von Links des Users"
            },
            "picture_thumb_url": {
              "type": "string",
              "description": "Url zum Profilbild (Thumbnail)"
            },
            "picture_url": {
              "type": "string",
              "description": "Url zum Profilbild (Vollbild)"
            },
            "picture_description": {
              "type": [
                "string",
                "null"
              ],
              "description": "Eine Beschreibung des Profilbildes"
            }
          }
        },
        "links": {
          "type": "object",
          "properties": {
            "self": {
              "type": "string",
              "description": "Der Link zu dieser Resource"
            }
          }
        },
        "relationships": {
          "type": "object",
          "properties": {
            "friends": {
              "type": "object",
              "properties": {
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Die Friends des Users"
            },
            "posts": {
              "type": "object",
              "properties": {
                "data": {
                  "type": "array"
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Die Posts auf der Pinnwand des Users"
            }
          }
        }
      }
    }
  }
}
Request
HideShow

Als unauthorisierter User kann man keine Daten abfragen

Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Response  401
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "errors": [
    {
      "status": "401",
      "title": "Unauthorized"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    }
  }
}

User

Daten zu einem User abrufen
GET/users/{user_id}

Example URI

GET https://api.youthweb.net/users/123456
URI Parameters
HideShow
user_id
number (required) Example: 123456

ID of the user in form of an integer

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "data": {
    "type": "users",
    "id": "123456",
    "attributes": {
      "username": "JohnSmith",
      "first_name": "John",
      "last_name": "Smith",
      "gender": "male",
      "email": "john_smith@example.org",
      "birthday": "1988-03-05",
      "timezone": "Europe/Berlin",
      "created_at": "2006-01-01T20:00:00+00:00",
      "last_login": "2016-01-01T20:00:00+00:00",
      "zip": "12345",
      "city": "Jamestown",
      "contact_homepage": "http://example.org",
      "contact_twitter": "youthweb_dev",
      "description_text": "Lorem ipsum dolor sit amet",
      "description_character": "Lorem ipsum dolor sit amet",
      "description_jesus": "Lorem ipsum dolor sit amet",
      "description_job": "Lorem ipsum dolor sit amet",
      "description_hobbies": "Lorem ipsum dolor sit amet",
      "description_motto": "Lorem ipsum dolor sit amet",
      "description_food": "Lorem ipsum dolor sit amet",
      "description_links": "Lorem ipsum dolor sit amet",
      "picture_thumb_url": "https://youthweb.net/img/steckbriefe/default_pic_m.jpg",
      "picture_url": "https://youthweb.net/img/steckbriefe/default_pic_m.jpg",
      "picture_description": "Lorem ipsum dolor sit amet"
    },
    "links": {
      "self": "/users/123456"
    },
    "relationships": {
      "friends": {
        "links": {
          "self": "/users/123456/relationships/friends",
          "related": "/users/123456/friends"
        }
      },
      "posts": {
        "data": [
          {
            "type": "posts",
            "id": "d5a5a2c3-041b-4985-907c-74a2131efc98"
          }
        ],
        "links": {
          "self": "/users/123456/relationships/posts",
          "related": "/users/123456/posts"
        }
      }
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string",
          "description": "Die User-ID"
        },
        "attributes": {
          "type": "object",
          "properties": {
            "username": {
              "type": "string",
              "description": "Der Username"
            },
            "first_name": {
              "type": [
                "string",
                "null"
              ],
              "description": "Der Vorname"
            },
            "last_name": {
              "type": [
                "string",
                "null"
              ],
              "description": "Der Nachname"
            },
            "gender": {
              "type": [
                "string",
                "null"
              ],
              "description": "Das Geschlecht, entweder `male` (männlich) oder `female` (weiblic)"
            },
            "email": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die E-Mail Adresse"
            },
            "birthday": {
              "type": [
                "string",
                "null"
              ],
              "description": "Geburtstag im Format YYYY-MM-DD"
            },
            "timezone": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die eingestellte Zeitzone des Users"
            },
            "created_at": {
              "type": [
                "string",
                "null"
              ],
              "description": "Zeitpunkt der Registrierung als ISO-8601"
            },
            "last_login": {
              "type": [
                "string",
                "null"
              ],
              "description": "Zeitpunkt des letzten Logins als ISO-8601"
            },
            "zip": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die Postleitzahl"
            },
            "city": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die Stadt"
            },
            "contact_homepage": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die Webseite des Users"
            },
            "contact_twitter": {
              "type": [
                "string",
                "null"
              ],
              "description": "Der Twitter-Username des Users"
            },
            "description_text": {
              "type": [
                "string",
                "null"
              ],
              "description": "Eine sonstige Beschreibung des Users"
            },
            "description_character": {
              "type": [
                "string",
                "null"
              ],
              "description": "Eine eigene Charakter-Beschreibung des Users"
            },
            "description_jesus": {
              "type": [
                "string",
                "null"
              ],
              "description": "\"Was ich von Jesus halte\""
            },
            "description_job": {
              "type": [
                "string",
                "null"
              ],
              "description": "Der Beruf"
            },
            "description_hobbies": {
              "type": [
                "string",
                "null"
              ],
              "description": "Die Hobbies"
            },
            "description_motto": {
              "type": [
                "string",
                "null"
              ],
              "description": "Das Lebensmotto"
            },
            "description_food": {
              "type": [
                "string",
                "null"
              ],
              "description": "Das Lieblingsessen des Users"
            },
            "description_links": {
              "type": [
                "string",
                "null"
              ],
              "description": "Eine Empfehlung von Links des Users"
            },
            "picture_thumb_url": {
              "type": "string",
              "description": "Url zum Profilbild (Thumbnail)"
            },
            "picture_url": {
              "type": "string",
              "description": "Url zum Profilbild (Vollbild)"
            },
            "picture_description": {
              "type": [
                "string",
                "null"
              ],
              "description": "Eine Beschreibung des Profilbildes"
            }
          }
        },
        "links": {
          "type": "object",
          "properties": {
            "self": {
              "type": "string",
              "description": "Der Link zu dieser Resource"
            }
          }
        },
        "relationships": {
          "type": "object",
          "properties": {
            "friends": {
              "type": "object",
              "properties": {
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Die Friends des Users"
            },
            "posts": {
              "type": "object",
              "properties": {
                "data": {
                  "type": "array"
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Die Posts auf der Pinnwand des Users"
            }
          }
        }
      }
    }
  }
}

Posts eines Users

Posts zu einem User abrufen
GET/users/{user_id}/posts

Liefert die Posts von der Pinnwand eines Users

Example URI

GET https://api.youthweb.net/users/123456/posts
URI Parameters
HideShow
user_id
number (required) Example: 123456

ID of the user

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "data": [
    {
      "type": "posts",
      "id": "d5a5a2c3-041b-4985-907c-74a2131efc98",
      "attributes": {
        "title": "The post title",
        "content": "Lorem ipsum dolor sit amet, sed libris elaboraret eu.",
        "content_html": "<p>Lorem ipsum dolor sit amet, sed libris elaboraret eu.</p>",
        "view_allowed_for": "users",
        "comments_allowed": true,
        "comments_count": 15,
        "reactions_given": [
          ":+1:"
        ],
        "reactions_count": {
          ":+1:": 1
        },
        "created_at": "2017-01-01T17:51:02+00:00",
        "updated_at": "2017-01-03T13:17:11+00:00"
      },
      "relationships": {
        "author": {
          "data": {
            "type": "users",
            "id": "123456"
          },
          "links": {
            "self": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/relationships/author",
            "related": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/author"
          }
        },
        "comments": {
          "data": [
            {
              "type": "comments",
              "id": "345678"
            }
          ],
          "links": {
            "self": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/relationships/comments",
            "related": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/comments"
          }
        },
        "parent": {
          "data": {
            "type": "users",
            "id": "123456"
          },
          "links": {
            "self": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/relationships/parent",
            "related": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/parent"
          }
        }
      },
      "links": {
        "self": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98"
      }
    }
  ],
  "included": [
    {
      "type": "users",
      "id": "123456",
      "attributes": {
        "username": "JohnSmith",
        "first_name": "John",
        "last_name": "Smith",
        "gender": "male",
        "email": "john_smith@example.org",
        "birthday": "1988-03-05",
        "timezone": "Europe/Berlin",
        "created_at": "2006-01-01T20:00:00+00:00",
        "last_login": "2016-01-01T20:00:00+00:00",
        "zip": "12345",
        "city": "Jamestown",
        "contact_homepage": "http://example.org",
        "contact_twitter": "youthweb_dev",
        "description_text": "Lorem ipsum dolor sit amet",
        "description_character": "Lorem ipsum dolor sit amet",
        "description_jesus": "Lorem ipsum dolor sit amet",
        "description_job": "Lorem ipsum dolor sit amet",
        "description_hobbies": "Lorem ipsum dolor sit amet",
        "description_motto": "Lorem ipsum dolor sit amet",
        "description_food": "Lorem ipsum dolor sit amet",
        "description_links": "Lorem ipsum dolor sit amet",
        "picture_thumb_url": "https://youthweb.net/img/steckbriefe/default_pic_m.jpg",
        "picture_url": "https://youthweb.net/img/steckbriefe/default_pic_m.jpg",
        "picture_description": "Lorem ipsum dolor sit amet"
      },
      "links": {
        "self": "/users/123456"
      },
      "relationships": {
        "friends": {
          "links": {
            "self": "/users/123456/relationships/friends",
            "related": "/users/123456/friends"
          }
        },
        "posts": {
          "data": [
            {
              "type": "posts",
              "id": "d5a5a2c3-041b-4985-907c-74a2131efc98"
            }
          ],
          "links": {
            "self": "/users/123456/relationships/posts",
            "related": "/users/123456/posts"
          }
        }
      }
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "array"
    },
    "included": {
      "type": "array"
    }
  }
}

Post zu einem User erstellen
POST/users/{user_id}/posts

Erstellt einen Posts an der Pinnwand eines Users

Example URI

POST https://api.youthweb.net/users/123456/posts
URI Parameters
HideShow
user_id
number (required) Example: 123456

ID of the user

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Body
{
  "data": {
    "type": "posts",
    "attributes": {
      "title": "The post title",
      "content": "Lorem ipsum dolor sit amet, sed libris elaboraret eu.",
      "view_allowed_for": "users",
      "comments_allowed": true
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "attributes": {
          "type": "object",
          "properties": {
            "title": {
              "type": "string",
              "description": "Der Title, kann auch leer sein"
            },
            "content": {
              "type": "string",
              "description": "Der Post-Inhalt"
            },
            "view_allowed_for": {
              "type": "string",
              "description": "Wer kann diesen Post sehen? (`all`, `users`, `friends` oder `authors`)"
            },
            "comments_allowed": {
              "type": "boolean",
              "description": "Kann dieser Post kommentiert werden?"
            }
          }
        }
      }
    }
  }
}
Response  201
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Location: /posts/d5a5a2c3-041b-4985-907c-74a2131efc98
Body
{
  "data": {
    "type": "posts",
    "id": "d5a5a2c3-041b-4985-907c-74a2131efc98",
    "attributes": {
      "title": "The post title",
      "content": "Lorem ipsum dolor sit amet, sed libris elaboraret eu.",
      "content_html": "<p>Lorem ipsum dolor sit amet, sed libris elaboraret eu.</p>",
      "view_allowed_for": "users",
      "comments_allowed": true,
      "comments_count": 15,
      "reactions_given": [
        ":+1:"
      ],
      "reactions_count": {
        ":+1:": 1
      },
      "created_at": "2017-01-01T17:51:02+00:00",
      "updated_at": "2017-01-03T13:17:11+00:00"
    },
    "relationships": {
      "author": {
        "data": {
          "type": "users",
          "id": "123456"
        },
        "links": {
          "self": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/relationships/author",
          "related": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/author"
        }
      },
      "comments": {
        "data": [
          {
            "type": "comments",
            "id": "345678"
          }
        ],
        "links": {
          "self": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/relationships/comments",
          "related": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/comments"
        }
      },
      "parent": {
        "data": {
          "type": "users",
          "id": "123456"
        },
        "links": {
          "self": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/relationships/parent",
          "related": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/parent"
        }
      }
    },
    "links": {
      "self": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98"
    }
  },
  "included": [
    {
      "type": "users",
      "id": "123456",
      "attributes": {
        "username": "JohnSmith",
        "first_name": "John",
        "last_name": "Smith",
        "gender": "male",
        "email": "john_smith@example.org",
        "birthday": "1988-03-05",
        "timezone": "Europe/Berlin",
        "created_at": "2006-01-01T20:00:00+00:00",
        "last_login": "2016-01-01T20:00:00+00:00",
        "zip": "12345",
        "city": "Jamestown",
        "contact_homepage": "http://example.org",
        "contact_twitter": "youthweb_dev",
        "description_text": "Lorem ipsum dolor sit amet",
        "description_character": "Lorem ipsum dolor sit amet",
        "description_jesus": "Lorem ipsum dolor sit amet",
        "description_job": "Lorem ipsum dolor sit amet",
        "description_hobbies": "Lorem ipsum dolor sit amet",
        "description_motto": "Lorem ipsum dolor sit amet",
        "description_food": "Lorem ipsum dolor sit amet",
        "description_links": "Lorem ipsum dolor sit amet",
        "picture_thumb_url": "https://youthweb.net/img/steckbriefe/default_pic_m.jpg",
        "picture_url": "https://youthweb.net/img/steckbriefe/default_pic_m.jpg",
        "picture_description": "Lorem ipsum dolor sit amet"
      },
      "links": {
        "self": "/users/123456"
      },
      "relationships": {
        "friends": {
          "links": {
            "self": "/users/123456/relationships/friends",
            "related": "/users/123456/friends"
          }
        },
        "posts": {
          "data": [
            {
              "type": "posts",
              "id": "d5a5a2c3-041b-4985-907c-74a2131efc98"
            }
          ],
          "links": {
            "self": "/users/123456/relationships/posts",
            "related": "/users/123456/posts"
          }
        }
      }
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string",
          "description": "Die Post-ID"
        },
        "attributes": {
          "type": "object",
          "properties": {
            "title": {
              "type": "string",
              "description": "Der Title, kann auch leer sein"
            },
            "content": {
              "type": "string",
              "description": "Der Post-Inhalt"
            },
            "content_html": {
              "type": "string",
              "description": "Der Post-Inhalt als HTML"
            },
            "view_allowed_for": {
              "type": "string",
              "description": "Wer kann diesen Post sehen? (`all`, `users`, `friends` oder `authors`)"
            },
            "comments_allowed": {
              "type": "boolean",
              "description": "Kann dieser Post kommentiert werden?"
            },
            "comments_count": {
              "type": "number",
              "description": "Die Gesamtanzahl der Kommentare zu diesem Post"
            },
            "reactions_given": {
              "type": "array",
              "description": "Die vom authorisierten User vergebenen Reaktionen zu diesem Post"
            },
            "reactions_count": {
              "type": "object",
              "properties": {
                ":+1:": {
                  "type": "number"
                }
              },
              "description": "Vergebene Reaktionen und deren Anzahl zu diesem Post"
            },
            "created_at": {
              "type": "string",
              "description": "Zeitpunkt der Erstellung als ISO-8601"
            },
            "updated_at": {
              "type": [
                "string",
                "null"
              ],
              "description": "Zeitpunkt der letzten Änderung als ISO-8601"
            }
          }
        },
        "relationships": {
          "type": "object",
          "properties": {
            "author": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "data": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string",
                      "description": "Die User-ID"
                    }
                  }
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Der Autor des Posts"
            },
            "comments": {
              "type": "object",
              "properties": {
                "data": {
                  "type": "array"
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Die Kommentare zu diesem Post"
            },
            "parent": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "data": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string",
                      "description": "Die User-ID"
                    }
                  }
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Das Elternobjekt, dem dieser Post zugeordnet ist"
            }
          }
        },
        "links": {
          "type": "object",
          "properties": {
            "self": {
              "type": "string",
              "description": "Der Link zu dieser Resource"
            }
          }
        }
      }
    },
    "included": {
      "type": "array"
    }
  }
}
Request
HideShow

Fehler: Create a post on an not existing user

Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Body
{
  "data": {
    "type": "posts",
    "attributes": {
      "title": "The post title",
      "content": "Lorem ipsum dolor sit amet, sed libris elaboraret eu.",
      "view_allowed_for": "users",
      "comments_allowed": true
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "attributes": {
          "type": "object",
          "properties": {
            "title": {
              "type": "string",
              "description": "Der Title, kann auch leer sein"
            },
            "content": {
              "type": "string",
              "description": "Der Post-Inhalt"
            },
            "view_allowed_for": {
              "type": "string",
              "description": "Wer kann diesen Post sehen? (`all`, `users`, `friends` oder `authors`)"
            },
            "comments_allowed": {
              "type": "boolean",
              "description": "Kann dieser Post kommentiert werden?"
            }
          }
        }
      }
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "errors": [
    {
      "status": "404",
      "title": "Resource not found"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    }
  }
}
Request
HideShow

Fehler: Create a post without permission

Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Body
{
  "data": {
    "type": "posts",
    "attributes": {
      "title": "The post title",
      "content": "Lorem ipsum dolor sit amet, sed libris elaboraret eu.",
      "view_allowed_for": "users",
      "comments_allowed": true
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "attributes": {
          "type": "object",
          "properties": {
            "title": {
              "type": "string",
              "description": "Der Title, kann auch leer sein"
            },
            "content": {
              "type": "string",
              "description": "Der Post-Inhalt"
            },
            "view_allowed_for": {
              "type": "string",
              "description": "Wer kann diesen Post sehen? (`all`, `users`, `friends` oder `authors`)"
            },
            "comments_allowed": {
              "type": "boolean",
              "description": "Kann dieser Post kommentiert werden?"
            }
          }
        }
      }
    }
  }
}
Response  403
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "errors": [
    {
      "status": "403",
      "title": "Forbidden"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    }
  }
}
Request
HideShow

Fehler: Create a post with empty content

Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Body
{
  "data": {
    "type": "posts",
    "attributes": {
      "title": "The post title",
      "content": "",
      "view_allowed_for": "users",
      "comments_allowed": true
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "attributes": {
          "type": "object",
          "properties": {
            "title": {
              "type": "string",
              "description": "Der Title, kann auch leer sein"
            },
            "content": {
              "type": "string",
              "description": "Der Post-Inhalt"
            },
            "view_allowed_for": {
              "type": "string",
              "description": "Wer kann diesen Post sehen? (`all`, `users`, `friends` oder `authors`)"
            },
            "comments_allowed": {
              "type": "boolean",
              "description": "Kann dieser Post kommentiert werden?"
            }
          }
        }
      }
    }
  }
}
Response  409
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "errors": [
    {
      "status": "409",
      "title": "Request body has invalid attributes",
      "detail": "Must be at least 1 characters long",
      "source": {
        "pointer": "data.attributes.content"
      }
    }
  ]
}
Request
HideShow

Fehler: Create a post with missing content

Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Body
{
  "data": {
    "type": "posts",
    "attributes": {
      "title": "The post title",
      "view_allowed_for": "users",
      "comments_allowed": true
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "attributes": {
          "type": "object",
          "properties": {
            "title": {
              "type": "string",
              "description": "Der Title, kann auch leer sein"
            },
            "view_allowed_for": {
              "type": "string",
              "description": "Wer kann diesen Post sehen? (`all`, `users`, `friends` oder `authors`)"
            },
            "comments_allowed": {
              "type": "boolean",
              "description": "Kann dieser Post kommentiert werden?"
            }
          }
        }
      }
    }
  }
}
Response  409
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "errors": [
    {
      "status": "409",
      "title": "Request body has invalid attributes",
      "detail": "The property content is required",
      "source": {
        "pointer": "data.attributes.content"
      }
    }
  ]
}
Request
HideShow

Fehler, wenn invalides JSON API gesendet wird

Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "foobar": {
    "type": "posts",
    "attributes": {
      "content": "Lorem ipsum dolor sit amet, sed libris elaboraret eu."
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "foobar": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "attributes": {
          "type": "object",
          "properties": {
            "content": {
              "type": "string",
              "description": "Der Post-Inhalt"
            }
          }
        }
      }
    }
  }
}
Response  400
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "errors": [
    {
      "status": "400",
      "code": "DATA_MEMBER_MISSING",
      "title": "Missing `data` member at the document's top level",
      "detail": "Missing `data` member at the document's top level!"
    }
  ]
}

Posts Relationships of an User

Posts Relationships zu einem User abrufen
GET/users/{user_id}/relationships/posts

Liefert die Posts Relationships von der Pinnwand eines Users

Example URI

GET https://api.youthweb.net/users/123456/relationships/posts
URI Parameters
HideShow
user_id
number (required) Example: 123456

ID of the user

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "data": [
    {
      "type": "posts",
      "id": "d5a5a2c3-041b-4985-907c-74a2131efc98"
    }
  ],
  "links": {
    "self": "/users/123456/relationships/posts",
    "related": "/users/123456/posts"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "array"
    },
    "links": {
      "type": "object",
      "properties": {
        "self": {
          "type": "string"
        },
        "related": {
          "type": "string"
        }
      }
    }
  }
}

Die Freunde eines Users

Dieser Endpoint bietet die /friends Beziehungen zu einem User an.

Friends sind die Verbindungspunkte zwischen zwei User. User lassen sich mithilfe der Friends als gerichteter Graph abbilden, wobei jeder User einen Knoten und jeder Friend eine Kante darstellt.

Grafik 2

  • Die Anfrage der Freunde von User A wird Friend 1 ausliefern.

  • Die Anfrage der Freunde von User B wird Friend 2 und Friend 3 ausliefern.

  • Die Anfrage der Freunde von User C wird Friend 4 ausliefern.

Freunde zu einem User abrufen
GET/users/{user_id}/friends

Example URI

GET https://api.youthweb.net/users/123456/friends
URI Parameters
HideShow
user_id
number (required) Example: 123456

ID of the user

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "data": [
    {
      "type": "friends",
      "id": "45678",
      "attributes": {
        "description": "Lorem ipsum dolor sit amet, sed libris elaboraret eu."
      },
      "relationships": {
        "from": {
          "data": {
            "type": "users",
            "id": "123456"
          },
          "links": {
            "self": "/friends/45678/relationships/from",
            "related": "/friends/45678/from"
          }
        },
        "to": {
          "data": {
            "type": "users",
            "id": "123456"
          },
          "links": {
            "self": "/friends/45678/relationships/to",
            "related": "/friends/45678/to"
          }
        }
      },
      "links": {
        "self": "/friends/45678"
      }
    }
  ],
  "included": [
    {
      "type": "users",
      "id": "123456",
      "attributes": {
        "username": "JohnSmith",
        "first_name": "John",
        "last_name": "Smith",
        "gender": "male",
        "email": "john_smith@example.org",
        "birthday": "1988-03-05",
        "timezone": "Europe/Berlin",
        "created_at": "2006-01-01T20:00:00+00:00",
        "last_login": "2016-01-01T20:00:00+00:00",
        "zip": "12345",
        "city": "Jamestown",
        "contact_homepage": "http://example.org",
        "contact_twitter": "youthweb_dev",
        "description_text": "Lorem ipsum dolor sit amet",
        "description_character": "Lorem ipsum dolor sit amet",
        "description_jesus": "Lorem ipsum dolor sit amet",
        "description_job": "Lorem ipsum dolor sit amet",
        "description_hobbies": "Lorem ipsum dolor sit amet",
        "description_motto": "Lorem ipsum dolor sit amet",
        "description_food": "Lorem ipsum dolor sit amet",
        "description_links": "Lorem ipsum dolor sit amet",
        "picture_thumb_url": "https://youthweb.net/img/steckbriefe/default_pic_m.jpg",
        "picture_url": "https://youthweb.net/img/steckbriefe/default_pic_m.jpg",
        "picture_description": "Lorem ipsum dolor sit amet"
      },
      "links": {
        "self": "/users/123456"
      },
      "relationships": {
        "friends": {
          "links": {
            "self": "/users/123456/relationships/friends",
            "related": "/users/123456/friends"
          }
        },
        "posts": {
          "data": [
            {
              "type": "posts",
              "id": "d5a5a2c3-041b-4985-907c-74a2131efc98"
            }
          ],
          "links": {
            "self": "/users/123456/relationships/posts",
            "related": "/users/123456/posts"
          }
        }
      }
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "array"
    },
    "included": {
      "type": "array"
    }
  }
}

Stats

Für die Statistiken ist keine Autorisierung nötig.

Account Stats

Retrieve the account stats
GET/stats/account

Liefert Statistiken zu den Accounts.

Example URI

GET https://api.youthweb.net/stats/account
Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "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"
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "attributes": {
          "type": "object",
          "properties": {
            "user_total": {
              "type": "number",
              "description": "Die Anzahl aller User"
            },
            "user_total_female": {
              "type": "number",
              "description": "Die Anzahl der weiblichen User"
            },
            "user_total_male": {
              "type": "number",
              "description": "Die Anzahl der männlichen User"
            },
            "user_online": {
              "type": "number",
              "description": "Die Anzahl der User, die im Moment online sind"
            },
            "user_online_24h": {
              "type": "number",
              "description": "Die Anzahl der User, die in den letzten 24 Stunden online waren"
            },
            "user_online_7d": {
              "type": "number",
              "description": "Die Anzahl der User, die in den letzten 7 Tagen online waren"
            },
            "user_online_30d": {
              "type": "number",
              "description": "Die Anzahl der User, die in den letzten 30 Tagen online waren"
            },
            "userpics": {
              "type": "number",
              "description": "Die Anzahl der User, die ein Profilbild hochgeladen haben"
            }
          }
        },
        "links": {
          "type": "object",
          "properties": {
            "self": {
              "type": "string",
              "description": "Der Link zu dieser Resource"
            }
          }
        }
      }
    }
  }
}

Forum Stats

Retrieve the forum stats
GET/stats/forum

Liefert Statistiken zum Forum

Example URI

GET https://api.youthweb.net/stats/forum
Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "data": {
    "type": "stats",
    "id": "forum",
    "attributes": {
      "authors_total": 1480,
      "threads_total": 2094,
      "posts_total": 121387
    },
    "links": {
      "self": "/stats/forum"
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "attributes": {
          "type": "object",
          "properties": {
            "authors_total": {
              "type": "number",
              "description": "Die Anzahl aller User, die mindestens einen Forenpost verfasst haben"
            },
            "threads_total": {
              "type": "number",
              "description": "Die Anzahl aller Threads"
            },
            "posts_total": {
              "type": "number",
              "description": "Die Anzahl aller verfasster Posts"
            }
          }
        },
        "links": {
          "type": "object",
          "properties": {
            "self": {
              "type": "string",
              "description": "Der Link zu dieser Resource"
            }
          }
        }
      }
    }
  }
}

Groups Stats

Retrieve the groups stats
GET/stats/groups

Liefert Statistiken zu den Gruppen.

Example URI

GET https://api.youthweb.net/stats/groups
Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
Body
{
  "data": {
    "type": "stats",
    "id": "groups",
    "attributes": {
      "groups_total": 614,
      "users_total": 2073
    },
    "links": {
      "self": "/stats/groups"
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "attributes": {
          "type": "object",
          "properties": {
            "groups_total": {
              "type": "number",
              "description": "Die Anzahl der Gruppen auf Youthweb"
            },
            "users_total": {
              "type": "number",
              "description": "Die Anzahl der User, die einer Gruppe angehören"
            }
          }
        },
        "links": {
          "type": "object",
          "properties": {
            "self": {
              "type": "string",
              "description": "Der Link zu dieser Resource"
            }
          }
        }
      }
    }
  }
}

Generated by aglio on 21 Dec 2022