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"
}

Logout

Log out user.

Authorizations:
BasicAuth

Responses

Response samples

Content type
application/json
true

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
true

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. Fields are updated in order username, password, image. If one fails, subsequent are not updated.
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
image
string <binary>

Responses

Request samples

Content type
application/json
{
  • "username": "string",
  • "password": "string",
  • "image": "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

Responses

Response samples

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

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
Request Body schema: application/json
required
content
required
string

Responses

Request samples

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

Response samples

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

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

Responses

Response samples

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