1. Create new file in the system

1.1. CURL sample

$ curl 'https://minerva-service.lcsb.uni.lu/minerva/api/files/' -X POST \
    -d 'filename=test_file&length=999999' \
    --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" \
    -H 'Content-Type: application/x-www-form-urlencoded'

1.2. Request Parameters

Parameter Description

filename

original name of the file

length

length of the file (in bytes)

1.3. Response Fields

Path Type Description

id

number

unique id in the system

filename

number

original name of the file

length

number

file length

owner

number

login of the file owner

uploadedDataLength

number

total number of uploaded bytes

1.4. Sample Response

{
  "id" : 89,
  "filename" : "test_file",
  "length" : 999999,
  "owner" : "admin",
  "uploadedDataLength" : 0
}

2. Upload content of the file

2.1. CURL sample

$ curl 'https://minerva-service.lcsb.uni.lu/minerva/api/files/89:uploadContent' -X POST \
    --data-binary @input_file.txt \
    --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" \
    -H 'Content-Type: application/octet-stream'

2.2. Request Parameters

Parameter Description

2.3. Response Fields

Path Type Description

id

number

unique id in the system

filename

number

original name of the file

length

number

file length

owner

number

login of the file owner

uploadedDataLength

number

total number of uploaded bytes

2.4. Sample Response

{
  "id" : 89,
  "filename" : "test_file",
  "length" : 999999,
  "owner" : "admin",
  "uploadedDataLength" : 24
}

3. Get info about file

3.1. CURL sample

$ curl 'https://minerva-service.lcsb.uni.lu/minerva/api/files/90' -X GET \
    --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx"

3.2. Path Parameters

Table 1. /minerva/api/files/{fileId}
Parameter Description

fileId

file id

3.3. Response Fields

Path Type Description

id

number

unique id in the system

filename

number

original name of the file

length

number

file length

owner

number

login of the file owner

uploadedDataLength

number

total number of uploaded bytes

3.4. Sample Response

{
  "id" : 90,
  "filename" : "test_file",
  "length" : 11,
  "owner" : "admin",
  "uploadedDataLength" : 11
}