Files
laaser 7eed50f17b
LocationBasedServices/sumoc-backend/pipeline/head This commit looks good
trying to fix with migration script
2026-03-06 11:42:11 +01:00

2535 lines
66 KiB
YAML

openapi: 3.1.0
info:
title: SuMoC API
description: API-Dokumentation für SuMoC
version: "1.0"
servers:
- url: http://localhost:8080
description: Generated server url
security:
- bearerAuth: []
paths:
/user/setVisibilityPrivacy:
put:
tags:
- user-controller
summary: Nutzer ändert seine Sichtbarkeits- und Datenschutzeinstellungen
description: "Ein Nutzer kann seine Sichtbarkeits- und Datenschutzeinstellungen\
\ ändern, um zu steuern, wer seine Informationen sehen kann."
operationId: setVisibilityPrivacy
parameters:
- name: visibilityPrivacy
in: query
required: true
schema:
type: string
enum:
- NONE
- FRIENDS_ONLY
- PUBLIC
responses:
"200":
description: Sichtbarkeits- und Datenschutzeinstellungen erfolgreich geändert
content:
application/json: {}
"400":
description: Ungültige Eingabedaten
content:
application/json: {}
"403":
description: Ungültige Eingabedaten
content:
application/json: {}
"409":
description: Ungültige Eingabedaten
content:
application/json: {}
/user/setProfilePicture/{id}:
put:
tags:
- user-controller
summary: Add a profile Picture to the user.
description: A user can add or update a profile picture to be displayed on his
profile.
operationId: setProfilePicture
parameters:
- name: id
in: path
required: true
schema:
type: integer
format: int64
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/ImageRequestDTO"
required: true
responses:
"200":
description: Profile picture successfully added/updated
content:
application/json: {}
"400":
description: Invalid input data
content:
application/json: {}
"403":
description: Only authorized persons may add/update the profile picture
content:
application/json: {}
"404":
description: The user does not exist
content:
application/json: {}
/user/setPrivateName/{id}:
put:
tags:
- user-controller
summary: Update a users private name.
description: A user can change it's own private name that is shown to friends.
operationId: setPrivateName
parameters:
- name: id
in: path
required: true
schema:
type: integer
format: int64
- name: newPrivateName
in: query
required: true
schema:
type: string
responses:
"200":
description: Passwort erfolgreich geändert
content:
application/json: {}
"400":
description: Ungültige Eingabedaten
content:
application/json: {}
"403":
description: Nur autorisierte Personen dürfen das Passwort ändern
content:
application/json: {}
"404":
description: Der Nutzer existiert nicht
content:
application/json: {}
/user/setPassword/{id}:
put:
tags:
- user-controller
summary: Nutzer ändert sein Passwort
description: "Ein Nutzer kann sein Passwort ändern, um die Sicherheit seines\
\ Kontos zu gewährleisten."
operationId: setPassword
parameters:
- name: id
in: path
required: true
schema:
type: integer
format: int64
- name: newPassword
in: query
required: true
schema:
type: string
responses:
"200":
description: Passwort erfolgreich geändert
content:
application/json:
schema:
$ref: "#/components/schemas/LoginResponseDTO"
"400":
description: Ungültige Eingabedaten
content:
application/json: {}
"403":
description: Nur autorisierte Personen dürfen das Passwort ändern
content:
application/json: {}
"404":
description: Der Nutzer existiert nicht
content:
application/json: {}
/user/setEmail/{id}:
put:
tags:
- user-controller
summary: Nutzer ändert seine E-Mail-Adresse
description: "Ein Nutzer kann seine E-Mail-Adresse ändern, um sicherzustellen,\
\ dass seine Kontaktdaten aktuell sind."
operationId: setEmail
parameters:
- name: id
in: path
required: true
schema:
type: integer
format: int64
- name: newEmail
in: query
required: true
schema:
type: string
responses:
"200":
description: E-Mail-Adresse erfolgreich geändert
content:
application/json:
schema:
$ref: "#/components/schemas/LoginResponseDTO"
"400":
description: Ungültige Eingabedaten
content:
application/json: {}
"403":
description: Nur autorisierte Personen dürfen die Email ändern
content:
application/json: {}
"404":
description: Der Nutzer existiert nicht
content:
application/json: {}
"409":
description: Die Email wurde bereits vergeben
content:
application/json: {}
/trip/validateTrip/{tripId}:
put:
tags:
- trip-controller
summary: Validate a trip for the authenticated user.
operationId: validateTrip
parameters:
- name: tripId
in: path
required: true
schema:
type: integer
format: int64
responses:
"200":
description: OK
/trip/invalidateTrip/{tripId}:
put:
tags:
- trip-controller
summary: Invalidate a trip for the authenticated user.
operationId: invalidateTrip
parameters:
- name: tripId
in: path
required: true
schema:
type: integer
format: int64
responses:
"200":
description: OK
/routing/preferences/update:
put:
tags:
- routing-preferences-controller
summary: Update the routing preferences of the current user
description: Updates the routing preferences for the authenticated user with
the provided settings.
operationId: updateRoutingPreferences
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/RoutingPreferencesDTO"
required: true
responses:
"200":
description: OK
/notifications/unregister-device-token:
put:
tags:
- notification-controller
description: Unregisters the device token for push notifications for the authenticated
user.
operationId: unregisterDeviceToken
responses:
"200":
description: OK
/notifications/register-device-token:
put:
tags:
- notification-controller
summary: Registers a device token for push notifications for the authenticated
user.
operationId: registerDeviceToken
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/RegisterDeviceTokenRequest"
required: true
responses:
"200":
description: OK
/challenges/modifyChallenge:
put:
tags:
- challenge-controller
summary: Modify a challenge by ID
operationId: modifyChallengeById
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/ChallengeDTO"
required: true
responses:
"200":
description: Challenge modified successfully
content:
application/json:
schema:
$ref: "#/components/schemas/ChallengeDTO"
"404":
description: Challenge not found
content:
'*/*':
schema:
$ref: "#/components/schemas/ChallengeDTO"
"400":
description: Invalid input data
content:
'*/*':
schema:
$ref: "#/components/schemas/ChallengeDTO"
/challenges/deactivateChallenge/{challengeId}:
put:
tags:
- challenge-controller
summary: Deactivate a challenge by ID
operationId: deactivateChallengeById
parameters:
- name: challengeId
in: path
required: true
schema:
type: integer
format: int64
responses:
"200":
description: Challenge deactivated successfully
"404":
description: Challenge not found
/challenges/activateChallenge/{challengeId}:
put:
tags:
- challenge-controller
summary: Activate a challenge by ID
operationId: activateChallengeById
parameters:
- name: challengeId
in: path
required: true
schema:
type: integer
format: int64
responses:
"200":
description: Challenge activated successfully
"404":
description: Challenge not found
/badges/modifyBadge:
put:
tags:
- badge-controller
summary: Modify a badge by ID
operationId: modifyBadgeById
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/BadgeDTO"
required: true
responses:
"200":
description: Badge modified successfully
content:
application/json:
schema:
$ref: "#/components/schemas/BadgeDTO"
"404":
description: Badge not found
content:
'*/*':
schema:
$ref: "#/components/schemas/BadgeDTO"
"400":
description: Invalid input data
content:
'*/*':
schema:
$ref: "#/components/schemas/BadgeDTO"
/user/stats/add:
post:
tags:
- user-controller
summary: Add stats to the current user
description: Adds a value to a stat field for the current user. Optionally checks
and awards badges afterwards.
operationId: addStats
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/AddStatRequestDTO"
required: true
responses:
"200":
description: Stats updated successfully
"400":
description: Invalid stat field / invalid input
content:
application/json: {}
"403":
description: Not authorized
content:
application/json: {}
/trip/uploadTrip:
post:
tags:
- trip-controller
summary: User uploads a new trip from the App.
operationId: uploadTrip
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/NewTripDTO"
required: true
responses:
"200":
description: OK
content:
'*/*':
schema:
type: integer
format: int64
/routing/directions/request:
post:
tags:
- routing-directions-controller
operationId: requestDirections
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/RoutingDirectionsRequestDTO"
required: true
responses:
"200":
description: OK
content:
'*/*':
schema:
type: array
items:
$ref: "#/components/schemas/RouteDTO"
/routing/alternative/request:
post:
tags:
- routing-alternative-controller
operationId: requestAlternativeRoutes
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/RoutingAlternativeRequestDTO"
required: true
responses:
"200":
description: OK
content:
'*/*':
schema:
type: array
items:
$ref: "#/components/schemas/RouteDTO"
/friendship/unblock/{friendId}:
post:
tags:
- friendship-controller
summary: Unblock a user.
description: Unblocks the user with friendId for the logged in user.
operationId: unblockUser
parameters:
- name: friendId
in: path
required: true
schema:
type: integer
format: int64
responses:
"200":
description: OK
/friendship/request/{friendId}:
post:
tags:
- friendship-controller
summary: Request a friendship with another user.
description: Sends a friendship request to another user from the logged in user.
operationId: requestFriendship
parameters:
- name: friendId
in: path
required: true
schema:
type: integer
format: int64
responses:
"200":
description: OK
/friendship/request/by-friendcode/{friendCode}:
post:
tags:
- friendship-controller
summary: Request a friendship with another user by friend code.
description: Sends a friendship request to another user identified by their
friend code from the logged in user.
operationId: requestFriendshipByFriendcode
parameters:
- name: friendCode
in: path
required: true
schema:
type: string
responses:
"200":
description: OK
/friendship/reject/{friendId}:
post:
tags:
- friendship-controller
summary: Reject a friendship request.
description: Rejects a pending friendship request for the logged in user from
user with friendId.
operationId: rejectFriendship
parameters:
- name: friendId
in: path
required: true
schema:
type: integer
format: int64
responses:
"200":
description: OK
/friendship/block/{friendId}:
post:
tags:
- friendship-controller
summary: Block a user.
description: Blocks the user with friendId for the logged in user.
operationId: blockUser
parameters:
- name: friendId
in: path
required: true
schema:
type: integer
format: int64
responses:
"200":
description: OK
/friendship/accept/{friendId}:
post:
tags:
- friendship-controller
summary: Accept a friendship request.
description: Accepts a pending friendship request for the logged in user from
user with friendId.
operationId: acceptFriendship
parameters:
- name: friendId
in: path
required: true
schema:
type: integer
format: int64
responses:
"200":
description: OK
/dev/trigger-trend-calculation:
post:
tags:
- dev-controller
operationId: triggerTrendCalculation
responses:
"200":
description: OK
/dev/test-detection-and-notification-regular-trips:
post:
tags:
- dev-controller
operationId: testDetectionAndNotificationOfRegularTrips
responses:
"200":
description: OK
/challenges/createChallenge:
post:
tags:
- challenge-controller
summary: Create a new challenge
operationId: createChallenge
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/ChallengeDTO"
required: true
responses:
"201":
description: Challenge created successfully
content:
application/json:
schema:
$ref: "#/components/schemas/ChallengeDTO"
"400":
description: Invalid input data
content:
'*/*':
schema:
$ref: "#/components/schemas/ChallengeDTO"
/badges/createBadge:
post:
tags:
- badge-controller
summary: Create a new badge
operationId: createBadge
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/BadgeDTO"
required: true
responses:
"201":
description: Badge created successfully
content:
application/json:
schema:
$ref: "#/components/schemas/BadgeDTO"
"400":
description: Invalid input data
content:
'*/*':
schema:
$ref: "#/components/schemas/BadgeDTO"
"409":
description: Badge already exists
content:
'*/*':
schema:
$ref: "#/components/schemas/BadgeDTO"
/badges/checkBadgeAndAward:
post:
tags:
- badge-controller
summary: Check badges for current user and award newly unlocked ones
operationId: checkAndAwardBadges
responses:
"200":
description: Check successful
/auth/user/reset-password:
post:
tags:
- user-authentication-controller
summary: 'Veränderung des Passworts eines Profils '
description: Durch Eingabe eines Validen OTP Codes zu einer zugehörigen Email
kann das Passwort des Profils geändert werden.
operationId: resetPassword
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/PasswordResetDTO"
required: true
responses:
"200":
description: OK
content:
'*/*':
schema:
type: string
/auth/user/request-otp-for-password-reset:
post:
tags:
- user-authentication-controller
summary: OTP Code zur änderung des Passworts
description: "Erstellt bei Anfrage einen neuen 6-stelligen OTP Code, mit welchem\
\ das Passwort des Accounts mit der zugehörigen Email einmalig verändert werden\
\ kann. Dieser wird per Mail an den Nutzer gesendet."
operationId: requestOtpForPasswordReset
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/OtpRequestDTO"
required: true
responses:
"200":
description: OK
content:
'*/*':
schema:
type: string
/auth/user/registration:
post:
tags:
- user-authentication-controller
summary: Registriert einen neuen Benutzer
description: Erstellt einen neuen Benutzer und gibt die Benutzerdaten zurück
operationId: registerUser
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/UserRegistrationDTO"
required: true
responses:
"200":
description: Benutzer erfolgreich registriert
content:
application/json:
schema:
$ref: "#/components/schemas/RegistrationResponseDTO"
"400":
description: Ungültige Eingabedaten
content:
application/json: {}
/auth/user/login:
post:
tags:
- user-authentication-controller
summary: Authentifiziert einen Benutzer
description: Prüft den Benutzernamen und das Passwort und gibt ein JWT zurück
operationId: login
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/UserAuthenticationPairDTO"
required: true
responses:
"200":
description: Erfolgreiche Anmeldung
content:
application/json:
schema:
$ref: "#/components/schemas/LoginResponseDTO"
"401":
description: Ungültiger Benutzername oder Passwort
content:
application/json: {}
/user/stats:
get:
tags:
- user-controller
summary: get stats of current user
description: Returns all stats of a user
operationId: getStats
responses:
"200":
description: Stats were found
content:
application/json:
schema:
$ref: "#/components/schemas/StatsList"
"403":
description: Not authorized
content:
application/json: {}
/user/profile:
get:
tags:
- user-controller
summary: Nutzer fragt sein eigenes Profil an
description: "Ein Nutzer kann sein eigenes Profil anfragen, um dessen Informationen\
\ einzusehen."
operationId: getUser
responses:
"200":
description: Nutzerprofil erfolgreich abgerufen
content:
application/json:
schema:
$ref: "#/components/schemas/MaximalUserDTO"
"304":
description: Nutzerprofil wurde seit dem letzten Abruf nicht verändert
content:
application/json: {}
"404":
description: Der Nutzer existiert nicht
content:
application/json: {}
/user/profile/{id}:
get:
tags:
- user-controller
summary: Nutzer fragt ein fremdes Nutzerprofil an
description: "Ein Nutzer kann das Profil eines anderen Nutzers anfragen, um\
\ dessen öffentliche Informationen einzusehen."
operationId: getUser_1
parameters:
- name: id
in: path
required: true
schema:
type: integer
format: int64
responses:
"200":
description: Nutzerprofil erfolgreich abgerufen
content:
application/json:
schema:
$ref: "#/components/schemas/MinimalUserDTO"
"403":
description: Nutzerprofil darf nicht aufgerufen werden
content:
application/json: {}
"404":
description: Nutzerprofil nicht gefunden
content:
application/json: {}
/user/getTotalXP:
get:
tags:
- user-controller
summary: Get the users own xp
description: A user can get their own xp.
operationId: getTotalXP
responses:
"200":
description: XP successfully retrieved
content:
application/json:
schema:
type: integer
format: int64
"403":
description: Not authorized
content:
application/json: {}
"404":
description: The user does not exist
content:
application/json: {}
/user/getProfilePicture/{id}:
get:
tags:
- user-controller
summary: Get the profile Picture of the user.
description: A user can get their displayed profile picture.
operationId: getProfilePicture
parameters:
- name: id
in: path
required: true
schema:
type: integer
format: int64
responses:
"200":
description: Profile picture successfully retrieved
content:
application/json:
schema:
$ref: "#/components/schemas/ImageRequestDTO"
"304":
description: Profile picture not modified since last request
content:
application/json:
schema:
$ref: "#/components/schemas/ImageRequestDTO"
"403":
description: Only authorized persons may see the profiles picture
content:
application/json:
schema:
$ref: "#/components/schemas/ImageRequestDTO"
"404":
description: The user does not exist
content:
application/json:
schema:
$ref: "#/components/schemas/ImageRequestDTO"
/trip/getAllUserTrips:
get:
tags:
- trip-controller
summary: Retrieve all trips of the authenticated user.
operationId: getAllUserTrips
responses:
"200":
description: OK
content:
'*/*':
schema:
type: array
items:
$ref: "#/components/schemas/TripDTO"
/routing/preferences/get:
get:
tags:
- routing-preferences-controller
summary: Get the routing preferences of the current user
description: Retrieves the routing preferences set by the authenticated user.
operationId: getRoutingPreferences
responses:
"200":
description: OK
content:
'*/*':
schema:
$ref: "#/components/schemas/RoutingPreferencesDTO"
/routing/alternative/carrousel/request:
get:
tags:
- routing-alternative-carrousel-controller
operationId: getAlternativeCarrousel
responses:
"200":
description: OK
content:
'*/*':
schema:
$ref: "#/components/schemas/AlternativeCarrouselDTO"
/leaderboard/getLeaderboard:
get:
tags:
- leaderboard-controller
summary: Get the global score table
operationId: getLeaderboard
parameters:
- name: timeframe
in: query
required: true
schema:
type: string
enum:
- TOTAL
- MONTHLY
- WEEKLY
- name: field
in: query
required: true
schema:
type: string
responses:
"200":
description: Successfully retrieved global score table
content:
application/json:
schema:
$ref: "#/components/schemas/Leaderboard"
"304":
description: Not modified
content:
'*/*':
schema:
$ref: "#/components/schemas/Leaderboard"
"400":
description: Bad request
content:
'*/*':
schema:
$ref: "#/components/schemas/Leaderboard"
/leaderboard/getFriendLeaderboard:
get:
tags:
- leaderboard-controller
summary: Get the friend score table
operationId: getFriendLeaderboard
parameters:
- name: timeframe
in: query
required: true
schema:
type: string
enum:
- TOTAL
- MONTHLY
- WEEKLY
- name: field
in: query
required: true
schema:
type: string
responses:
"200":
description: Successfully retrieved friend score table
content:
application/json:
schema:
$ref: "#/components/schemas/Leaderboard"
"304":
description: Not modified
content:
'*/*':
schema:
$ref: "#/components/schemas/Leaderboard"
"400":
description: Bad request
content:
'*/*':
schema:
$ref: "#/components/schemas/Leaderboard"
/geocoding/reverse:
get:
tags:
- geocoding-controller
description: Returns the address at the given lat / lon.
operationId: reverse
parameters:
- name: lat
in: query
required: true
schema:
type: number
format: double
- name: lon
in: query
required: true
schema:
type: number
format: double
responses:
"200":
description: OK
content:
'*/*':
schema:
$ref: "#/components/schemas/AddressDTO"
/friendship/blocked:
get:
tags:
- friendship-controller
summary: Get all users the logged in user has blocked.
description: Returns a list of all users that have been blocked by the logged
in user.
operationId: blockedUsers
responses:
"200":
description: OK
content:
'*/*':
schema:
type: array
items:
$ref: "#/components/schemas/MinimalUserDTO"
/friendship/all:
get:
tags:
- friendship-controller
summary: Return all friendships of the logged in user.
description: |2
Returns all friendships of all statuses (pending, accepted, rejected, blocked) for the logged in user.
A friendship between two users always consists of one or two entries in the database. One for each direction.
The user is always the one to whom the status applies.
- If A requests friendship from B, B -> A = PENDING, A -> B = REQUESTED
- If A accepts friendship from B, B -> A = ACCEPTED, A -> B = ACCEPTED
- If A rejects friendship from B, B -> A = REJECTED
- If A blocks B, B -> A = BLOCKED
Per friendship system logic the logged in user is to whom the statuses apply.
Meaning a blocked status indicates that the logged in user has been blocked by the other user.
operationId: getFriendships
responses:
"200":
description: OK
content:
'*/*':
schema:
type: array
items:
$ref: "#/components/schemas/FriendshipDTO"
/friendship/accepted:
get:
tags:
- friendship-controller
summary: Return all accepted friends of the logged in user.
description: Returns all friends with accepted status.
operationId: getAcceptedFriendships
responses:
"200":
description: OK
content:
'*/*':
schema:
type: array
items:
$ref: "#/components/schemas/FriendshipDTO"
/dev/test-notification-from-detected-regular-trip:
get:
tags:
- dev-controller
description: Testing endpoint that mocks the detection of regular trips and
then tests the alternative calculation and notification scheduling.
operationId: testNotificationFromDetectedRegularTrip
responses:
"200":
description: OK
content:
'*/*':
schema:
type: string
/dev/test-meteo:
get:
tags:
- dev-controller
operationId: testMeteoClient
responses:
"200":
description: OK
/dev/test-firebase-trend-notification/{fcm_token}:
get:
tags:
- dev-controller
description: Immediately sends a test notification of type TREND to the provided
FCM token.
operationId: SendTestTrendNotificationFirebase
parameters:
- name: fcm_token
in: path
required: true
schema:
type: string
responses:
"200":
description: OK
content:
'*/*':
schema:
type: string
/dev/test-firebase-regular-trip-notification/{fcm_token}:
get:
tags:
- dev-controller
description: Immediately sends a test notification of type REGULAR_TRIP_ALTERNATIVE
to the provided FCM token.
operationId: SendTestRegularTripAlternativeNotificationFirebase
parameters:
- name: fcm_token
in: path
required: true
schema:
type: string
responses:
"200":
description: OK
content:
'*/*':
schema:
type: string
/dev/test-firebase-friendship-request-notification/{fcm_token}:
get:
tags:
- dev-controller
description: Immediately sends a test notification of type FRIENDSHIP_REQUEST_RECEIVED
to the provided FCM token.
operationId: SendTestRFriendshipRequestReceivedNotificationFirebase
parameters:
- name: fcm_token
in: path
required: true
schema:
type: string
responses:
"200":
description: OK
content:
'*/*':
schema:
type: string
/dev/test-firebase-adhoc-route-notification/{fcm_token}:
get:
tags:
- dev-controller
description: Immediately sends a test notification of type ADHOC_ALTERNATIVE
to the provided FCM token.
operationId: SendTestAdhocRouteNotificationFirebase
parameters:
- name: fcm_token
in: path
required: true
schema:
type: string
responses:
"200":
description: OK
content:
'*/*':
schema:
type: string
/dev/test-clean-old-notifications:
get:
tags:
- dev-controller
description: Tests the method cleaning old notifications from the database.
operationId: testCleanOldNotifications
responses:
"200":
description: OK
/dev/queue-test-notification:
get:
tags:
- dev-controller
description: Immediately queues a notification to the fcm key specified in application-dev.properties
to be processed by the notification queue.
operationId: queueTestNotification
responses:
"200":
description: OK
content:
'*/*':
schema:
type: string
/challenges/getChallenge/{challengeId}:
get:
tags:
- challenge-controller
summary: Get a challenge by ID
operationId: getChallengeById
parameters:
- name: challengeId
in: path
required: true
schema:
type: integer
format: int64
responses:
"200":
description: Challenge retrieved successfully
content:
application/json:
schema:
$ref: "#/components/schemas/ChallengeDTO"
"304":
description: Not modified since last request
content:
'*/*':
schema:
$ref: "#/components/schemas/ChallengeDTO"
"404":
description: Challenge not found
content:
'*/*':
schema:
$ref: "#/components/schemas/ChallengeDTO"
/challenges/getAvailableChallenges:
get:
tags:
- challenge-controller
summary: Get all available challenges
operationId: getAvailableChallenges
responses:
"200":
description: Available challenges retrieved successfully
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/ChallengeDTO"
"304":
description: Not modified since last request
content:
'*/*':
schema:
type: array
items:
$ref: "#/components/schemas/ChallengeDTO"
"404":
description: No available challenges found
content:
'*/*':
schema:
type: array
items:
$ref: "#/components/schemas/ChallengeDTO"
/challenges/getAllChallenges:
get:
tags:
- challenge-controller
summary: Get all challenges
operationId: getAllChallenges
responses:
"200":
description: Challenges retrieved successfully
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/ChallengeDTO"
"304":
description: Not modified since last request
content:
'*/*':
schema:
type: array
items:
$ref: "#/components/schemas/ChallengeDTO"
"404":
description: No challenges found
content:
'*/*':
schema:
type: array
items:
$ref: "#/components/schemas/ChallengeDTO"
/badges/getBadges/{userId}:
get:
tags:
- badge-controller
summary: Get Badges by user
operationId: getBadgesByUser
parameters:
- name: userId
in: path
required: true
schema:
type: integer
format: int64
responses:
"200":
description: Badges retrieved successfully
content:
'*/*':
schema:
type: array
items:
$ref: "#/components/schemas/UserBadgeDTO"
"404":
description: No badges found for user
content:
'*/*':
schema:
type: array
items:
$ref: "#/components/schemas/UserBadgeDTO"
/badges/getBadge/{badgeId}:
get:
tags:
- badge-controller
summary: Get a badge by ID
operationId: getBadgeById
parameters:
- name: badgeId
in: path
required: true
schema:
type: integer
format: int64
responses:
"200":
description: Badge retrieved successfully
content:
application/json:
schema:
$ref: "#/components/schemas/BadgeDTO"
"304":
description: Not modified since last request
content:
'*/*':
schema:
$ref: "#/components/schemas/BadgeDTO"
"404":
description: Badge not found
content:
'*/*':
schema:
$ref: "#/components/schemas/BadgeDTO"
/badges/getAllBadges:
get:
tags:
- badge-controller
summary: Get all badges
operationId: getAllBadges
responses:
"200":
description: Badges retrieved successfully
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/BadgeDTO"
"304":
description: Not modified since last request
content:
'*/*':
schema:
type: array
items:
$ref: "#/components/schemas/BadgeDTO"
"404":
description: No badges found
content:
'*/*':
schema:
type: array
items:
$ref: "#/components/schemas/BadgeDTO"
/user/deleteMobilityData:
delete:
tags:
- user-controller
summary: Delete all mobility data of the authenticated user
description: "Deletes all trips (including trip segments), notifications, weekly\
\ mobility stats and carrousel candidates belonging to the current user."
operationId: deleteMobilityData
responses:
"204":
description: Mobility data successfully deleted
"403":
description: Not authorized
content:
application/json: {}
/user/delete/{id}:
delete:
tags:
- user-controller
summary: Nutzer löscht sein eigenes Profil
description: Ein Nutzer kann sein eigenes Profil löschen. Dies entfernt alle
seine Daten aus dem System.
operationId: deleteUser
parameters:
- name: id
in: path
required: true
schema:
type: integer
format: int64
responses:
"200":
description: Nutzerprofil erfolgreich gelöscht
content:
'*/*':
schema:
type: object
"403":
description: "Keine Berechtigung, fremdes Profil zu löschen"
content:
'*/*':
schema:
type: object
"404":
description: Der Nutzer existiert nicht
content:
'*/*':
schema:
type: object
/trip/deleteTrip/{tripId}:
delete:
tags:
- trip-controller
summary: Delete a trip for the authenticated user.
operationId: deleteTrip
parameters:
- name: tripId
in: path
required: true
schema:
type: integer
format: int64
responses:
"200":
description: OK
/trip/deleteAllTrips:
delete:
tags:
- trip-controller
summary: Delete all trips of the authenticated user.
operationId: deleteAllTrips
responses:
"200":
description: OK
/friendship/unfriend/{friendId}:
delete:
tags:
- friendship-controller
summary: Unfriend a user.
description: Removes an accepted friendship between the logged in user and user
with friendId.
operationId: unfriend
parameters:
- name: friendId
in: path
required: true
schema:
type: integer
format: int64
responses:
"200":
description: OK
/challenges/deleteChallenge/{challengeId}:
delete:
tags:
- challenge-controller
summary: Delete a challenge by ID
operationId: deleteChallengeById
parameters:
- name: challengeId
in: path
required: true
schema:
type: integer
format: int64
responses:
"200":
description: Challenge deleted successfully
"404":
description: Challenge not found
/badges/deleteBadge/{badgeId}:
delete:
tags:
- badge-controller
summary: Delete a badge by ID
operationId: deleteBadgeById
parameters:
- name: badgeId
in: path
required: true
schema:
type: integer
format: int64
responses:
"200":
description: Badge deleted successfully
"404":
description: Badge not found
components:
schemas:
ImageRequestDTO:
type: object
properties:
base64ProfilePicture:
type: string
LoginResponseDTO:
type: object
properties:
userDTO:
$ref: "#/components/schemas/UserDTO"
jwt:
type: string
UserDTO:
type: object
properties:
userId:
type: integer
format: int64
privateName:
type: string
publicName:
type: string
roles:
type: array
items:
type: string
enum:
- USER
- ADMIN
uniqueItems: true
friendCode:
type: string
id:
type: integer
format: int64
RoutingPreferencesDTO:
type: object
description: This DTO represents the user preferences for routing / alternative
route suggestions.
properties:
preferPhysicalActivity:
type: boolean
description: "Whether to prefer alternative routes that involve physical\
\ activity (walking, cycling) when suggestin alternative routes."
considerWeatherConditions:
type: boolean
description: Whether to consider current weather conditions when suggesting
alternative routes.
modalitiesToConsider:
type: array
items:
type: string
enum:
- IDLE
- WALKING
- BICYCLE
- ESCOOTER
- BUS
- TRAM
- TRAIN
- CAR
- MOTORCYCLE
- TAXI
RegisterDeviceTokenRequest:
type: object
properties:
token:
type: string
provider:
type: string
enum:
- FIREBASE
ChallengeDTO:
type: object
properties:
id:
type: integer
format: int64
name:
type: string
description:
type: string
base64image:
type: string
criteria:
type: object
additionalProperties:
type: integer
format: int32
reward:
type: integer
format: int32
BadgeDTO:
type: object
properties:
id:
type: integer
format: int64
name:
type: string
description:
type: string
category:
type: string
enum:
- XP
- MOBILITY_SCORE
- CO2
- IDLE
- WALKING
- BICYCLE
- ESCOOTER
- BUS
- TRAM
- TRAIN
- CAR
- OPNV
- MONTHLY
- HIDDEN
criteria:
type: object
additionalProperties:
type: integer
format: int32
imageBase64:
type: string
AddStatRequestDTO:
type: object
properties:
stat:
type: string
value:
type: integer
format: int64
minimum: 0
scope:
type: string
enum:
- TOTAL
- MONTHLY
- WEEKLY
- ALL
awardBadges:
type: boolean
awardChallenges:
type: boolean
required:
- stat
- value
NewTripDTO:
type: object
description: DTO for creating a new Trip
properties:
startPlace:
type: string
description: High level description of the trip's starting location
startLatitude:
type: number
format: double
startLongitude:
type: number
format: double
endPlace:
type: string
description: High level description of the trip's ending location
endLatitude:
type: number
format: double
endLongitude:
type: number
format: double
startTime:
type: string
format: date-time
endTime:
type: string
format: date-time
mobilityScore:
type: number
format: double
co2Emissions:
type: number
format: double
tripSegments:
type: array
items:
$ref: "#/components/schemas/NewTripSegmentDTO"
maxItems: 2147483647
minItems: 1
uniqueItems: true
required:
- tripSegments
NewTripSegmentDTO:
type: object
properties:
modality:
type: string
enum:
- IDLE
- WALKING
- BICYCLE
- ESCOOTER
- BUS
- TRAM
- TRAIN
- CAR
- MOTORCYCLE
- TAXI
startTime:
type: string
format: date-time
distanceMeters:
type: number
format: float
RoutingDirectionsRequestDTO:
type: object
description: "DTO representing a request for routing directions between two\
\ points. Points can be specified either by coordinates or addresses.If both\
\ provided, coordinates are preferred."
properties:
originLat:
type: number
format: double
originLon:
type: number
format: double
destinationLat:
type: number
format: double
destinationLon:
type: number
format: double
originAddress:
type: string
destinationAddress:
type: string
arrivalTime:
type: string
format: date-time
departureTime:
type: string
format: date-time
routingPreferencesDTO:
$ref: "#/components/schemas/RoutingPreferencesDTO"
description: "Routing preferences to customize the routing behavior. If\
\ null, will search for stored user preferences, if not found, use default."
AddressDTO:
type: object
properties:
houseNumber:
type: string
road:
type: string
suburb:
type: string
cityDistrict:
type: string
city:
type: string
state:
type: string
iso3166_2_lvl4:
type: string
postcode:
type: string
country:
type: string
countryCode:
type: string
RouteDTO:
type: object
description: This DTO represents a suggested route as a response to a requested
alternative route.
properties:
startAddress:
$ref: "#/components/schemas/AddressDTO"
description: The actual address of the start location.
firstStopName:
type: string
description: The name of the first stop if the route uses public transport.
E.g. "Essen West" if the route starts with a footpath to the first train
leaving there.
startLat:
type: number
format: double
description: The latitude of the start address.
startLon:
type: number
format: double
description: The longitude of the start address.
endAddress:
$ref: "#/components/schemas/AddressDTO"
description: The actual address of the end location.
lastStopName:
type: string
description: The name of the last stop if the route uses public transport.
E.g. "Essen Hbf" if the route ends with a train arriving there (might
still contain a footpath afterwards).
endLat:
type: number
format: double
description: The latitude of the end address.
endLon:
type: number
format: double
description: The longitude of the end address.
startDateTime:
type: string
format: date-time
description: The start date and time of the route.
endDateTime:
type: string
format: date-time
description: The end date and time of the route.
steps:
type: array
description: The steps the route consists of.
items:
oneOf:
- $ref: "#/components/schemas/StepDTO"
- $ref: "#/components/schemas/TransitStepDTO"
co2Savings:
type: number
format: double
description: Amount of CO2e savings in gramm compared to a car trip for
the same route.
co2Emissions:
type: number
format: double
description: CO2e emission of this route.
timeDifferenceSeconds:
type: number
format: double
description: The temporal difference in minutes compared to the original
route (in case alternative was requested) / the car route (when simply
directions requested) .
physicalActivity:
type: boolean
durationSeconds:
type: integer
format: int64
cyclingRoute:
type: boolean
walkingRoute:
type: boolean
StepDTO:
type: object
description: A single step within a suggested alternative route.
discriminator:
propertyName: type
properties:
modality:
type: string
enum:
- IDLE
- WALKING
- BICYCLE
- ESCOOTER
- BUS
- TRAM
- TRAIN
- CAR
- MOTORCYCLE
- TAXI
distanceMeters:
type: number
format: double
type:
type: string
required:
- type
TransitStepDTO:
allOf:
- $ref: "#/components/schemas/StepDTO"
- type: object
properties:
lineNumber:
type: string
lineHeadsign:
type: string
startStop:
type: string
endStop:
type: string
description: A single transit step within a suggested alternative route.
RoutingAlternativeRequestDTO:
type: object
description: This DTO represents a request for alternative routes between an
origin and a destination.
properties:
originLat:
type: number
format: double
originLon:
type: number
format: double
destinationLat:
type: number
format: double
destinationLon:
type: number
format: double
arrivalTime:
type: string
format: date-time
departureTime:
type: string
format: date-time
routingPreferencesDTO:
$ref: "#/components/schemas/RoutingPreferencesDTO"
required:
- arrivalTime
- departureTime
- destinationLat
- destinationLon
- originLat
- originLon
PasswordResetDTO:
type: object
properties:
otpCode:
type: string
email:
type: string
newPassword:
type: string
OtpRequestDTO:
type: object
properties:
email:
type: string
UserRegistrationDTO:
type: object
properties:
privateName:
type: string
publicName:
type: string
email:
type: string
password:
type: string
required:
- email
- password
- privateName
- publicName
RegistrationResponseDTO:
type: object
properties:
userDTO:
$ref: "#/components/schemas/UserDTO"
jwt:
type: string
status:
type: string
enum:
- SUCCESS
- EMAIL_EXISTS
- EMAIL_INVALID
- PUBLIC_NAME_EXISTS
- PUBLIC_NAME_FORBIDDEN
- PASSWORD_INVALID
- UNKNOWN_ERROR
UserAuthenticationPairDTO:
type: object
properties:
email:
type: string
password:
type: string
required:
- email
- password
Stats:
type: object
properties:
km_PUBLIC_TRANSPORT:
type: integer
format: int64
mobility_SCORE:
type: integer
format: int64
co2_SAVED:
type: integer
format: int64
km_CYCLED:
type: integer
format: int64
km_WALKED:
type: integer
format: int64
km_DRIVEN:
type: integer
format: int64
xp:
type: integer
format: int64
StatsList:
type: object
properties:
id:
type: integer
format: int64
description: Unique identifier of the StatsList.
example: 1
totalStats:
$ref: "#/components/schemas/Stats"
description: Total stats of the user.
monthlyStats:
$ref: "#/components/schemas/Stats"
description: Monthly stats of the user.
weeklyStats:
$ref: "#/components/schemas/Stats"
description: Weekly stats of the user.
Badge:
type: object
properties:
id:
type: integer
format: int64
name:
type: string
description:
type: string
category:
type: string
enum:
- XP
- MOBILITY_SCORE
- CO2
- IDLE
- WALKING
- BICYCLE
- ESCOOTER
- BUS
- TRAM
- TRAIN
- CAR
- OPNV
- MONTHLY
- HIDDEN
image:
$ref: "#/components/schemas/BadgeImageEntity"
criteria:
type: object
additionalProperties:
type: integer
format: int32
BadgeImageEntity:
type: object
properties:
id:
type: integer
format: int32
imageData:
type: string
format: byte
badge:
$ref: "#/components/schemas/Badge"
Friendship:
type: object
properties:
id:
type: integer
format: int64
user:
$ref: "#/components/schemas/User"
friend:
$ref: "#/components/schemas/User"
status:
type: string
enum:
- REQUESTED
- PENDING
- ACCEPTED
- REJECTED
- BLOCKED
createdAt:
type: string
format: date-time
MaximalUserDTO:
type: object
properties:
id:
type: integer
format: int64
publicName:
type: string
privateName:
type: string
email:
type: string
visibilityPrivacy:
type: string
enum:
- NONE
- FRIENDS_ONLY
- PUBLIC
trips:
type: array
items:
$ref: "#/components/schemas/Trip"
uniqueItems: true
friendships:
type: array
items:
$ref: "#/components/schemas/Friendship"
uniqueItems: true
base64ProfilePicture:
type: string
friendCode:
type: string
NotificationToken:
type: object
properties:
userId:
type: integer
format: int64
provider:
type: string
enum:
- FIREBASE
token:
type: string
ProfileImageEntity:
type: object
properties:
id:
type: integer
format: int32
imageData:
type: string
format: byte
user:
$ref: "#/components/schemas/User"
RoutingPreferences:
type: object
properties:
id:
type: integer
format: int64
user:
$ref: "#/components/schemas/User"
preferPhysicalActivity:
type: boolean
considerWeatherConditions:
type: boolean
modalitiesToConsider:
type: array
items:
type: string
enum:
- IDLE
- WALKING
- BICYCLE
- ESCOOTER
- BUS
- TRAM
- TRAIN
- CAR
- MOTORCYCLE
- TAXI
Trip:
type: object
properties:
id:
type: integer
format: int64
user:
$ref: "#/components/schemas/User"
startPlace:
type: string
startLatitude:
type: number
format: double
startLongitude:
type: number
format: double
startH3Cell:
type: string
endPlace:
type: string
endLatitude:
type: number
format: double
endLongitude:
type: number
format: double
endH3Cell:
type: string
startTime:
type: string
format: date-time
endTime:
type: string
format: date-time
mobilityScore:
type: number
format: double
co2Emissions:
type: number
format: double
cost:
type: number
format: float
invalidated:
type: boolean
mainModality:
type: string
description: Main modality by distance.
enum:
- IDLE
- WALKING
- BICYCLE
- ESCOOTER
- BUS
- TRAM
- TRAIN
- CAR
- MOTORCYCLE
- TAXI
tripSegments:
type: array
items:
$ref: "#/components/schemas/TripSegment"
uniqueItems: true
TripSegment:
type: object
properties:
id:
type: integer
format: int64
trip:
$ref: "#/components/schemas/Trip"
modality:
type: string
enum:
- IDLE
- WALKING
- BICYCLE
- ESCOOTER
- BUS
- TRAM
- TRAIN
- CAR
- MOTORCYCLE
- TAXI
startTime:
type: string
format: date-time
distanceMeters:
type: integer
format: int64
User:
type: object
properties:
id:
type: integer
format: int64
publicName:
type: string
privateName:
type: string
email:
type: string
password:
type: string
visibilityPrivacy:
type: string
enum:
- NONE
- FRIENDS_ONLY
- PUBLIC
friendCode:
type: string
trips:
type: array
items:
$ref: "#/components/schemas/Trip"
uniqueItems: true
friendships:
type: array
items:
$ref: "#/components/schemas/Friendship"
uniqueItems: true
roles:
type: array
items:
type: string
enum:
- USER
- ADMIN
uniqueItems: true
notificationToken:
$ref: "#/components/schemas/NotificationToken"
badges:
type: array
items:
$ref: "#/components/schemas/UserBadge"
uniqueItems: true
routingPreferences:
$ref: "#/components/schemas/RoutingPreferences"
profileImage:
$ref: "#/components/schemas/ProfileImageEntity"
stats:
$ref: "#/components/schemas/StatsList"
UserBadge:
type: object
properties:
id:
type: integer
format: int64
user:
$ref: "#/components/schemas/User"
badge:
$ref: "#/components/schemas/Badge"
awardedAt:
type: string
format: date-time
MinimalUserDTO:
type: object
properties:
id:
type: integer
format: int64
displayName:
type: string
TripDTO:
type: object
description: Represents a trip uploaded to the backend by a user that is already
stored in the DB.
properties:
tripId:
type: integer
format: int64
userId:
type: integer
format: int32
startPlace:
type: string
startLatitude:
type: number
format: double
startLongitude:
type: number
format: double
endPlace:
type: string
endLatitude:
type: number
format: double
endLongitude:
type: number
format: double
startTime:
type: string
format: date-time
endTime:
type: string
format: date-time
mobilityScore:
type: number
format: double
co2Emissions:
type: number
format: double
tripSegments:
type: array
items:
$ref: "#/components/schemas/TripSegmentDTO"
invalidated:
type: boolean
TripSegmentDTO:
type: object
properties:
tripSegmentId:
type: integer
format: int64
tripId:
type: integer
format: int64
modality:
type: string
enum:
- IDLE
- WALKING
- BICYCLE
- ESCOOTER
- BUS
- TRAM
- TRAIN
- CAR
- MOTORCYCLE
- TAXI
startTime:
type: string
format: date-time
distanceMeters:
type: number
format: float
AlternativeCarrouselDTO:
type: object
properties:
alternatives:
type: array
items:
$ref: "#/components/schemas/RouteAlternativeContext"
RouteAlternativeContext:
type: object
description: Wrapper for alternative routes in the carousel.
properties:
carrouselCandidateType:
type: string
enum:
- ADHOC_ALTERNATIVE
- REGULAR_TRIP_ALTERNATIVE
alternative:
$ref: "#/components/schemas/RouteDTO"
Leaderboard:
type: object
properties:
timeframe:
type: string
enum:
- TOTAL
- MONTHLY
- WEEKLY
entries:
type: array
items:
$ref: "#/components/schemas/LeaderboardEntry"
scoreType:
type: string
enum:
- XP
- CO2
- KM
LeaderboardEntry:
type: object
properties:
userId:
type: integer
format: int64
username:
type: string
isFriend:
type: boolean
score:
type: integer
format: int64
base64ProfilePicture:
type: string
FriendshipDTO:
type: object
properties:
friendshipId:
type: integer
format: int64
userId:
type: integer
format: int64
friend:
$ref: "#/components/schemas/MinimalUserDTO"
status:
type: string
enum:
- REQUESTED
- PENDING
- ACCEPTED
- REJECTED
- BLOCKED
createdAt:
type: string
format: date-time
UserBadgeDTO:
type: object
properties:
badgeId:
type: integer
format: int64
name:
type: string
description:
type: string
category:
type: string
enum:
- XP
- MOBILITY_SCORE
- CO2
- IDLE
- WALKING
- BICYCLE
- ESCOOTER
- BUS
- TRAM
- TRAIN
- CAR
- OPNV
- MONTHLY
- HIDDEN
criteria:
type: object
additionalProperties:
type: integer
format: int32
awardedAt:
type: string
format: date-time
imageBase64:
type: string
securitySchemes:
bearerAuth:
type: http
name: bearerAuth
scheme: bearer
bearerFormat: JWT