PHP Course Exam (1.0.0)

Download OpenAPI specification:Download

Kilian Kurt Hofmann: khofmann@zedat.fu-berlin.de

PHP Course (ABV FU Berlin) 2024 Exam

Login/Logout

Login

Log in user.

Request Body schema: application/json
required
username
required
string
password
required
string

Responses

Request samples

Content type
application/json
{
  • "username": "string",
  • "password": "string"
}

Response samples

Content type
application/json
{
  • "user": {
    },
  • "token": "string",
  • "refreshToken": "string"
}

Logout

Log out user.

Authorizations:
BasicAuth

Responses

Response samples

Content type
application/json
true

Post

List posts

List all posts, return full user data if authenticated.

Authorizations:
NoneBasicAuth
query Parameters
p
integer >= 0
Default: 0

Current page.

l
integer [ 0 .. 30 ]
Default: 10

The number of items to return.

Responses

Response samples

Content type
application/json
Example
{
  • "pages": 0,
  • "data": [
    ]
}

New post

Create a new post.

Authorizations:
BasicAuth
query Parameters
l
integer [ 0 .. 30 ]
Default: 10

Number of items per page, influences returned pages count.

Request Body schema: application/json
required
content
required
string

Responses

Request samples

Content type
application/json
{
  • "content": "string"
}

Response samples

Content type
application/json
{
  • "pages": 0,
  • "post": {
    }
}

Update post

Update post with ID.
Requires logged in user to have admin permissions for posts not made by them.

Authorizations:
BasicAuthBasicAuth
path Parameters
id
required
integer <int14>

Post ID

Request Body schema: application/json
content
string

Responses

Request samples

Content type
application/json
{
  • "content": "string"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "user": {
    },
  • "content": "string",
  • "postedAt": {
    }
}

Delete post

Delete post with ID.

Authorizations:
BasicAuth
path Parameters
id
required
integer <int14>

Post ID

query Parameters
l
integer [ 0 .. 30 ]
Default: 10

Number of items per page, influences returned pages count.

Responses

Response samples

Content type
application/json
{
  • "pages": 0,
  • "post": {
    }
}

Register

Register

Register a new user.

Request Body schema: application/json
required
username
required
string
email
required
string
password
required
string

Responses

Request samples

Content type
application/json
{
  • "username": "string",
  • "email": "string",
  • "password": "string"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "username": "string",
  • "status": 0,
  • "email": "string",
  • "image": "string",
  • "isAdmin": true,
  • "memberSince": {
    },
  • "postCount": 0
}

Confirm register

Confirm a registration.

Request Body schema: application/json
required
code
required
string <uuid4>

Responses

Request samples

Content type
application/json
{
  • "code": "string"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "username": "string",
  • "status": 0,
  • "email": "string",
  • "image": "string",
  • "isAdmin": true,
  • "memberSince": {
    },
  • "postCount": 0
}

Refresh

Refresh

Token refresh.

Authorizations:
BasicAuth
Request Body schema: application/json
required
refreshToken
required
string <uuid4>

Responses

Request samples

Content type
application/json
{
  • "refreshToken": "string"
}

Response samples

Content type
application/json
{
  • "user": {
    },
  • "token": "string",
  • "refreshToken": "string"
}

User

List users

List all users.

Authorizations:
BasicAuth
query Parameters
p
integer >= 0
Default: 0

Current page.

l
integer [ 0 .. 30 ]
Default: 10

The number of items to return.

Responses

Response samples

Content type
application/json
{
  • "pages": 0,
  • "data": [
    ]
}

Get user

Get user by ID.

Authorizations:
BasicAuth
path Parameters
id
required
integer <int14>

User ID

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "username": "string",
  • "status": 0,
  • "email": "string",
  • "image": "string",
  • "isAdmin": true,
  • "memberSince": {
    },
  • "postCount": 0
}

Update user

Update user with ID.
Use special ID self to update logged in user.
Requires logged in user to have admin permissions for any ID other than self.

Authorizations:
BasicAuthBasicAuth
path Parameters
id
required
integer <int14>

User ID

Request Body schema: application/json
username
string
password
string
email
string

Responses

Request samples

Content type
application/json
{
  • "username": "string",
  • "password": "string",
  • "email": "string"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "username": "string",
  • "status": 0,
  • "email": "string",
  • "image": "string",
  • "isAdmin": true,
  • "memberSince": {
    },
  • "postCount": 0
}

Delete user

Delete user with ID.

Authorizations:
BasicAuth
path Parameters
id
required
integer <int14>

User ID

query Parameters
l
integer [ 0 .. 30 ]
Default: 10

Number of items per page, influences returned pages count.

Responses

Response samples

Content type
application/json
{
  • "pages": 0,
  • "post": {
    }
}

Update user image

Update user image with ID.
Use special ID self to update logged in user.
Requires logged in user to have admin permissions for any ID other than self.

Authorizations:
BasicAuthBasicAuth
path Parameters
id
required
integer <int14>

User ID

Request Body schema: application/json
image
string <binary>
predefined
string

Responses

Request samples

Content type
application/json
{
  • "image": "string",
  • "predefined": "string"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "username": "string",
  • "status": 0,
  • "email": "string",
  • "image": "string",
  • "isAdmin": true,
  • "memberSince": {
    },
  • "postCount": 0
}

Get user posts

Get a users posts ID.

Authorizations:
BasicAuth
path Parameters
id
required
integer <int14>

User ID

query Parameters
p
integer >= 0
Default: 0

Current page.

l
integer [ 0 .. 30 ]
Default: 10

The number of items to return.

s
string
Default: "asc"
Enum: "asc" "desc"

Sort order by time.

Responses

Response samples

Content type
application/json
{
  • "pages": 0,
  • "data": [
    ]
}