Download OpenAPI specification:Download
Sharry provides a way to share files with others in a convenient way. The core functionality is provided by a server that can be controlled via REST calls.
The calls are divided into 4 categories:
/open/*
: no authentication is required to access/sec/*
: an authenticated user is required/alias/*
: these routes are allowed with a valid alias id
given as header Sharry-Alias
/admin/*
: an authenticated user that is admin is requiredAuthentication works by logging in with username/password (or an
oauth2 flow) that generates a token that has to be sent with every
request to a secured and admin route. It is possible to sent it
via a Cookie
header or the special Sharry-Auth
header.
Files can be uploaded using different methods. There is an endpoint that can take all files and meta data from one single request. For more reliable uploads, the server implements the tus protocol that allows to resume failed or paused uploads.
{- "appName": "string",
- "baseUrl": "string",
- "logoUrl": "string",
- "logoUrlDark": "string",
- "iconUrl": "string",
- "iconUrlDark": "string",
- "footerText": "string",
- "footerVisible": true,
- "signupMode": "string",
- "oauthConfig": [
- {
- "id": "string",
- "name": "string",
- "icon": "string"
}
], - "chunkSize": 0,
- "retryDelays": [
- 0
], - "maxValidity": 0,
- "maxSize": 0,
- "mailEnabled": true,
- "welcomeMessage": "string",
- "defaultLanguage": "string",
- "authRefreshTime": 0,
- "initialPage": "home",
- "oauthOnly": true,
- "aliasMemberEnabled": true,
- "defaultValidity": 0,
- "initialTheme": "string",
- "oauthAutoRedirect": true,
- "proxyAuthEnabled": true,
- "proxyOnly": true,
- "hideLoginForm": true
}
Authenticate with account name and password.
If successful, an authentication token is returned that can be used for subsequent calls to protected routes.
account required | string |
password required | string |
{- "account": "string",
- "password": "string"
}
{- "id": "string",
- "user": "string",
- "admin": true,
- "success": true,
- "message": "string",
- "token": "string",
- "validMs": 0
}
The id
must be a configured OAuth provider. This requests
will redirect the client to the configured provider. After
authentication there, the provider will redirect back to
sharry.
This only works, if sharry uses TLS (https), and the correct callback-url is configured at the provider.
id required | string A share identifier |
This endpoint is for OAuth2 providers when delegating control back to sharry. At this stage, sharry will do basic validation and then finishes logging into the application.
id required | string A share identifier |
code | string |
Authenticate with a token. This can be used to get a new authentication token based on another valid one.
{- "id": "string",
- "user": "string",
- "admin": true,
- "success": true,
- "message": "string",
- "token": "string",
- "validMs": 0
}
Create a new account.
login required | string <ident> |
password required | string <password> |
invite | string <ident> |
{- "login": "string",
- "password": "pa$$word",
- "invite": "string"
}
{- "success": true,
- "message": "string"
}
When signup mode is set to "invite", sharry requires an invitation key when signing up. These keys can be created here. Creating such keys requires an admin user. It also asks for a password that must be set in the configuration file.
password required | string <password> |
{- "password": "pa$$word"
}
{- "success": true,
- "message": "string",
- "key": "string"
}
Lists all available (internal and external) accounts. An optional query parameter can be used to narrow the list down by username. It is a simple substring search in the username property.
q | string A query string |
{- "items": [
- {
- "id": "string",
- "login": "string",
- "source": "string",
- "state": "string",
- "admin": true,
- "email": "string",
- "loginCount": 0,
- "shares": 0,
- "lastLogin": 0,
- "created": 0
}
]
}
Creates a new account. The account is marked as internal and the provided password is used when authenticating. Sharry supports external authentication, these accounts however, cannot be directly created. They are created on demand.
The username and password properties are mandatory. The others are optional or have a sensible default.
login required | string <ident> |
state required | string <accountstate> |
admin required | boolean |
password required | string <password> |
string |
{- "login": "string",
- "state": "string",
- "admin": true,
- "password": "pa$$word",
- "email": "string"
}
{- "success": true,
- "message": "string"
}
Returns details about the account with the given id. Note that the id is not the username, but the account-id.
accountId required | string A account identifier |
{- "id": "string",
- "login": "string",
- "source": "string",
- "state": "string",
- "admin": true,
- "email": "string",
- "loginCount": 0,
- "shares": 0,
- "lastLogin": 0,
- "created": 0
}
Modifies an existing account. It is only possible to modify
state
, email
and the admin
property.
If the email
property is not supplied, an existing email is
removed from the account.
The password can be changed for an account. If it is null
or
empty, it is left unchanged. Also, if the account is not
internal, a given password is ignored.
accountId required | string A account identifier |
state required | string <accountstate> |
admin required | boolean |
string | |
password | string <password> |
{- "state": "string",
- "admin": true,
- "email": "string",
- "password": "pa$$word"
}
{- "success": true,
- "message": "string"
}
Allows the current user to change their e-mail address.
email required | string |
{- "email": "string"
}
{- "success": true,
- "message": "string"
}
Allows users to change their password. This is only valid for internal accounts.
oldPassword required | string <password> |
newPassword required | string <password> |
{- "oldPassword": "pa$$word",
- "newPassword": "pa$$word"
}
{- "success": true,
- "message": "string"
}
Lists all aliases of the current user.
q | string A query string |
{- "items": [
- {
- "id": "string",
- "name": "string",
- "validity": 0,
- "owner": "string",
- "enabled": true,
- "members": {
- "items": [
- {
- "id": "string",
- "login": "string"
}
]
}, - "created": 0
}
]
}
Create a new alias. The id is generated to some random string if not specified, such that the URLs resulting from this alias are not guessable.
id | string <ident> |
name required | string |
validity required | integer <duration> |
enabled required | boolean |
members required | Array of strings <ident> [ items <ident > ] |
{- "id": "string",
- "name": "string",
- "validity": 0,
- "enabled": true,
- "members": [
- "string"
]
}
{- "success": true,
- "message": "string",
- "id": "string"
}
Returns details about an alias for the given id.
id required | string A share identifier |
{- "id": "string",
- "name": "string",
- "validity": 0,
- "owner": "string",
- "enabled": true,
- "members": {
- "items": [
- {
- "id": "string",
- "login": "string"
}
]
}, - "created": 0
}
Change some properties of an existing alias.
The id is optional; if it is not specified a new random one will be generated.
id required | string A share identifier |
id | string <ident> |
name required | string |
validity required | integer <duration> |
enabled required | boolean |
members required | Array of strings <ident> [ items <ident > ] |
{- "id": "string",
- "name": "string",
- "validity": 0,
- "enabled": true,
- "members": [
- "string"
]
}
{- "success": true,
- "message": "string",
- "id": "string"
}
After uploading some files via an alias page, the client can request to notify the owner via e-mail that an upload just finished.
The corresponding user must have an e-mail address in their account and the mail feautre must be enabled in the config file.
id required | string A share identifier |
{- "success": true,
- "message": "string"
}
To send a link to an alias page via e-mail, templates can be specified in the configuration file. The server can then insert the required data (like the cryptic url), so the user is freed from copy-pasting things.
aid required | string The alias identifier. |
{- "subject": "string",
- "body": "string"
}
This will send the given e-mail as is to the specified recipients. This will only work, if the server enabled the mail feature.
recipients required | Array of strings |
subject required | string |
body required | string |
{- "recipients": [
- "string"
], - "subject": "string",
- "body": "string"
}
{- "success": true,
- "message": "string"
}