Back to top

Youthweb API

Dies ist die offizielle API von youthweb.net.

Aktuelle Version: 0.14 (XXXX-XX-XX)

Status: Alpha

Github Repository: https://github.com/youthweb/youthweb-api

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.14

Authentication

Alle Informationen zur Authentication findest du hier: http://developer.youthweb.net/api_general_oauth2.html

Comments

Comment

Ein Comment Objekt hat die folgenden Attribute

  • type

  • id - The comment-ID

  • attributes - An object of attributes.

Daten zu einem Comment abrufen
GET/comments/{comment_id}

Example URI

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

ID of the comment

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
Body
{
  "data": {
    "type": "comments",
    "id": "345678",
    "attributes": {
      "content": "Lorem ipsum dolor sit amet, sed libris elaboraret eu.",
      "created_at": "2017-01-01T17:51:02+00:00"
    },
    "relationships": {
      "author": {
        "data": {
          "type": "users",
          "id": "123456"
        },
        "links": {
          "self": "/comments/345678/relationships/author",
          "related": "/comments/345678/author"
        }
      },
      "parent": {
        "data": {
          "type": "posts",
          "id": "d5a5a2c3-041b-4985-907c-74a2131efc98"
        },
        "links": {
          "self": "/comments/345678/relationships/parent",
          "related": "/comments/345678/parent"
        }
      }
    },
    "links": {
      "self": "/comments/345678"
    }
  },
  "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": {
        "posts": {
          "data": [
            {
              "type": "posts",
              "id": "d5a5a2c3-041b-4985-907c-74a2131efc98"
            }
          ],
          "links": {
            "self": "/users/123456/relationships/posts",
            "related": "/users/123456/posts"
          }
        }
      }
    },
    {
      "type": "posts",
      "id": "d5a5a2c3-041b-4985-907c-74a2131efc98",
      "attributes": {
        "title": "The post title",
        "content": "Lorem ipsum dolor sit amet, sed libris elaboraret eu.",
        "view_allowed_for": "users",
        "comments_allowed": true,
        "comments_count": 15,
        "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 Comment-ID"
        },
        "attributes": {
          "type": "object",
          "properties": {
            "content": {
              "type": "string",
              "description": "Der Inhalt der Comments"
            },
            "created_at": {
              "type": "string",
              "description": "Zeitpunkt der Erstellung als ISO-8601"
            }
          }
        },
        "relationships": {
          "type": "object",
          "properties": {
            "author": {
              "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"
                    }
                  }
                }
              },
              "description": "Der Autor des Comments"
            },
            "parent": {
              "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"
                    }
                  }
                }
              },
              "description": "Das Objekt, das kommentiert wurde"
            }
          }
        },
        "links": {
          "type": "object",
          "properties": {
            "self": {
              "type": "string",
              "description": "Der Link zu dieser Resource"
            }
          }
        }
      }
    },
    "included": {
      "type": "array"
    }
  }
}

Comment Author

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

Example URI

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

ID of the comment

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
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": {
      "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": {
            "posts": {
              "type": "object",
              "properties": {
                "data": {
                  "type": "array"
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Die Posts auf der Pinnwand des Users"
            }
          }
        }
      }
    }
  }
}

Post Author Relationship

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

Example URI

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

ID of the event

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

Comment Parent

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

Example URI

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

ID of the comment

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
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.",
      "view_allowed_for": "users",
      "comments_allowed": true,
      "comments_count": 15,
      "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"
            },
            "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"
            },
            "created_at": {
              "type": "string",
              "description": "Zeitpunkt der Erstellung als ISO-8601"
            },
            "updated_at": {
              "type": [
                "string",
                "null"
              ],
              "description": "Zeitpunkt der letzten Änderung als ISO-8601"
            }
          }
        },
        "relationships": {
          "type": "object",
          "properties": {
            "author": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "data": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string",
                      "description": "Die User-ID"
                    }
                  }
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Der Autor des Posts"
            },
            "comments": {
              "type": "object",
              "properties": {
                "data": {
                  "type": "array"
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Die Kommentare zu diesem Post"
            },
            "parent": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "data": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string",
                      "description": "Die User-ID"
                    }
                  }
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Das Elternobjekt, dem dieser Post zugeordnet ist"
            }
          }
        },
        "links": {
          "type": "object",
          "properties": {
            "self": {
              "type": "string",
              "description": "Der Link zu dieser Resource"
            }
          }
        }
      }
    }
  }
}

Comment Parent Relationship

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

Example URI

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

ID of the event

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

Events

Events abrufen

Eine Liste von Events anfordern
GET/events?page[start]={start_datetime}&page[end]={end_datetime}

Example URI

GET https://api.youthweb.net/events?page%5Bstart%5D=2017-06-01T00:00:00&page%5Bend%5D=2017-08-01T00:00:00
URI Parameters
HideShow
start_datetime
string (optional) Example: 2017-06-01T00:00:00

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

end_datetime
string (optional) Example: 2017-08-01T00:00:00

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

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
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,
        "participants_count": 15
      },
      "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": {
        "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 Objekt hat die folgenden Attribute

  • type

  • id - The Event-ID

  • attributes - An object of attributes.

Daten zu einem Event abrufen
GET/events/{event_id}

Example URI

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

ID of the event

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
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,
      "participants_count": 15
    },
    "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": {
        "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 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"
            },
            "participants_count": {
              "type": "number",
              "description": "Die Gesamtanzahl der User, die Angaben zur Teilnahme an diesem Event gemacht haben"
            }
          }
        },
        "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"
    }
  }
}
Request
HideShow

Fehler: Event anfragen ohne Authorization

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

Event Author

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

Example URI

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

ID of the event

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
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": {
      "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": {
            "posts": {
              "type": "object",
              "properties": {
                "data": {
                  "type": "array"
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Die Posts auf der Pinnwand des Users"
            }
          }
        }
      }
    }
  }
}

Event Author Relationship

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

Example URI

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

ID of the event

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

Friends

Friend

Daten zu einem Friend abrufen
GET/friends/{friend_id}

Example URI

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

ID of the friend

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
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": {
        "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 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"
    }
  }
}
Request
HideShow

Fehler: Friend anfragen ohne Authorization

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

Friend From

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

Example URI

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

ID of the friend

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
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": {
      "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": {
            "posts": {
              "type": "object",
              "properties": {
                "data": {
                  "type": "array"
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Die Posts auf der Pinnwand des Users"
            }
          }
        }
      }
    }
  }
}

From-User Relationship

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

Example URI

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

ID of the friend

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

To-User zu einem Friend abrufen

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

Example URI

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

ID of the friend

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
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": {
      "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": {
            "posts": {
              "type": "object",
              "properties": {
                "data": {
                  "type": "array"
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Die Posts auf der Pinnwand des Users"
            }
          }
        }
      }
    }
  }
}

To-User Relationship

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

Example URI

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

ID of the friend

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
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

Ein Post Objekt hat die folgenden Attribute

  • type

  • id - The Post-ID

  • attributes - An object of attributes.

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

Example URI

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

ID of the post as a uuid string

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
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.",
      "view_allowed_for": "users",
      "comments_allowed": true,
      "comments_count": 15,
      "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": {
        "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"
            },
            "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"
            },
            "created_at": {
              "type": "string",
              "description": "Zeitpunkt der Erstellung als ISO-8601"
            },
            "updated_at": {
              "type": [
                "string",
                "null"
              ],
              "description": "Zeitpunkt der letzten Änderung als ISO-8601"
            }
          }
        },
        "relationships": {
          "type": "object",
          "properties": {
            "author": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "data": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string",
                      "description": "Die User-ID"
                    }
                  }
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Der Autor des Posts"
            },
            "comments": {
              "type": "object",
              "properties": {
                "data": {
                  "type": "array"
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Die Kommentare zu diesem Post"
            },
            "parent": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "data": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string",
                      "description": "Die User-ID"
                    }
                  }
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Das Elternobjekt, dem dieser Post zugeordnet ist"
            }
          }
        },
        "links": {
          "type": "object",
          "properties": {
            "self": {
              "type": "string",
              "description": "Der Link zu dieser Resource"
            }
          }
        }
      }
    },
    "included": {
      "type": "array"
    }
  }
}
Request
HideShow

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

Fehler: Request a not existing post

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

Post Author

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

Example URI

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

ID of the post as a uuid string

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
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": {
      "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": {
            "posts": {
              "type": "object",
              "properties": {
                "data": {
                  "type": "array"
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Die Posts auf der Pinnwand des Users"
            }
          }
        }
      }
    }
  }
}

Post Author Relationship

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

Example URI

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

ID of the post as a uuid string

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

Post Comments

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

Example URI

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

ID of the post as a uuid string

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
Body
{
  "data": [
    {
      "type": "comments",
      "id": "345678",
      "attributes": {
        "content": "Lorem ipsum dolor sit amet, sed libris elaboraret eu.",
        "created_at": "2017-01-01T17:51:02+00:00"
      },
      "relationships": {
        "author": {
          "data": {
            "type": "users",
            "id": "123456"
          },
          "links": {
            "self": "/comments/345678/relationships/author",
            "related": "/comments/345678/author"
          }
        },
        "parent": {
          "data": {
            "type": "posts",
            "id": "d5a5a2c3-041b-4985-907c-74a2131efc98"
          },
          "links": {
            "self": "/comments/345678/relationships/parent",
            "related": "/comments/345678/parent"
          }
        }
      },
      "links": {
        "self": "/comments/345678"
      }
    }
  ],
  "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": {
        "posts": {
          "data": [
            {
              "type": "posts",
              "id": "d5a5a2c3-041b-4985-907c-74a2131efc98"
            }
          ],
          "links": {
            "self": "/users/123456/relationships/posts",
            "related": "/users/123456/posts"
          }
        }
      }
    },
    {
      "type": "posts",
      "id": "d5a5a2c3-041b-4985-907c-74a2131efc98",
      "attributes": {
        "title": "The post title",
        "content": "Lorem ipsum dolor sit amet, sed libris elaboraret eu.",
        "view_allowed_for": "users",
        "comments_allowed": true,
        "comments_count": 15,
        "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": "array"
    },
    "included": {
      "type": "array"
    }
  }
}

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

Example URI

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

ID of the post as a uuid string

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
Authorization: Bearer valid_JWT
Body
{
  "data": {
    "type": "comments",
    "attributes": {
      "content": "Lorem ipsum dolor sit amet, sed libris elaboraret eu."
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "attributes": {
          "type": "object",
          "properties": {
            "content": {
              "type": "string",
              "description": "Der Post-Inhalt"
            }
          }
        }
      }
    }
  }
}
Response  201
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
Location: /comments/98765
Body
{
  "data": {
    "type": "comments",
    "id": "345678",
    "attributes": {
      "content": "Lorem ipsum dolor sit amet, sed libris elaboraret eu.",
      "created_at": "2017-01-01T17:51:02+00:00"
    },
    "relationships": {
      "author": {
        "data": {
          "type": "users",
          "id": "123456"
        },
        "links": {
          "self": "/comments/345678/relationships/author",
          "related": "/comments/345678/author"
        }
      },
      "parent": {
        "data": {
          "type": "posts",
          "id": "d5a5a2c3-041b-4985-907c-74a2131efc98"
        },
        "links": {
          "self": "/comments/345678/relationships/parent",
          "related": "/comments/345678/parent"
        }
      }
    },
    "links": {
      "self": "/comments/345678"
    }
  },
  "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": {
        "posts": {
          "data": [
            {
              "type": "posts",
              "id": "d5a5a2c3-041b-4985-907c-74a2131efc98"
            }
          ],
          "links": {
            "self": "/users/123456/relationships/posts",
            "related": "/users/123456/posts"
          }
        }
      }
    },
    {
      "type": "posts",
      "id": "d5a5a2c3-041b-4985-907c-74a2131efc98",
      "attributes": {
        "title": "The post title",
        "content": "Lorem ipsum dolor sit amet, sed libris elaboraret eu.",
        "view_allowed_for": "users",
        "comments_allowed": true,
        "comments_count": 15,
        "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 Comment-ID"
        },
        "attributes": {
          "type": "object",
          "properties": {
            "content": {
              "type": "string",
              "description": "Der Inhalt der Comments"
            },
            "created_at": {
              "type": "string",
              "description": "Zeitpunkt der Erstellung als ISO-8601"
            }
          }
        },
        "relationships": {
          "type": "object",
          "properties": {
            "author": {
              "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"
                    }
                  }
                }
              },
              "description": "Der Autor des Comments"
            },
            "parent": {
              "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"
                    }
                  }
                }
              },
              "description": "Das Objekt, das kommentiert wurde"
            }
          }
        },
        "links": {
          "type": "object",
          "properties": {
            "self": {
              "type": "string",
              "description": "Der Link zu dieser Resource"
            }
          }
        }
      }
    },
    "included": {
      "type": "array"
    }
  }
}
Request
HideShow

Fehler: Create a comment on an not existing post

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

Fehler: Create a comment without permission

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

Fehler: Create a comment with empty content

Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
Authorization: Bearer valid_JWT
Body
{
  "data": {
    "type": "comments",
    "attributes": {
      "content": "Hello, world!"
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "attributes": {
          "type": "object",
          "properties": {
            "content": {
              "type": "string",
              "description": "Der Comment-Inhalt"
            }
          }
        }
      }
    }
  }
}
Response  400
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
Body
{
  "errors": [
    {
      "status": "422",
      "title": "Unprocessable Entity",
      "detail": "The field `attributes.content` can't be empty."
    }
  ]
}
Request
HideShow

Fehler: Create a comment with missing content

Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
Authorization: Bearer valid_JWT
Body
{
  "data": {
    "type": "comments",
    "attributes": {}
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "attributes": {
          "type": "object",
          "properties": {}
        }
      }
    }
  }
}
Response  400
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
Body
{
  "errors": [
    {
      "status": "422",
      "title": "Unprocessable Entity",
      "detail": "The field `attributes.content` must be set."
    }
  ]
}

Post Comments Relationship

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

Example URI

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

ID of the post as a uuid string

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

Post Parent

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

Example URI

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

ID of the post as a uuid string

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
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": {
      "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": {
            "posts": {
              "type": "object",
              "properties": {
                "data": {
                  "type": "array"
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Die Posts auf der Pinnwand des Users"
            }
          }
        }
      }
    }
  }
}

Post Parent Relationship

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

Example URI

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

ID of the post as a uuid string

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
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"
        }
      }
    }
  }
}

Stats

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

Account Stats

Liefert Statistiken zu den Accounts.

Retrieve the account stats
GET/stats/account

Example URI

GET https://api.youthweb.net/stats/account
Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
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

Liefert Statistiken zum Forum

Retrieve the forum stats
GET/stats/forum

Example URI

GET https://api.youthweb.net/stats/forum
Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
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

Liefert Statistiken zu den Gruppen.

Retrieve the groups stats
GET/stats/groups

Example URI

GET https://api.youthweb.net/stats/groups
Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
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"
            }
          }
        }
      }
    }
  }
}

Users

User

Ein User Objekt hat die folgenden Attribute

  • type

  • id - The User-ID

  • attributes - An object of attributes.

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

Example URI

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

ID of the user in form of an integer

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
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": {
      "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": {
            "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 of an User

Liefert die Posts von der Pinnwand eines Users

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

Example URI

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

ID of the user

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
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.",
        "view_allowed_for": "users",
        "comments_allowed": true,
        "comments_count": 15,
        "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": {
        "posts": {
          "data": [
            {
              "type": "posts",
              "id": "d5a5a2c3-041b-4985-907c-74a2131efc98"
            }
          ],
          "links": {
            "self": "/users/123456/relationships/posts",
            "related": "/users/123456/posts"
          }
        }
      }
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "array"
    },
    "included": {
      "type": "array"
    }
  }
}

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

Example URI

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

ID of the user

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
Authorization: Bearer valid_JWT
Body
{
  "data": {
    "type": "posts",
    "attributes": {
      "title": "The post title",
      "content": "Lorem ipsum dolor sit amet, sed libris elaboraret eu.",
      "view_allowed_for": "users",
      "comments_allowed": true
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "attributes": {
          "type": "object",
          "properties": {
            "title": {
              "type": "string",
              "description": "Der Title, kann auch leer sein"
            },
            "content": {
              "type": "string",
              "description": "Der Post-Inhalt"
            },
            "view_allowed_for": {
              "type": "string",
              "description": "Wer kann diesen Post sehen? (`all`, `users`, `friends` oder `authors`)"
            },
            "comments_allowed": {
              "type": "boolean",
              "description": "Kann dieser Post kommentiert werden?"
            }
          }
        }
      }
    }
  }
}
Response  201
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
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.",
      "view_allowed_for": "users",
      "comments_allowed": true,
      "comments_count": 15,
      "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": {
        "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"
            },
            "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"
            },
            "created_at": {
              "type": "string",
              "description": "Zeitpunkt der Erstellung als ISO-8601"
            },
            "updated_at": {
              "type": [
                "string",
                "null"
              ],
              "description": "Zeitpunkt der letzten Änderung als ISO-8601"
            }
          }
        },
        "relationships": {
          "type": "object",
          "properties": {
            "author": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "data": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string",
                      "description": "Die User-ID"
                    }
                  }
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Der Autor des Posts"
            },
            "comments": {
              "type": "object",
              "properties": {
                "data": {
                  "type": "array"
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Die Kommentare zu diesem Post"
            },
            "parent": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "data": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string",
                      "description": "Die User-ID"
                    }
                  }
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "related": {
                      "type": "string"
                    }
                  }
                }
              },
              "description": "Das Elternobjekt, dem dieser Post zugeordnet ist"
            }
          }
        },
        "links": {
          "type": "object",
          "properties": {
            "self": {
              "type": "string",
              "description": "Der Link zu dieser Resource"
            }
          }
        }
      }
    },
    "included": {
      "type": "array"
    }
  }
}
Request
HideShow

Fehler: Create a post on an not existing user

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

Fehler: Create a post without permission

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

Fehler: Create a post with empty content

Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
Authorization: Bearer valid_JWT
Body
{
  "data": {
    "type": "posts",
    "attributes": {
      "title": "The post title",
      "content": "",
      "view_allowed_for": "users",
      "comments_allowed": true
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "attributes": {
          "type": "object",
          "properties": {
            "title": {
              "type": "string",
              "description": "Der Title, kann auch leer sein"
            },
            "content": {
              "type": "string",
              "description": "Der Post-Inhalt"
            },
            "view_allowed_for": {
              "type": "string",
              "description": "Wer kann diesen Post sehen? (`all`, `users`, `friends` oder `authors`)"
            },
            "comments_allowed": {
              "type": "boolean",
              "description": "Kann dieser Post kommentiert werden?"
            }
          }
        }
      }
    }
  }
}
Response  400
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
Body
{
  "errors": [
    {
      "status": "422",
      "title": "Unprocessable Entity",
      "detail": "The field `attributes.content` can't be empty."
    }
  ]
}
Request
HideShow

Fehler: Create a post with missing content

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

Posts Relationships of an User

Liefert die Posts Relationships von der Pinnwand eines Users

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

Example URI

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

ID of the user

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
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"
        }
      }
    }
  }
}

Friends of an User

Liefert die Freunde eines Users

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

Example URI

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

ID of the user

Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
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": {
        "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"
    }
  }
}

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.

Daten zum autorisierten User abrufen
GET/me

Example URI

GET https://api.youthweb.net/me
Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
Authorization: Bearer valid_JWT
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14
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": {
      "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": {
            "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"
            }
          }
        }
      }
    }
  }
}

Generated by aglio on 21 Dec 2022