-
Notifications
You must be signed in to change notification settings - Fork 0
API Documentation
Behold: our API documentation! π Click on each endpoint to see more information. All API documenation follows the following format:
GET/POST/PUT/DELETE: /pathToEndpoint
Description of what endpoint does
type parameter
description of parameter
{
"id": "String",
"message": "String",
"additionalContact": "String",
"status": "Status"
}
POST: /api/account
Allows a user to create an account. Must be logged in with an account with Authority 'Server' to access it.
AccoutDto
the account DTO object
An account Dto object
{
"username": "String",
"password": "String",
"firstname": "String",
"lastname": "String"
}
POST: /api/item
Allows users to create an item they are trying to memorize / have already memorized
Item
An item DTO, with only certain fields necessary
{
"name": "String",
"words": "String",
"itemType": "ItemType",
"favorite": boolean,
"learnt": boolean,
"themeIds": list,
"source": SourceDTO {
"id": "String",
"title": "String",
"description": "String",
"author": "String"
}
}
An item DTO
{
"name": "String",
"words": "String",
"dateCreated": "Date",
"dateLastRevised" : "Date",
"itemType": "ItemType",
"favorite": boolean,
"learnt": boolean,
"username": "String",
"themeIds": list,
"practiceSessions": null,
"source": SourceDTO {
"id": "String",
"title": "String",
"description": "String",
"author": "String"
}
}
GET: /api/item
Allows users to get all the items associated with their account, and filter them appropriately
Filter
A FilterDTO, with no feilds necessary ( all nullable ). Returns the items associated with the account that sent the request.
{
"name": "String",
"itemType": "String",
"themeName": "String",
"words": "String",
"favorite": boolean
}
An Array list of item DTOs
{
"name": "String",
"words": "String",
"dateCreated": "Date",
"dateLastRevised" : "Date",
"itemType": "ItemType",
"favorite": boolean,
"learnt": boolean,
"username": "String",
"themeIds": list,
"practiceSessions": null,
"source": SourceDTO {
"id": "String",
"title": "String",
"description": "String",
"author": "String"
}
}
POST: /api/login
Returns a valid JWT token if the user is properly authenticated
AccountDTO
An account DTO containing the accounts username and password only
{
"username": "String",
"password": "String",
"firstname": "String",
"lastname": "String"
}
A valid JWT token
GET: /api/login
Returns an account DTO if the token the user has is valid
AccountDTO
An account DTO containing the account's information
{
"username": "String",
"password": null,
"firstname": "String",
"lastname": "String"
}
A valid JWT token