File Storage API

File storage endpoints provide functionality to store files and binary data through configured file storage backend connections.

Method Endpoint

GET

/cxf/bpc-core/file-storage/file/{fileId}

Description

Retrieves metadata of a file in the file storage.

Path Parameter

fileId

The File ID

Returns

Returns the metadata of the requested file in JSON format.

HTTP Status Code

  • 200 : OK

  • 400 : File ID parameter is missing.

  • 403 : The user has no read permission for the file.

  • 404 : The requested file does not exist.

Content-Type

  • application/json

Required Access Rights

A logged in user or API Key is required.

GET

/cxf/bpc-core/file-storage/files

Description

Retrieves a list of file metadata in the file storage.

Query Parameter

backendConnectionId

The file storage backend connection ID (optional)

bucket

The object stores bucket name (optional)

start

first record to be read (optional, default = 0). Default is 0.

limit

number of records to read (optional, default = 1000, max. 10.000). Default is 1000.

sort

sort instruction (ExtJS-JSON) (optional)

Returns

Returns a JSON array containing metadata for files stored in the object store bucket.

HTTP Status Code

  • 200 : OK

Content-Type

  • application/json

Required Access Rights

A logged in user or API Key is required.

GET

/cxf/bpc-core/file-storage/download/{fileId}

Description

Downloads the requested file from the file storage.

This is done by redirecting to a presigned download URL.

Path Parameter

fileId

The File ID

Returns

The requested file as a download.

HTTP Status Code

  • 307 : Redirect to download

  • 400 : File ID parameter is missing.

  • 403 : The user has no read permission to request a download.

  • 404 : The requested file does not exist.

Content-Type

  • application/json

Required Access Rights

A logged in user or API Key is required.

GET

/cxf/bpc-core/file-storage/download-url/{fileId}

Description

Get a download URL for the requested file from the file storage.

The return body is a presigned download URL to the file.

Path Parameter

fileId

The File ID

Returns

A temporary valid download url for the requested file.

HTTP Status Code

  • 200 : Download URL

  • 400 : File ID parameter is missing.

  • 403 : The user has no read permission to request a download.

  • 404 : The requested file does not exist.

Content-Type

  • application/json

Required Access Rights

A logged in user or API Key is required.

/cxf/bpc-core/file-storage/upload

Description

Create a file in the file storage.

The file and necessary metadata is passed via multipart form data. Required are the following form fields:

  • file: the uploaded file

  • bucket: the name of the bucket to upload to

  • backendConnectionId: the ID of the configured file storage backend connection

  • readRestriction: the read restriction

  • writeRestriction: the write restriction

Additionally, a form field creatorServiceId can be specified, referring to the service instance that triggers the upload.

The read and write restrictions use the following format:

{
    "user": "hans_schmidt",
    "organisations": [ "DEFAULT" ],
    "roles": [ "expert", "advanced", "beginner" ],
    "rights": [ "loadModule_monitor" ]
}

If a user is specified in a restriction, all other fields are ignored, and only this user fulfils the restriction.

Note, the uploader needs to fulfill both read and write restrictions.

Consumes

  • multipart/form-data

Returns

The created file metadata, including a success flag.

HTTP Status Code

  • 200 : File has been stored

  • 400 : Missing form data content

  • 403 : The user does not fulfill the read or write restrictions.

  • 404 : The requested file does not exist.

Content-Type

  • application/json

Required Access Rights

A logged in user or API Key is required.

PUT

/cxf/bpc-core/file-storage/upload/{fileId}

Description

Replaces an existing file in the file storage.

The file is passed via multipart form data.

Consumes

  • multipart/form-data

Path Parameter

fileId

The File ID

Returns

The updated file metadata.

HTTP Status Code

  • 200 : File has been updated

  • 400 : Missing file ID parameter or file upload.

  • 403 : The user does not fulfill the write restrictions.

  • 404 : The requested file does not exist.

Content-Type

  • application/json

Required Access Rights

A logged in user or API Key is required.

PUT

/cxf/bpc-core/file-storage/file/{fileId}

Description

Updates the metadata of a file in the file storage.

Updates can be applied to 'File Name', 'Read Restrictions' and 'Write Restrictions'. Fields in the PUT-DTO that are left out will not be updated.

Path Parameter

fileId

The File ID

Returns

HTTP Status Code

  • 200 : Returns the updated file store item

  • 400 : File ID parameter is missing.

  • 403 : The user has no write permission to perform deletion.

  • 404 : The requested file does not exist.

Content-Type

  • application/json

Required Access Rights

A logged in user or API Key is required.

/cxf/bpc-core/file-storage/file/{fileId}

Description

Deletes a file in the file storage.

Path Parameter

fileId

The File ID

Returns

HTTP Status Code

  • 204 : Deletion was successful.

  • 400 : File ID parameter is missing.

  • 403 : The user has no write permission to perform deletion.

  • 404 : The requested file does not exist.

Content-Type

  • application/json

Required Access Rights

A logged in user or API Key is required.