Youthweb API
Dies ist die offizielle API von youthweb.net.
Version: 0.20 (2021-07-25)
-
Developer Webseite: https://developer.youthweb.net
-
Gitlab Repository: https://gitlab.com/youthweb/youthweb-api
-
Github Mirror: https://github.com/youthweb/youthweb-api
Ü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 ErrorsGET/errors/header-errors
Hier werden übliche Fehler gezeigt, die bei falscher Verwendung zurückgegeben werden.
Example URI
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
415
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"
}
]
}
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
415
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"
}
]
}
Anfragen ohne gesetzen Versionparameter geben einen Fehler zurück.
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
406
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"
}
]
}
Anfragen ohne gesetzen Accept Header geben einen Fehler zurück.
Headers
Content-Type: application/vnd.api+json
DNT: 1
406
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"
}
]
}
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
406
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 anfragenGET/
Das Anfragen der API-Url ohne eine Resource ist nicht möglich und gibt einen Fehler zurück.
Example URI
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
404
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 VersionsparameterGET/errors/header-warnings
Anfragen mit einer veralteten (deprecated) Version funktionieren, aber zeigen eine Warnung im meta-Attribut an
Example URI
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
404
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"
}
}
}
}
}
Events ¶
Events abrufen ¶
Eine Liste von Events abrufenGET/events
Example URI
- page[start]
string
(optional) Example: 2017-06-01T00:00:00Ein 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:00Ein 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.
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
200
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 abrufenGET/events/{event_id}{?include}
Example URI
- event_id
string
(required) Example: 4567ID of the event
- include
string
(optional) Example: authorKommagetrente Liste an includes
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
200
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"
}
}
}
}
}
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
401
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"
}
}
}
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.
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 abrufenGET/friends/{friend_id}{?include}
Example URI
- friend_id
string
(required) Example: 45678ID of the friend
- include
string
(optional) Example: from,toKommagetrente Liste an includes
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
200
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"
}
}
}
}
}
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
401
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 abrufenGET/friends/{friend_id}/from
Example URI
- friend_id
string
(required) Example: 45678ID of the friend
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
200
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 abrufenGET/friends/{friend_id}/relationships/from
Example URI
- friend_id
string
(required) Example: 45678ID of the friend
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
200
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 abrufenGET/friends/{friend_id}/to
Example URI
- friend_id
string
(required) Example: 45678ID of the friend
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
200
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 abrufenGET/friends/{friend_id}/relationships/to
Example URI
- friend_id
string
(required) Example: 45678ID of the friend
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
200
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 abrufenGET/posts/{post_id}{?include}
Example URI
- post_id
string
(required) Example: d5a5a2c3-041b-4985-907c-74a2131efc98ID des Posts
- include
string
(optional) Example: author,comments,parentKommagetrente Liste an includes
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
200
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"
}
}
}
}
}
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
403
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"
}
}
}
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
404
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 updatenPATCH/posts/{post_id}{?include}
Example URI
- post_id
string
(required) Example: d5a5a2c3-041b-4985-907c-74a2131efc98ID des Posts
- include
string
(optional) Example: author,comments,parentKommagetrente Liste an includes
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:"
]
}
}
}
200
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"
}
}
}
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:"
]
}
}
}
200
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"
}
}
}
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:"
]
}
}
}
400
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"
}
}
}
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:"
]
}
}
}
401
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 Comments ¶
Kommentare zu einem Post abrufenGET/posts/{post_id}/comments{?include}
Example URI
- post_id
string
(required) Example: d5a5a2c3-041b-4985-907c-74a2131efc98ID of the post as a uuid string
- include
string
(optional) Example: author,parentKommagetrente Liste an includes, möglich sind
author
undparent
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
200
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 erstellenPOST/posts/{post_id}/comments{?include}
Example URI
- post_id
string
(required) Example: d5a5a2c3-041b-4985-907c-74a2131efc98ID of the post as a uuid string
- include
string
(optional) Example: author,parentKommagetrente Liste an includes, möglich sind
author
undparent
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"
}
}
}
}
}
}
}
201
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"
}
}
}
}
}
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"
}
}
}
}
}
}
}
404
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"
}
}
}
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"
}
}
}
}
}
}
}
403
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"
}
}
}
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"
}
}
}
}
}
}
}
409
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"
}
}
]
}
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": {}
}
}
}
}
}
409
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 abrufenGET/posts/{post_id}/relationships/comments
Example URI
- post_id
string
(required) Example: d5a5a2c3-041b-4985-907c-74a2131efc98ID of the post as a uuid string
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
200
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 abrufenGET/posts/{post_id}/parent
Example URI
- post_id
string
(required) Example: d5a5a2c3-041b-4985-907c-74a2131efc98ID of the post as a uuid string
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
200
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 abrufenGET/posts/{post_id}/relationships/parent
Example URI
- post_id
string
(required) Example: d5a5a2c3-041b-4985-907c-74a2131efc98ID of the post as a uuid string
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
200
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 abrufenGET/timeline-entries{?include}
Liefert die Einträge für die globale Timeline.
Example URI
- page[limit]
number
(optional) Default: 5 Example: 10Limit the entries
- page[cursor]
string
(optional) Example: 2021-02-24T13:51:26ZDateTime 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.authorKommagetrente Liste an includes
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
200
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"
}
}
}
}
}
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
401
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 abrufenGET/timeline-entries/{entry_id}{?include}
Liefert einen Eintrag
Example URI
- entry_id
string
(required)Uuid des Timeline-Entry
- include
string
(optional) Example: origin.author,origin.comments.authorKommagetrente Liste an includes
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
200
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 abrufenGET/users/{user_id}/timeline-entries
Liefert die Einträge für die Timeline eines Users
Example URI
- user_id
number
(required)ID of the user
- page[cursor]
string
(optional) Example: 2021-02-24T13:51:26ZDateTime 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: 5Limit the entries
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
200
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"
}
}
}
}
}
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
401
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"
}
}
}
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
404
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 abrufenGET/timeline-entries/{entry_id}/origin
Example URI
- entry_id
string
(required)Uuid
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
200
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 abrufenGET/timeline-entries/{entry_id}/relationships/origin
Example URI
- entry_id
string
(required)Uuid
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
200
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 abrufenGET/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
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
200
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"
}
}
}
}
}
}
}
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
401
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 abrufenGET/users/{user_id}
Example URI
- user_id
number
(required) Example: 123456ID of the user in form of an integer
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
200
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 abrufenGET/users/{user_id}/posts
Liefert die Posts von der Pinnwand eines Users
Example URI
- user_id
number
(required) Example: 123456ID of the 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
200
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 erstellenPOST/users/{user_id}/posts
Erstellt einen Posts an der Pinnwand eines Users
Example URI
- user_id
number
(required) Example: 123456ID of the 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?"
}
}
}
}
}
}
}
201
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"
}
}
}
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?"
}
}
}
}
}
}
}
404
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"
}
}
}
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?"
}
}
}
}
}
}
}
403
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"
}
}
}
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?"
}
}
}
}
}
}
}
409
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"
}
}
]
}
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?"
}
}
}
}
}
}
}
409
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"
}
}
]
}
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"
}
}
}
}
}
}
}
400
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 abrufenGET/users/{user_id}/relationships/posts
Liefert die Posts Relationships von der Pinnwand eines Users
Example URI
- user_id
number
(required) Example: 123456ID of the 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
200
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.
-
Die Anfrage der Freunde von
User A
wirdFriend 1
ausliefern. -
Die Anfrage der Freunde von
User B
wirdFriend 2
undFriend 3
ausliefern. -
Die Anfrage der Freunde von
User C
wirdFriend 4
ausliefern.
Freunde zu einem User abrufenGET/users/{user_id}/friends
Example URI
- user_id
number
(required) Example: 123456ID of the 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
200
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 statsGET/stats/account
Liefert Statistiken zu den Accounts.
Example URI
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
200
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 statsGET/stats/forum
Liefert Statistiken zum Forum
Example URI
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
200
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 statsGET/stats/groups
Liefert Statistiken zu den Gruppen.
Example URI
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.20
200
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"
}
}
}
}
}
}
}
Comments ¶
Comment ¶
/comments/{comment_id}{?include}
Example URI
string
(required) Example: 345678ID of the comment
string
(optional) Example: author,parentKommagetrente Liste an includes, möglich sind
author
undparent
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
200
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 ¶
/comments/{comment_id}/author
Example URI
string
(required) Example: 345678ID of the comment
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
200
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 ¶
/comments/{comment_id}/relationships/author
Example URI
string
(required) Example: 345678ID of the event
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
200
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 ¶
/comments/{comment_id}/parent
Example URI
string
(required) Example: 345678ID of the comment
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
200
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 ¶
/comments/{comment_id}/relationships/parent
Example URI
string
(required) Example: 345678ID of the event
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
200
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" } } } } }