-
Notifications
You must be signed in to change notification settings - Fork 0
API documentation
The base path for all API requests is https://www.freequiz.ch/api/
Content-Type is application/json unless specified otherwise
Work in progress
Work in progress
Work in progress
Work in progress
https://www.freequiz.ch/api/user/data
- Request method: GET
- Authentication: required
- Content: No content
- Reponse: 200
{
"success": true,
"data": {
"username": "username",
"avatar_url": "avatar_url",
"email": "email",
"unconfirmed_email": null,
"role": "role",
"quizzes": 0,
"created_at": 1772374484,
"updated_at": 1772374497,
"settings": {
"locale": "en",
"dark_mode": true,
"write_amount": 2,
"cards_amount": 2,
"multi_amount": 2,
"round_amount": 10
},
"confirmation": {
"confirmed": false,
"confirmed_at": null
},
"logins": {
"count": 2,
"current_login_at": 1772374497,
"last_login_at": 1772374484,
"sessions": [
{
"purpose": "api",
"expires": 1803910497,
"last_activity": 1772374502,
"current_session": true,
"session_id": "session_id"
}
]
}
}
}https://www.freequiz.ch/api/user/logout
This request invalidated the current session and even if the access token is still known it cannot be used to authenticate anymore.
- Request method: DELETE
- Authentication: required
- Content: No content
- Response: 200
{
"success": true,
"message": "Logged out"
}https://www.freequiz.ch/api/user/destroy_session/:session_id
This endpoint can be used to invalidate other sessions than the current one. Though the current one can also be invalidated using this endpoint. All required information to invalidate a session is the session_id which is obtained through the user data endpoint
- Request method: DELETE
- Authentication: required
- Content: No content
- Response:
- 200: Session successfuly invalidated
- 404: Session does not exist anymore or does not belong to that user
200: Session successfuly invalidated
{
"success": true,
"message": "Session deleted"
}404: Session does not exist anymore or does not belong to that user
{
"success": false,
"token": "session.notfound",
"message": "Session to be deleted was not found or does not belong to the user"
}Work in progress