REST-API: App API
Erzeugt aus dem OpenAPI-Dokument des Daemons. Konventionen, Anmeldung, der CSRF-Header und der WebSocket stehen unter API.
GET /api/app-files/content
Abschnitt betitelt „GET /api/app-files/content“The file of a file token from POST /api/app/files/url, with range requests, for 5 minutes; inline for images, audio, video and PDF, an attachment with download=true. Needs no session cookie and no Authorization header: the token is the query parameter pithyx-token.
Parameter
| Name | Ort | Typ | Pflicht | Beschreibung |
|---|---|---|---|---|
download |
query | boolean | nein |
Antworten
- 200
Jeder Fehler antwortet mit Problem Details (application/problem+json) und einem stabilen Code aus der Fehlerreferenz.
GET /api/app/directory/groups
Abschnitt betitelt „GET /api/app/directory/groups“Every group of the box but the built-in one. Needs the permission directory.read.
Antworten
- 200:
application/json: DirectoryGroup[]
Jeder Fehler antwortet mit Problem Details (application/problem+json) und einem stabilen Code aus der Fehlerreferenz.
GET /api/app/directory/users
Abschnitt betitelt „GET /api/app/directory/users“Every active user of the box with its groups. Needs the permission directory.read.
Antworten
- 200:
application/json: DirectoryUser[]
Jeder Fehler antwortet mit Problem Details (application/problem+json) und einem stabilen Code aus der Fehlerreferenz.
GET /api/app/files/content
Abschnitt betitelt „GET /api/app/files/content“The content of a file in a location, with range requests. A shared folder needs files.shares and files.read.
Parameter
| Name | Ort | Typ | Pflicht | Beschreibung |
|---|---|---|---|---|
share |
query | string | nein | |
storage |
query | string | nein | |
path |
query | string | nein |
Antworten
- 200
Jeder Fehler antwortet mit Problem Details (application/problem+json) und einem stabilen Code aus der Fehlerreferenz.
PUT /api/app/files/content
Abschnitt betitelt „PUT /api/app/files/content“Streams the body into the file at path (fs.entry.exists unless overwrite=true). A shared folder needs files.shares and files.write, a storage request a mapping for reading and writing; the user needs write access either way.
Parameter
| Name | Ort | Typ | Pflicht | Beschreibung |
|---|---|---|---|---|
share |
query | string | nein | |
storage |
query | string | nein | |
path |
query | string | nein | |
overwrite |
query | boolean | nein |
Antworten
- 201:
application/json: AppFileEntry
Jeder Fehler antwortet mit Problem Details (application/problem+json) und einem stabilen Code aus der Fehlerreferenz.
GET /api/app/files/entry
Abschnitt betitelt „GET /api/app/files/entry“A file or folder in a location, with whether the app may write it.
Parameter
| Name | Ort | Typ | Pflicht | Beschreibung |
|---|---|---|---|---|
share |
query | string | nein | |
storage |
query | string | nein | |
path |
query | string | nein |
Antworten
- 200:
application/json: AppFileEntry
Jeder Fehler antwortet mit Problem Details (application/problem+json) und einem stabilen Code aus der Fehlerreferenz.
POST /api/app/files/folders
Abschnitt betitelt „POST /api/app/files/folders“Creates a folder in a location, with the same rules as writing a file.
Parameter
| Name | Ort | Typ | Pflicht | Beschreibung |
|---|---|---|---|---|
share |
query | string | nein | |
storage |
query | string | nein | |
path |
query | string | nein |
Antworten
- 201:
application/json: AppFileEntry
Jeder Fehler antwortet mit Problem Details (application/problem+json) und einem stabilen Code aus der Fehlerreferenz.
POST /api/app/files/handles
Abschnitt betitelt „POST /api/app/files/handles“The desktop tells the daemon that the user handed one file of a shared folder to this window (a pick, a save dialog or Open with). The window may then read it with files.read, or also write it with files.write, without files.shares; only this exact path, and the user’s own rights still apply. Only the desktop calls this, after a dialog the user answered.
Anfrage-Body: application/json: AppHandleRequest
Antworten
- 204
Jeder Fehler antwortet mit Problem Details (application/problem+json) und einem stabilen Code aus der Fehlerreferenz.
GET /api/app/files/list
Abschnitt betitelt „GET /api/app/files/list“One page of a folder in a shared folder (share, needs files.shares) or a storage request of the manifest (storage), as the user and with the user’s rights. Parameters as for GET /api/files/{shareId}/list.
Parameter
| Name | Ort | Typ | Pflicht | Beschreibung |
|---|---|---|---|---|
share |
query | string | nein | |
storage |
query | string | nein | |
path |
query | string | nein | |
sort |
query | string | nein | |
order |
query | string | nein | |
limit |
query | integer (int32) | nein | |
cursor |
query | string | nein |
Antworten
- 200:
application/json: AppFolderPage
Jeder Fehler antwortet mit Problem Details (application/problem+json) und einem stabilen Code aus der Fehlerreferenz.
POST /api/app/files/operations
Abschnitt betitelt „POST /api/app/files/operations“As POST /api/files/operations, with each place a shared folder (share, needs files.shares, files.read where entries are copied or moved from and files.write where anything changes) or a storage request (storage, needs a mapping for reading and writing where anything changes). Follow the job on jobs/
Anfrage-Body: application/json: AppFileOperationRequest
Antworten
- 202:
application/json: Job
Jeder Fehler antwortet mit Problem Details (application/problem+json) und einem stabilen Code aus der Fehlerreferenz.
POST /api/app/files/rename
Abschnitt betitelt „POST /api/app/files/rename“Renames a file or folder within its folder; an existing name is never replaced. Needs the permissions of writing: files.shares and files.write for a shared folder.
Anfrage-Body: application/json: AppRenameRequest
Antworten
- 200:
application/json: AppFileEntry
Jeder Fehler antwortet mit Problem Details (application/problem+json) und einem stabilen Code aus der Fehlerreferenz.
GET /api/app/files/shares
Abschnitt betitelt „GET /api/app/files/shares“The shared folders the user can use, without their place on the host. Needs the permission files.shares.
Antworten
- 200:
application/json: AppShareInfo[]
Jeder Fehler antwortet mit Problem Details (application/problem+json) und einem stabilen Code aus der Fehlerreferenz.
GET /api/app/files/trash
Abschnitt betitelt „GET /api/app/files/trash“The recycle bin of a shared folder, as GET /api/files/{shareId}/trash. Needs files.shares and files.read.
Parameter
| Name | Ort | Typ | Pflicht | Beschreibung |
|---|---|---|---|---|
share |
query | string | nein | |
cursor |
query | string | nein | |
limit |
query | integer (int32) | nein |
Antworten
- 200:
application/json: TrashPage
Jeder Fehler antwortet mit Problem Details (application/problem+json) und einem stabilen Code aus der Fehlerreferenz.
POST /api/app/files/trash/delete
Abschnitt betitelt „POST /api/app/files/trash/delete“Starts a job that deletes recycle bin items for good. Needs files.shares and files.write.
Anfrage-Body: application/json: AppTrashRequest
Antworten
- 202:
application/json: Job
Jeder Fehler antwortet mit Problem Details (application/problem+json) und einem stabilen Code aus der Fehlerreferenz.
POST /api/app/files/trash/empty
Abschnitt betitelt „POST /api/app/files/trash/empty“Starts a job that deletes everything in the recycle bin for good. Needs files.shares and files.write.
Anfrage-Body: application/json: AppTrashRequest
Antworten
- 202:
application/json: Job
Jeder Fehler antwortet mit Problem Details (application/problem+json) und einem stabilen Code aus der Fehlerreferenz.
POST /api/app/files/trash/restore
Abschnitt betitelt „POST /api/app/files/trash/restore“Starts a job that puts recycle bin items back. Needs files.shares and files.write.
Anfrage-Body: application/json: AppTrashRequest
Antworten
- 202:
application/json: Job
Jeder Fehler antwortet mit Problem Details (application/problem+json) und einem stabilen Code aus der Fehlerreferenz.
POST /api/app/files/url
Abschnitt betitelt „POST /api/app/files/url“A URL that reads one file with range requests for 5 minutes, without the desktop session. Needs the permissions of reading the file.
Anfrage-Body: application/json: AppFileUrlRequest
Antworten
- 200:
application/json: AppFileUrl
Jeder Fehler antwortet mit Problem Details (application/problem+json) und einem stabilen Code aus der Fehlerreferenz.
GET /api/app/files/versions
Abschnitt betitelt „GET /api/app/files/versions“Earlier versions of a file or folder of a shared folder, as GET /api/files/{shareId}/versions. Needs files.shares and files.read.
Parameter
| Name | Ort | Typ | Pflicht | Beschreibung |
|---|---|---|---|---|
share |
query | string | nein | |
path |
query | string | nein |
Antworten
- 200:
application/json: FileVersionList
Jeder Fehler antwortet mit Problem Details (application/problem+json) und einem stabilen Code aus der Fehlerreferenz.
POST /api/app/files/versions/restore
Abschnitt betitelt „POST /api/app/files/versions/restore“Starts a job that copies a version back, as POST /api/files/{shareId}/versions/restore. Needs files.shares, files.read and files.write.
Anfrage-Body: application/json: AppVersionRestoreRequest
Antworten
- 202:
application/json: Job
Jeder Fehler antwortet mit Problem Details (application/problem+json) und einem stabilen Code aus der Fehlerreferenz.
POST /api/app/jobs/{id}/cancel
Abschnitt betitelt „POST /api/app/jobs/{id}/cancel“Cancels a job the token’s app started for the user; any other job is jobs.job.not_found.
Parameter
| Name | Ort | Typ | Pflicht | Beschreibung |
|---|---|---|---|---|
id |
path | integer (int64) | ja |
Antworten
- 204
Jeder Fehler antwortet mit Problem Details (application/problem+json) und einem stabilen Code aus der Fehlerreferenz.
POST /api/app/logs
Abschnitt betitelt „POST /api/app/logs“Stores log entries of the token’s app for its user, as source app/
Anfrage-Body: application/json: AppLogBatch
Antworten
- 200:
application/json: AppLogResult
Jeder Fehler antwortet mit Problem Details (application/problem+json) und einem stabilen Code aus der Fehlerreferenz.
POST /api/app/notifications
Abschnitt betitelt „POST /api/app/notifications“A notification of the token’s app for its user, with at most two buttons, data that comes back with a click and a tag that replaces the app’s earlier notification with the same tag. Needs the permission notifications.
Anfrage-Body: application/json: AppNotifyRequest
Antworten
- 201:
application/json: Notification
Jeder Fehler antwortet mit Problem Details (application/problem+json) und einem stabilen Code aus der Fehlerreferenz.
GET /api/app/storage
Abschnitt betitelt „GET /api/app/storage“The keys the token’s app stored for its user.
Antworten
- 200:
application/json: AppStorageKeys
Jeder Fehler antwortet mit Problem Details (application/problem+json) und einem stabilen Code aus der Fehlerreferenz.
GET /api/app/storage/value
Abschnitt betitelt „GET /api/app/storage/value“A value the token’s app stored for its user under key, or null.
Parameter
| Name | Ort | Typ | Pflicht | Beschreibung |
|---|---|---|---|---|
key |
query | string | nein |
Antworten
- 200:
application/json: AppStorageValue
Jeder Fehler antwortet mit Problem Details (application/problem+json) und einem stabilen Code aus der Fehlerreferenz.
PUT /api/app/storage/value
Abschnitt betitelt „PUT /api/app/storage/value“Stores a value of the token’s app for its user: keys of 1 to 128 characters, values of at most 64 KB of JSON, at most 1 MB per app and user (app.storage.too_large).
Parameter
| Name | Ort | Typ | Pflicht | Beschreibung |
|---|---|---|---|---|
key |
query | string | nein |
Anfrage-Body: application/json: AppStorageValue
Antworten
- 204
Jeder Fehler antwortet mit Problem Details (application/problem+json) und einem stabilen Code aus der Fehlerreferenz.
DELETE /api/app/storage/value
Abschnitt betitelt „DELETE /api/app/storage/value“Removes a value of the token’s app for its user; a missing one is no error.
Parameter
| Name | Ort | Typ | Pflicht | Beschreibung |
|---|---|---|---|---|
key |
query | string | nein |
Antworten
- 204
Jeder Fehler antwortet mit Problem Details (application/problem+json) und einem stabilen Code aus der Fehlerreferenz.
POST /api/app/tickets
Abschnitt betitelt „POST /api/app/tickets“A one-time ticket for one WebSocket to an endpoint of the app’s backend (app.backend.endpoint_unknown for a name the manifest does not declare), valid 30 seconds, bound to what the host token is bound to.
Anfrage-Body: application/json: AppTicketRequest
Antworten
- 200:
application/json: AppTicket
Jeder Fehler antwortet mit Problem Details (application/problem+json) und einem stabilen Code aus der Fehlerreferenz.