8 file endpoints
Tim Svensson edited this page 2026-05-29 10:48:36 +00:00

File endpoints

GET health check

Path to endpoint

GET /file/

Return values

Status message

When no error occurs

  • When service is running
  • Status: 200 OK

GET file

Path to endpoint

GET /file/f/{uuid}

Required values

  • uuid: file UUID

Return values

  • A file, or
  • A JSON response

When no error occurs

  • Returns the file with the UUID requested
  • Status: 200 OK

When error occurs

  • Returns a JSON file with an error message
  • Status: 400 Bad request

POST file

Path to endpoint

POST /file/upload

Required values

Return values

A JSON object:

  • IsSuccess: boolean
  • ErrorMessage: Any error thrown
  • Name: the UUID assigned to the uploaded file

When no error occurs

  • File is uploaded
  • Status: 200 OK

When error occurs

  • IsSuccess set to false, ErrorMessage set to error thrown
  • Status 200 OK

GET many

Path to endpoint

GET /file/many?contenttype=x&limit=y

Required values

  • ContentType: string to match
  • Limit: number of files to fetch

Return values

A JSON object containing an array of FileData entries:

{
    FileDatas: [
        {
            uuid: UUID of file,
            path: Path to file,
            extension: File extension,
            contentType: File content-type,
            userId: ID of user that uploaded file
            userProvidedFileName: The name of the file when uploaded
        }
}

When no error occurs

  • Returns a JSON array,
  • Status: 200 OK