This is used for finishing the registration process. The user entity is created by the server's admin, this api just sets finished registration (sets the password) using the received token
POST /api/auth/register
{
username: (required) User's unique username
password: (required) User's password
token: (required) Token used for registration. Received from server admin
}
Sample response
{
"success": true,
"message": "User successfully registered.",
"data": {
"id":,
"username":,
"roles": ["ROLE_USER"],
"createdAt":
},
"status": 201
}
POST /api/auth/login
{
username:
password:
}
Sample response:
{
"jwt":
"iat":
"exp":
"refresh_token":
}
Refresh the JWT. Returns a new JWT and a new refresh token
POST /api/auth/refresh
{
refresh_token: (required) The refresh token
}
Sample response:
{
"jwt":
"iat":
"exp":
"refresh_token":
}
Request a password reset. Passwords reset are handled by the admin, this endpoint just sends the request, the new reset token will be generated by the admin and sent to the user. After receiving the reset token, use the same register endpoint to set the new password.
POST /api/auth/{userId}/reset
Sample response
{
"success": true,
"message": "Password reset request sent. You will be contacted by the admin.",
"data": [],
"status": 200
}
PATCH /api/auth/{userId}/edit/password
{
oldPassword: (required) User's old password
newPassword: (required) User's new password
}
Sample response
{
"success": true,
"message": "Password successfully changed.",
"data": {
"id":,
"username":,
"roles": ["ROLE_USER"],
"createdAt":
},
"status": 201
}
POST /api/auth/logout
Headers: Fk-Device-Id
Sample response
{
"success": true,
"message": "User successfully logged out from device: <device>",
"data": [],
"status": 200
}
POST /api/auth/logout/all
Sample response
{
"success": true,
"message": "User successfully logged out from all devices",
"data": [],
"status": 200
}
GET /api/auth/sessions
Sample response
{
"success": true,
"message": "Active sessions fetched.",
"data": [
{
"token":,
"issued_at":
"userAgent":
"deviceId":
"ip":
}
],
"status": 200
}
List the content of the directory given by the parentId query param. If parentId is not given return the content of root directory.
GET /api/files?parentId={id}
Sample response:
{
"success": true,
"message": "SUCCESS",
"data": {
"id":
"name":
"directories": [
{
"id":
"name":
"createdAt":
"updatedAt":
}
],
"files": [
{
"id":
"name":
"size":
"mimeType":
"extension":
"createdAt":
"updatedAt":
}
]
},
"status": 200
}
POST /api/files
{
file: <file>
parentId: (required) The folder in which to upload it. If null upload in root
name: (optional) The name to upload the file with. If not specified or null use the original file name
}
Sample response:
{
"success": true,
"message": "File uploaded successfully.",
"data": {
"id":
"name":
"size":
"extension":
"createdAt":
"updatedAt":
},
"status": 200
}
PATCH /api/files/{id}
{
parentId: (optional) The file's new parent folder. If null new parent is root
name: (optional) The file's new name
}
Sample response:
{
"success": true,
"message": "File updated successfully.",
"data": {
"id":
"name":
"size":
"extension":
"createdAt":
"updatedAt":
},
"status": 200
}
DELETE /api/files/{id}
Sample response:
{
"success": true,
"message": "File {id} deleted successfully.",
"data": [],
"status": 200
}
GET /api/files/folders/{id}
Sample response:
{
"ancestors": [
{
"id":
"name":
},
...
}
}
POST /api/files/folders
{
name: (required) Folder's name
parentId: (required) Folder's parent. If null create in root
}
Sample response:
{
"success": true,
"message": "Directory created successfully.",
"data": {
"id":
"name":
"createdAt":
"updatedAt":
},
"status": 200
}
PATCH /api/files/folders/{id}
{
parentId: (optional) Folder's new parent folder. If null the new parent will be root
name: (optional) Folder's new name
}
Sample response:
{
"success": true,
"message": "Folder updated successfully.",
"data": {
"id":
"name":
"createdAt":
"updatedAt":
},
"status": 200
}
DELETE /api/files/folders/{id}
Sample response:
{
"success": true,
"message": "Folder {id} deleted successfully.",
"data": [],
"status": 200
}
POST /api/files/download
{
folderIds: (optional) Array containing the ids of the folders to download
fileIds: (optional) Array containing the ids of the files to download
}
All error responses have the following structure:
{
"success": false,
"error": "ERROR_CODE",
"message": "Descriptive error message",
"details": {
Object containing specific details about this error
},
"status": STATUS_CODE
}